Just starting out with Ansible. Currently I've got:
---
- hosts: myhost.example.com
remote_user: user1
sudo: yes
tasks:
- name: remove select files in root
command: /bin/rm /root/{{ item }}
with_items:
- testing
- testing2
This works fine but for each directory I have to create a new task.
What I'd like to do is something like:
tasks:
- name: remove files
command: /bin/rm {{ dir/files }}
dirs_files:
dir: '/root'
files:
- testing
- testing2
dir: '/home/user'
files:
- testfile
- testfile2
Obviously that's not going to work but hopefully it illustrates what I'd
like to do. I just don't want to have to write different tasks for
different directories.
Any help appreciated.
Thanks,
Kent
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/c7be448b-8561-4009-89b5-ce4470c405a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.