Can the following be refactored so the following array only appears once in
the code?
- [ '/home/youruser/a', '/home/youruser/b', '/home/youruser/c',
'/home/youruser/d' ]
---
- hosts: yourhost
user: root
gather_facts: no
tasks:
- lineinfile: dest={{ item[0] }}/.gitignore create=yes regexp='{{
item[1] }}' line='*.{{ item[1] }}'
with_nested:
- [ '/home/youruser/a', '/home/youruser/b', '/home/youruser/c',
'/home/youruser/d' ]
- [ 'lck', 'log', 'Log' ]
- shell: /usr/bin/git init chdir={{ item[0] }}
with_items:
- [ '/home/youruser/a', '/home/youruser/b', '/home/youruser/c',
'/home/youruser/d' ]
- shell: /usr/bin/git add -A ; /usr/bin/git commit -m 'auto'; exit 0
chdir={{ item[0] }}
with_items:
- [ '/home/youruser/a', '/home/youruser/b', '/home/youruser/c',
'/home/youruser/d' ]
--
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].
For more options, visit https://groups.google.com/groups/opt_out.