Discussion:
[ansible-project] Create directories based on inventory_hostname with with_items
Tunghsiao Liu
2015-07-14 06:06:02 UTC
Permalink
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 ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
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.
Brian Coca
2015-07-14 11:20:43 UTC
Permalink
bad mustache handling

with_items: "{{enabled_sites[inventory_hostname]}}"
--
Brian Coca
--
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 ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8mv9RH%3DBRLvRuNEmJHOxPy3NkQrob04tPnFQPVYBRe3zA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...