On 11/22/16 12:20 PM, Dick Davies wrote:
On the 'how do i apply roles to specific hosts, I'd go for a full ntp_server role and an ntp_client role. Then your site.yml looks like
I appreciate you taking the time to follow up on this. [...] I wish our environment were that simple. However, here at the day job we have >3 separate "silos", each of which will be running its own time server pool, which the clients in the silo will connect to. So, with the guidance you gave me, I came up with the following structure I'm using in a Vagrant-created test environment to illustrate my idea: ------- ... general stuff for all hosts {% if inventory_hostname in groups['ntp-servers'] %} # Servers to sync with. {% for host in groups['ntp-servers'] %} pool {{ host }} {% endfor %} # Servers to get time from server 0.ubuntu.pool.ntp.org iburst server 1.ubuntu.pool.ntp.org iburst server 2.ubuntu.pool.ntp.org iburst server 3.ubuntu.pool.ntp.org iburst # Use Ubuntu's ntp server as a fallback. server ntp.ubuntu.com iburst {%elif inventory_hostname in groups['ntp-clients'] %} # Servers to get time from. {% for host in groups['ntp-servers'] %} server {{ host }} iburst {% endfor %} {% endif %} ... more general stuff ------ I'll have to replicate this for each of our silos, replacing 'ntp-servers' and 'ntp-clients' with the appropriate group names (and defining the groups properly). I'm not completely satisfied with this approach, because it requires too much replication. It might be possible to add an outer loop that iterates over the silo names. But I'm way farther along than I was yesterday. Thanks! 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1f415984-00ef-85ee-4ef8-c890d1667e20%40gmail.com. For more options, visit https://groups.google.com/d/optout.