mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-15 10:10:03 -03:30
Move to Ansible 3.4.0 (#7672)
* Ansible: move to Ansible 3.4.0 which uses ansible-base 2.10.10 * Docs: add a note about ansible upgrade post 2.9.x * CI: ensure ansible is removed before ansible 3.x is installed to avoid pip failures * Ansible: use newer ansible-lint * Fix ansible-lint 5.0.11 found issues * syntax issues * risky-file-permissions * var-naming * role-name * molecule tests * Mitogen: use 0.3.0rc1 which adds support for ansible 2.10+ * Pin ansible-base to 2.10.11 to get package fix on RHEL8
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
status_code: 200
|
||||
register: apiserver_response
|
||||
|
||||
- debug:
|
||||
- debug: # noqa unnamed-task
|
||||
msg: "{{ apiserver_response.json }}"
|
||||
|
||||
- name: Check API servers version
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
bin_dir: "/usr/local/bin"
|
||||
when: not ansible_os_family in ["Flatcar Container Linux by Kinvolk"]
|
||||
|
||||
- import_role:
|
||||
- import_role: # noqa unnamed-task
|
||||
name: cluster-dump
|
||||
|
||||
- name: Check kubectl output
|
||||
@@ -21,7 +21,7 @@
|
||||
register: get_nodes
|
||||
no_log: true
|
||||
|
||||
- debug:
|
||||
- debug: # noqa unnamed-task
|
||||
msg: "{{ get_nodes.stdout.split('\n') }}"
|
||||
|
||||
- name: Check that all nodes are running and ready
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
bin_dir: "/usr/local/bin"
|
||||
when: not ansible_os_family in ["Flatcar Container Linux by Kinvolk"]
|
||||
|
||||
- import_role:
|
||||
- import_role: # noqa unnamed-task
|
||||
name: cluster-dump
|
||||
|
||||
- name: Check kubectl output
|
||||
@@ -21,7 +21,7 @@
|
||||
register: get_pods
|
||||
no_log: true
|
||||
|
||||
- debug:
|
||||
- debug: # noqa unnamed-task
|
||||
msg: "{{ get_pods.stdout.split('\n') }}"
|
||||
|
||||
- name: Check that all pods are running and ready
|
||||
@@ -44,6 +44,6 @@
|
||||
register: get_pods
|
||||
no_log: true
|
||||
|
||||
- debug:
|
||||
- debug: # noqa unnamed-task
|
||||
msg: "{{ get_pods.stdout.split('\n') }}"
|
||||
failed_when: not run_pods_log is success
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
when: get_csr.stdout_lines | length > 0
|
||||
changed_when: certificate_approve.stdout
|
||||
|
||||
- debug:
|
||||
- debug: # noqa unnamed-task
|
||||
msg: "{{ certificate_approve.stdout.split('\n') }}"
|
||||
|
||||
when: kubelet_rotate_server_certificates | default(false)
|
||||
@@ -60,7 +60,7 @@
|
||||
- busybox1
|
||||
- busybox2
|
||||
|
||||
- import_role:
|
||||
- import_role: # noqa unnamed-task
|
||||
name: cluster-dump
|
||||
|
||||
- name: Check that all pods are running and ready
|
||||
@@ -83,7 +83,7 @@
|
||||
register: pods
|
||||
no_log: true
|
||||
|
||||
- debug:
|
||||
- debug: # noqa unnamed-task
|
||||
msg: "{{ pods.stdout.split('\n') }}"
|
||||
failed_when: not run_pods_log is success
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
jsonpath='{range .items[?(.spec.hostNetwork)]}{.metadata.name} {.status.podIP} {.status.containerStatuses} {end}'"
|
||||
changed_when: false
|
||||
register: hostnet_pods
|
||||
ignore_errors: true
|
||||
ignore_errors: true # noqa ignore-errors
|
||||
no_log: true
|
||||
|
||||
- name: Get running pods
|
||||
@@ -108,7 +108,7 @@
|
||||
register: get_pods
|
||||
no_log: true
|
||||
|
||||
- debug:
|
||||
- debug: # noqa unnamed-task
|
||||
msg: "{{ get_pods.stdout.split('\n') }}"
|
||||
|
||||
- name: Set networking facts
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
bin_dir: "/usr/local/bin"
|
||||
when: not ansible_os_family in ["Flatcar Container Linux by Kinvolk"]
|
||||
|
||||
- import_role:
|
||||
- import_role: # noqa unnamed-task
|
||||
name: cluster-dump
|
||||
|
||||
- name: Wait for netchecker server
|
||||
@@ -60,7 +60,7 @@
|
||||
- netchecker-agent-hostnet
|
||||
when: not nca_pod is success
|
||||
|
||||
- debug:
|
||||
- debug: # noqa unnamed-task
|
||||
var: nca_pod.stdout_lines
|
||||
failed_when: not nca_pod is success
|
||||
when: inventory_hostname == groups['kube_control_plane'][0]
|
||||
@@ -80,7 +80,7 @@
|
||||
failed_when: false
|
||||
no_log: true
|
||||
|
||||
- debug:
|
||||
- debug: # noqa unnamed-task
|
||||
var: agents.content | from_json
|
||||
failed_when: not agents is success and not agents.content=='{}'
|
||||
run_once: true
|
||||
@@ -106,7 +106,7 @@
|
||||
when:
|
||||
- agents.content != '{}'
|
||||
|
||||
- debug:
|
||||
- debug: # noqa unnamed-task
|
||||
var: ncs_pod
|
||||
run_once: true
|
||||
when: not result is success
|
||||
@@ -131,7 +131,7 @@
|
||||
- calico-node
|
||||
- cilium
|
||||
|
||||
- debug:
|
||||
- debug: # noqa unnamed-task
|
||||
var: result.content | from_json
|
||||
failed_when: not result is success
|
||||
run_once: true
|
||||
@@ -140,14 +140,14 @@
|
||||
- result.content
|
||||
- result.content[0] == '{'
|
||||
|
||||
- debug:
|
||||
- debug: # noqa unnamed-task
|
||||
var: result
|
||||
failed_when: not result is success
|
||||
run_once: true
|
||||
when:
|
||||
- not agents.content == '{}'
|
||||
|
||||
- debug:
|
||||
- debug: # noqa unnamed-task
|
||||
msg: "Cannot get reports from agents, consider as PASSING"
|
||||
run_once: true
|
||||
when:
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
archive:
|
||||
path: /tmp/cluster-dump
|
||||
dest: /tmp/cluster-dump.tgz
|
||||
mode: 0644
|
||||
when: inventory_hostname in groups['kube_control_plane']
|
||||
|
||||
- name: Fetch dump file
|
||||
|
||||
Reference in New Issue
Block a user