From 7b5e8683259f789f0fd43cf9f772bb295c5d222a Mon Sep 17 00:00:00 2001 From: alecsandru Date: Sat, 4 May 2024 14:10:46 +0000 Subject: [PATCH] Update 'k8s/initialize.yml' --- k8s/initialize.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/k8s/initialize.yml b/k8s/initialize.yml index 24cb1c6..2beda75 100644 --- a/k8s/initialize.yml +++ b/k8s/initialize.yml @@ -1,4 +1,17 @@ --- +- name: Stop loadbalancers on other masters + hosts: masters + become: yes + become_method: sudo + become_user: root + tasks: + - name: Stopping services + service: + name: "{{ item }}" + state: stopped + with_items: + - "haproxy" + - "keepalived" - name: Initialize the controlplane hosts: root_master become: yes @@ -12,6 +25,11 @@ args: chdir: $HOME creates: /etc/kubernetes/setup.out + - name: Extract Control Plane token + shell: cat /etc/kubernetes/setup.out | grep -e " kubeadm join" -e "--discovery-token" -e "--control-plane" + register: K8S_CP_JOIN_COMMAND + msg: {{ K8S_CP_JOIN_COMMAND }} + # - name: Reboot machine to finaliza presetup # reboot: # reboot_timeout: 3600 \ No newline at end of file