Hello,
I'm trying to creating directories based on different inventory_hostname
with with_items but it seems doesn't work:
in hosts:
[website-static-pages]
server1
server2
in vars.yml:
enabled_sites:
server1:
- website1.com
- website2.com
- website3.com
server2:
- website4.com
- website5.com
in task.yml:
- name: create site public directories
file: path=/srv/www/{{ item }}/public_html/ state=directory
with_items: enabled_sites["{{ inventory_hostname }}"]
It seems that this syntax doesn't work with Ansible, any idea?
Thank you!
--
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/bd763202-0ce1-4bf5-8a68-56ff0e7f2395%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.