use template instead of lineinfile