I have nodes in AWS and I'd like to use the dynamic inventory to create a
template. Currently I cant get the facts from all the nodes into the one
template file. The template only gets populated with the node thats in
"role deploy" and doesnt include the monitor group.
playbook ---------
- name: Gather facts
ec2_remote_facts:
ec2_region: us-east-1
filters:
instance-state-name: running
"tag:Role": monitor
become: false
register: ec2
- name: Deploy host template
template: src=filename dest=filename
when: "'tag_Role_deploy' in group_names"
jinja2 template-------------
{% for host in groups['tag_Name_monitor'] %}
{{ host }}
{% endfor %}
Thanks
--
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/4341096d-6189-45fa-9d16-a5f786284d1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.