Fix ansible syntax to avoid ansible warnings (#3499)
parent
cdce8c81da
commit
dd5327ef9e
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
- name: Install python on fedora
|
- name: Install python on fedora
|
||||||
raw: "dnf install --assumeyes --quiet python"
|
raw: "dnf install --assumeyes --quiet python"
|
||||||
when: "{{ need_bootstrap.results | map(attribute='rc') | sort | last | bool }}"
|
when: need_bootstrap.results | map(attribute='rc') | sort | last | bool
|
||||||
|
|
||||||
- name: Install required python packages
|
- name: Install required python packages
|
||||||
dnf:
|
dnf:
|
||||||
|
|
|
@ -21,6 +21,6 @@
|
||||||
when:
|
when:
|
||||||
- not skip_downloads|default(false)
|
- not skip_downloads|default(false)
|
||||||
- item.value.enabled
|
- item.value.enabled
|
||||||
- "{{ item.value.container | default(False) }}"
|
- item.value.container | default(false)
|
||||||
- download_run_once
|
- download_run_once
|
||||||
- group_names | intersect(download.groups) | length
|
- group_names | intersect(download.groups) | length
|
||||||
|
|
|
@ -17,5 +17,5 @@
|
||||||
register: weave_status
|
register: weave_status
|
||||||
retries: 180
|
retries: 180
|
||||||
delay: 5
|
delay: 5
|
||||||
until: "{{ weave_status.status == 200 and 'Status: ready' in weave_status.content }}"
|
until: "weave_status.status == 200 and 'Status: ready' in weave_status.content"
|
||||||
when: inventory_hostname == groups['kube-master'][0]
|
when: inventory_hostname == groups['kube-master'][0]
|
||||||
|
|
|
@ -123,7 +123,7 @@
|
||||||
when: inventory_hostname in groups['kube-master'] and
|
when: inventory_hostname in groups['kube-master'] and
|
||||||
inventory_hostname != groups['kube-master'][0] and
|
inventory_hostname != groups['kube-master'][0] and
|
||||||
(not item in kubecert_node.files | map(attribute='path') | map("basename") | list or
|
(not item in kubecert_node.files | map(attribute='path') | map("basename") | list or
|
||||||
kubecert_node.files | selectattr("path", "equalto", "{{ kube_cert_dir }}/{{ item }}") | map(attribute="checksum")|first|default('') != kubecert_master.files | selectattr("path", "equalto", "{{ kube_cert_dir }}/{{ item }}") | map(attribute="checksum")|first|default(''))
|
kubecert_node.files | selectattr("path", "equalto", '%s/%s'|format(kube_cert_dir, item)) | map(attribute="checksum")|first|default('') != kubecert_master.files | selectattr("path", "equalto", '%s/%s'|format(kube_cert_dir, item)) | map(attribute="checksum")|first|default(''))
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ my_master_certs + all_node_certs }}"
|
- "{{ my_master_certs + all_node_certs }}"
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@
|
||||||
when: inventory_hostname in groups['kube-node'] and
|
when: inventory_hostname in groups['kube-node'] and
|
||||||
inventory_hostname != groups['kube-master'][0] and
|
inventory_hostname != groups['kube-master'][0] and
|
||||||
(not item in kubecert_node.files | map(attribute='path') | map("basename") | list or
|
(not item in kubecert_node.files | map(attribute='path') | map("basename") | list or
|
||||||
kubecert_node.files | selectattr("path", "equalto", "{{ kube_cert_dir }}/{{ item }}") | map(attribute="checksum")|first|default('') != kubecert_master.files | selectattr("path", "equalto", "{{ kube_cert_dir }}/{{ item }}") | map(attribute="checksum")|first|default(''))
|
kubecert_node.files | selectattr("path", "equalto", '%s/%s'|format(kube_cert_dir, item)) | map(attribute="checksum")|first|default('') != kubecert_master.files | selectattr("path", "equalto", '%s/%s'|format(kube_cert_dir, item)) | map(attribute="checksum")|first|default(''))
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ my_node_certs }}"
|
- "{{ my_node_certs }}"
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,7 @@
|
||||||
shell: mount | grep /var/lib/kubelet/ | awk '{print $3}' | tac
|
shell: mount | grep /var/lib/kubelet/ | awk '{print $3}' | tac
|
||||||
check_mode: no
|
check_mode: no
|
||||||
register: mounted_dirs
|
register: mounted_dirs
|
||||||
|
warn: false
|
||||||
tags:
|
tags:
|
||||||
- mounts
|
- mounts
|
||||||
|
|
||||||
|
@ -209,7 +210,9 @@
|
||||||
networking
|
networking
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
state: restarted
|
state: restarted
|
||||||
when: ansible_os_family not in ["CoreOS", "Container Linux by CoreOS"] and reset_restart_network
|
when:
|
||||||
|
- ansible_os_family not in ["CoreOS", "Container Linux by CoreOS"]
|
||||||
|
- reset_restart_network
|
||||||
tags:
|
tags:
|
||||||
- services
|
- services
|
||||||
- network
|
- network
|
||||||
|
|
|
@ -83,15 +83,15 @@
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
msg: "{{droplets}}, {{inventory_path}}"
|
msg: "{{droplets}}, {{inventory_path}}"
|
||||||
when: "{{ state == 'present' }}"
|
when: state == 'present'
|
||||||
|
|
||||||
- name: Template the inventory
|
- name: Template the inventory
|
||||||
template:
|
template:
|
||||||
src: ../templates/inventory-do.j2
|
src: ../templates/inventory-do.j2
|
||||||
dest: "{{ inventory_path }}"
|
dest: "{{ inventory_path }}"
|
||||||
when: "{{ state == 'present' }}"
|
when: state == 'present'
|
||||||
|
|
||||||
- name: Wait for SSH to come up
|
- name: Wait for SSH to come up
|
||||||
wait_for: host={{item.droplet.ip_address}} port=22 delay=10 timeout=180 state=started
|
wait_for: host={{item.droplet.ip_address}} port=22 delay=10 timeout=180 state=started
|
||||||
with_items: "{{droplets.results}}"
|
with_items: "{{droplets.results}}"
|
||||||
when: "{{ state == 'present' }}"
|
when: state == 'present'
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
tasks:
|
tasks:
|
||||||
- name: Test tunl0 routes
|
- name: Test tunl0 routes
|
||||||
shell: "! /sbin/ip ro | grep '/26 via' | grep -v tunl0"
|
shell: "! /sbin/ip ro | grep '/26 via' | grep -v tunl0"
|
||||||
when: (ipip|default(false) or cloud_provider is defined) and (kube_network_plugin == 'calico')
|
when:
|
||||||
|
- (ipip|default(false) or cloud_provider is defined)
|
||||||
|
- kube_network_plugin == 'calico'
|
||||||
|
|
||||||
- hosts: k8s-cluster
|
- hosts: k8s-cluster
|
||||||
vars:
|
vars:
|
||||||
|
@ -35,7 +37,7 @@
|
||||||
run_once: true
|
run_once: true
|
||||||
delegate_to: "{{groups['kube-master'][0]}}"
|
delegate_to: "{{groups['kube-master'][0]}}"
|
||||||
register: nca_pod
|
register: nca_pod
|
||||||
until: "{{ nca_pod.stdout_lines|length }} >= {{ groups['kube-node']|intersect(play_hosts)|length * 2 }}"
|
until: nca_pod.stdout_lines|length >= groups['kube-node']|intersect(play_hosts)|length * 2
|
||||||
retries: 3
|
retries: 3
|
||||||
delay: 10
|
delay: 10
|
||||||
|
|
||||||
|
@ -46,9 +48,9 @@
|
||||||
register: agents
|
register: agents
|
||||||
retries: 18
|
retries: 18
|
||||||
delay: "{{ agent_report_interval }}"
|
delay: "{{ agent_report_interval }}"
|
||||||
until: "{{ agents.content|length > 0 and
|
until: agents.content|length > 0 and
|
||||||
agents.content[0] == '{' and
|
agents.content[0] == '{' and
|
||||||
agents.content|from_json|length >= groups['kube-node']|intersect(play_hosts)|length * 2 }}"
|
agents.content|from_json|length >= groups['kube-node']|intersect(play_hosts)|length * 2
|
||||||
failed_when: false
|
failed_when: false
|
||||||
no_log: true
|
no_log: true
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue