Add spaces inside the double quote? Mike
> On Jul 20, 2022, at 11:44, Tony Wong <[email protected]> wrote: > > I am really stuck trying to insert a line with lineinfile with 5 space > indentation > > any idea? > > task is > > - name: add line > lineinfile: > backup: no > #backrefs: yes > state: present > path: "{{ file_path }}" > #regexp: '^(\s*)[#]?{{ item.search }}(: )*' > insertafter: "{{ line.replace_with }}" > line: "\n{{ line.line_to_add }}" > #line: '\1{{ item.search }}\2\n\1{{ item.add }}' > with_items: > - { search: "{{ line.replace_with }}", add: "{{ line.line_to_add }}" } > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/96481aa3-abba-4448-a48c-3870e15a76f2n%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1F17C409-5710-42AC-8225-8C507D4518C9%40gmail.com.
