2020-02-20 21:28:24 +01:00
|
|
|
---
|
|
|
|
- name: Converge
|
|
|
|
hosts: all
|
|
|
|
become: true
|
|
|
|
|
|
|
|
vars:
|
2022-09-14 21:42:00 +02:00
|
|
|
# Allow swap in test environments (hard to control in some envs).
|
2022-10-26 17:34:05 +02:00
|
|
|
kubernetes_config_kubelet_configuration:
|
|
|
|
cgroupDriver: "systemd"
|
|
|
|
failSwapOn: false
|
2022-10-26 19:38:20 +02:00
|
|
|
cgroupsPerQOS: true
|
|
|
|
enforceNodeAllocatable: ['pods']
|
2022-09-15 00:11:18 +02:00
|
|
|
containerd_config_cgroup_driver_systemd: true
|
2020-02-20 21:28:24 +01:00
|
|
|
|
|
|
|
pre_tasks:
|
|
|
|
- name: Update apt cache.
|
|
|
|
apt: update_cache=true cache_valid_time=600
|
|
|
|
when: ansible_os_family == 'Debian'
|
|
|
|
|
|
|
|
- name: Ensure test dependencies are installed (RedHat).
|
|
|
|
package: name=iproute state=present
|
|
|
|
when: ansible_os_family == 'RedHat'
|
|
|
|
|
|
|
|
- name: Ensure test dependencies are installed (Debian).
|
|
|
|
package: name=iproute2 state=present
|
|
|
|
when: ansible_os_family == 'Debian'
|
|
|
|
|
|
|
|
- name: Gather facts.
|
|
|
|
action: setup
|
|
|
|
|
|
|
|
roles:
|
2022-09-14 21:42:00 +02:00
|
|
|
- role: geerlingguy.containerd
|
2020-02-20 21:28:24 +01:00
|
|
|
- role: geerlingguy.kubernetes
|
|
|
|
|
|
|
|
post_tasks:
|
|
|
|
- name: Get cluster info.
|
|
|
|
command: kubectl cluster-info
|
|
|
|
changed_when: false
|
|
|
|
register: kubernetes_info
|
|
|
|
|
|
|
|
- name: Print cluster info.
|
|
|
|
debug: var=kubernetes_info.stdout
|
|
|
|
|
|
|
|
- name: Get all running pods.
|
|
|
|
command: kubectl get pods --all-namespaces
|
|
|
|
changed_when: false
|
|
|
|
register: kubernetes_pods
|
|
|
|
|
|
|
|
- name: Print list of running pods.
|
|
|
|
debug: var=kubernetes_pods.stdout
|