From 7eea163f817f354f2e451d30029f156c4246553e Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 19 Apr 2019 16:09:09 -0500 Subject: [PATCH] Use same options for all tests and default to Ansible IP correctly. --- molecule/default/playbook.yml | 7 +------ tasks/master-setup.yml | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/molecule/default/playbook.yml b/molecule/default/playbook.yml index 19ae391..f93c7d7 100644 --- a/molecule/default/playbook.yml +++ b/molecule/default/playbook.yml @@ -5,7 +5,7 @@ vars: # Allow swap in test environments (hard to control in some Docker envs). - kubernetes_kubelet_extra_args: "--fail-swap-on=false" + kubernetes_kubelet_extra_args: "--fail-swap-on=false --cgroup-driver=cgroupfs" docker_install_compose: false pre_tasks: @@ -24,11 +24,6 @@ - name: Gather facts. action: setup - - name: Use cgroupfs cgroup driver instead of systemd (RedHat). - set_fact: - kubernetes_kubelet_extra_args: '"--fail-swap-on=false --cgroup-driver=cgroupfs"' - when: ansible_os_family == 'RedHat' - roles: - role: geerlingguy.docker - role: geerlingguy.kubernetes diff --git a/tasks/master-setup.yml b/tasks/master-setup.yml index 7db6767..c6631c7 100644 --- a/tasks/master-setup.yml +++ b/tasks/master-setup.yml @@ -3,7 +3,7 @@ command: > kubeadm init --pod-network-cidr={{ kubernetes_pod_network_cidr }} - --apiserver-advertise-address={{ kubernetes_apiserver_advertise_address | default(ansible_default_ipv4.address) }} + --apiserver-advertise-address={{ kubernetes_apiserver_advertise_address | default(ansible_default_ipv4.address, true) }} --kubernetes-version {{ kubernetes_version_kubeadm }} --ignore-preflight-errors={{ kubernetes_ignore_preflight_errors }} {{ kubernetes_kubeadm_init_extra_opts }}