Dear Ansible developers and users,
I really like the groups_vars and host_vars concept of Ansible, and I was
thinking of a way to emulate this for files. So here's an example playbook:
- hosts: all
tasks:
- debug: var=item
with_first_found:
- paths:
- host_files/{{ inventory_hostname }}
files:
- myfile
- paths: "{{ group_names }}"
files:
- myfile
This works just fine for a host-specific file, because there can only ever
be one directory for a host. it also sort-of works for groups, but there
are 2 complications:
1. the order of the names in group_names does not match the inventory
parent-child order; and
2. I don't know how to prefix "group_files" to each group name, in order to
keep my group files in their own directory.
Can anyone suggest how I can achieve this? Or does this require a new
custom plugin?
Anand
--
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/4980979b-8089-4f68-9a1d-2d4bc36b0157%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.