How can I use with_items twice in a single tasks?
For example , using line-in-file , I wish to update few parameters on a
file that can be found on 2 locations
- name: update file
lineinfile:
path: {{ item }} *<-- This should describe the files*
regexp: "{{ item.from }}"
line: "{{ item.replace_with }}"
with_items:
- { from: parameter1= , replace_with: parameter1=test1 }
- { from: parameter1= , replace_with: parameter1=test2 }
with_items: *-- > This should be for the path*
- “/opt/file1”
- “/opt/file2”
--
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/14ead263-3f7c-4e3a-825d-9882ed3aa777n%40googlegroups.com.