From 21bcb354143b4d5dcfb7134da727357018582d0d Mon Sep 17 00:00:00 2001 From: teq0 Date: Mon, 11 Jun 2018 17:20:19 +1000 Subject: [PATCH] fix inconsistent selection of master --- inventory/group_vars/all/k8s.yml | 2 ++ playbooks/deployments.yml | 2 +- roles/ansible-k8s/defaults/main.yml | 4 +++- roles/ansible-k8s/tasks/set_facts.yml | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/inventory/group_vars/all/k8s.yml b/inventory/group_vars/all/k8s.yml index a721f64..a50268c 100644 --- a/inventory/group_vars/all/k8s.yml +++ b/inventory/group_vars/all/k8s.yml @@ -1,6 +1,8 @@ --- k8s_advertise_address_int: "{{ rpi_wired_int }}" +k8s_master_group: rpi_k8s_master + k8s_cluster_group: rpi_k8s k8s_cluster_init_skip_ca_verification: true diff --git a/playbooks/deployments.yml b/playbooks/deployments.yml index 0fa34ba..5237ef5 100644 --- a/playbooks/deployments.yml +++ b/playbooks/deployments.yml @@ -2,7 +2,7 @@ - hosts: rpi_k8s vars: k8s_admin_config: /etc/kubernetes/admin.conf - k8s_master: "{{ groups[k8s_cluster_group][0] }}" + k8s_master: "{{ groups[k8s_master_group][0] }}" tasks: - name: Ensuring {{ lookup('env','HOME') }}/.kube Exists file: diff --git a/roles/ansible-k8s/defaults/main.yml b/roles/ansible-k8s/defaults/main.yml index 19b0ae3..f19b6ae 100644 --- a/roles/ansible-k8s/defaults/main.yml +++ b/roles/ansible-k8s/defaults/main.yml @@ -8,7 +8,9 @@ k8s_advertise_address_int: enp0s8 k8s_advertise_bind_port: 6443 -k8s_cluster_group: k8s +k8s_master_group: rpi_k8s_master + +k8s_cluster_group: rpi_k8s k8s_cluster_init_skip_ca_verification: false diff --git a/roles/ansible-k8s/tasks/set_facts.yml b/roles/ansible-k8s/tasks/set_facts.yml index 2404153..3e9c3ef 100644 --- a/roles/ansible-k8s/tasks/set_facts.yml +++ b/roles/ansible-k8s/tasks/set_facts.yml @@ -1,7 +1,7 @@ --- - name: set_facts | Setting K8s Master set_fact: - k8s_master: "{{ groups[k8s_cluster_group][0] }}" + k8s_master: "{{ groups[k8s_master_group][0] }}" tags: - k8s_get_dashboard