From c4f7e35ce389f2a3696fbbca389335c4da4c3124 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 20 Feb 2020 14:28:24 -0600 Subject: [PATCH] Update molecule configuration to work with 3.0. --- .yamllint | 6 +++++ molecule/default/converge.yml | 46 +++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .yamllint create mode 100644 molecule/default/converge.yml diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..c9aab08 --- /dev/null +++ b/.yamllint @@ -0,0 +1,6 @@ +--- +extends: default +rules: + line-length: + max: 150 + level: warning diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml new file mode 100644 index 0000000..f93c7d7 --- /dev/null +++ b/molecule/default/converge.yml @@ -0,0 +1,46 @@ +--- +- name: Converge + hosts: all + become: true + + vars: + # Allow swap in test environments (hard to control in some Docker envs). + kubernetes_kubelet_extra_args: "--fail-swap-on=false --cgroup-driver=cgroupfs" + docker_install_compose: false + + 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: + - role: geerlingguy.docker + - 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