Fix ansible syntax to avoid ansible warnings (again) (#3509)
* Fix ansible syntax to avoid ansible warnings (again) * warn: false on tar -cfz * wrong placement of warn:falsepull/3493/head
parent
6549b8f8ae
commit
fcd8d850dc
|
@ -57,12 +57,8 @@
|
||||||
- name: "Check_certs | Set 'sync_certs' to true"
|
- name: "Check_certs | Set 'sync_certs' to true"
|
||||||
set_fact:
|
set_fact:
|
||||||
sync_certs: true
|
sync_certs: true
|
||||||
when: |-
|
when:
|
||||||
{%- set certs = {'sync': False} -%}
|
- gen_node_certs[inventory_hostname] or
|
||||||
{% if gen_node_certs[inventory_hostname] or
|
(not etcdcert_node.results[0].stat.exists|default(false)) or
|
||||||
(not etcdcert_node.results[0].stat.exists|default(False)) or
|
(not etcdcert_node.results[1].stat.exists|default(false)) or
|
||||||
(not etcdcert_node.results[1].stat.exists|default(False)) or
|
(etcdcert_node.results[1].stat.checksum|default('') != etcdcert_master.files|selectattr("path", "equalto", etcdcert_node.results[1].stat.path)|map(attribute="checksum")|first|default(''))
|
||||||
(etcdcert_node.results[1].stat.checksum|default('') != etcdcert_master.files|selectattr("path", "equalto", etcdcert_node.results[1].stat.path)|map(attribute="checksum")|first|default('')) -%}
|
|
||||||
{%- set _ = certs.update({'sync': True}) -%}
|
|
||||||
{% endif %}
|
|
||||||
{{ certs.sync }}
|
|
||||||
|
|
|
@ -24,8 +24,7 @@
|
||||||
|
|
||||||
- name: "Check_tokens | Set 'sync_tokens' to true"
|
- name: "Check_tokens | Set 'sync_tokens' to true"
|
||||||
set_fact:
|
set_fact:
|
||||||
sync_tokens: true
|
sync_tokens: >-
|
||||||
when: >-
|
|
||||||
{%- set tokens = {'sync': False} -%}
|
{%- set tokens = {'sync': False} -%}
|
||||||
{%- for server in groups['kube-master'] | intersect(ansible_play_batch)
|
{%- for server in groups['kube-master'] | intersect(ansible_play_batch)
|
||||||
if (not hostvars[server].known_tokens.stat.exists) or
|
if (not hostvars[server].known_tokens.stat.exists) or
|
||||||
|
|
|
@ -46,6 +46,8 @@
|
||||||
|
|
||||||
- name: Gen_tokens | Gather tokens
|
- name: Gen_tokens | Gather tokens
|
||||||
shell: "tar cfz - {{ tokens_list.stdout_lines | join(' ') }} | base64 --wrap=0"
|
shell: "tar cfz - {{ tokens_list.stdout_lines | join(' ') }} | base64 --wrap=0"
|
||||||
|
args:
|
||||||
|
warn: false
|
||||||
register: tokens_data
|
register: tokens_data
|
||||||
check_mode: no
|
check_mode: no
|
||||||
delegate_to: "{{groups['kube-master'][0]}}"
|
delegate_to: "{{groups['kube-master'][0]}}"
|
||||||
|
|
|
@ -79,9 +79,10 @@
|
||||||
|
|
||||||
- name: reset | gather mounted kubelet dirs
|
- name: reset | gather mounted kubelet dirs
|
||||||
shell: mount | grep /var/lib/kubelet/ | awk '{print $3}' | tac
|
shell: mount | grep /var/lib/kubelet/ | awk '{print $3}' | tac
|
||||||
|
args:
|
||||||
|
warn: false
|
||||||
check_mode: no
|
check_mode: no
|
||||||
register: mounted_dirs
|
register: mounted_dirs
|
||||||
warn: false
|
|
||||||
tags:
|
tags:
|
||||||
- mounts
|
- mounts
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue