Sync master tokens only with those in play_hosts

This commit is contained in:
Matthew Mosesohn 2016-10-21 14:43:41 +03:00
parent 0d62e53939
commit ccbdf6ec49

View file

@ -27,7 +27,7 @@
sync_tokens: true sync_tokens: true
when: >- when: >-
{%- set tokens = {'sync': False} -%} {%- set tokens = {'sync': False} -%}
{%- for server in groups['kube-master'] {%- for server in groups['kube-master'] | intersect(play_hosts)
if (not hostvars[server].known_tokens.stat.exists) or if (not hostvars[server].known_tokens.stat.exists) or
(hostvars[server].known_tokens.stat.checksum != known_tokens_master.stat.checksum|default('')) -%} (hostvars[server].known_tokens.stat.checksum != known_tokens_master.stat.checksum|default('')) -%}
{%- set _ = tokens.update({'sync': True}) -%} {%- set _ = tokens.update({'sync': True}) -%}