2018-05-09 16:19:11 +02:00
|
|
|
---
|
2018-09-28 05:17:50 +02:00
|
|
|
- name: Converge
|
|
|
|
hosts: all
|
|
|
|
become: true
|
2018-05-09 16:19:11 +02:00
|
|
|
|
2018-05-09 18:15:30 +02:00
|
|
|
vars:
|
2018-05-10 00:04:46 +02:00
|
|
|
# Allow swap in test environments (hard to control in some Docker envs).
|
|
|
|
kubernetes_kubelet_extra_args: "--fail-swap-on=false"
|
2018-09-28 05:17:50 +02:00
|
|
|
docker_install_compose: false
|
2018-05-09 18:15:30 +02:00
|
|
|
|
2018-05-09 16:19:11 +02:00
|
|
|
pre_tasks:
|
|
|
|
- name: Update apt cache.
|
2018-09-28 05:17:50 +02:00
|
|
|
apt: update_cache=true cache_valid_time=600
|
2018-05-09 16:19:11 +02:00
|
|
|
when: ansible_os_family == 'Debian'
|
|
|
|
|
|
|
|
- name: Ensure test dependencies are installed.
|
|
|
|
package: name=iproute state=present
|
|
|
|
|
2018-09-28 05:17:50 +02:00
|
|
|
- name: Gather facts.
|
|
|
|
action: setup
|
2018-05-09 16:19:11 +02:00
|
|
|
|
2018-05-10 00:04:46 +02:00
|
|
|
- name: Use cgroupfs cgroup driver instead of systemd (Red Hat).
|
|
|
|
set_fact:
|
2018-09-08 05:46:11 +02:00
|
|
|
kubernetes_kubelet_extra_args: '"--fail-swap-on=false --cgroup-driver=cgroupfs"'
|
2018-05-10 00:04:46 +02:00
|
|
|
when: ansible_os_family == 'RedHat'
|
|
|
|
|
2018-05-09 16:19:11 +02:00
|
|
|
roles:
|
2018-09-28 05:17:50 +02:00
|
|
|
- role: geerlingguy.docker
|
|
|
|
- role: geerlingguy.kubernetes
|
2018-09-28 06:30:25 +02:00
|
|
|
|
|
|
|
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
|