That playbook tells ansible to create the template on the 'all' group
i.e. everything in the inventory.

That's what it's trying to do.

for your use case, just make 2 roles: ntp_server and ntp_client, and
apply them to groups as
required.

On 22 November 2016 at 05:58, Jon Forrest <[email protected]> wrote:
> As a follow up, I realize that I made a couple of mistakes in my
> original posting. Unfortunately, fixing these mistakes didn't change
> the results.
>
> templates/jon.j2 is now
>
> {% for backend in groups['ntpservers_datacenter'] %}
>     server {{ inventory_hostname }} {{ backend }}
> {% endfor %}
>
>
> and jon.inv is now
>
> [datacenter]
> host1.example.com
> host2.example.com
>
> [ntpservers_datacenter]
> host1.example.com
>
> Jon
>
> --
> 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/f1c58feb-528a-4c6d-884b-3f3095a63a4e%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

-- 
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/CAK5eLPTHmUZvC1oQEbK6B5Bf1JQPeSUr_m68BJfLV2oJM0c6pQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to