From 7fbb181f2b64ba0b2223b8490725a2ec3151a6e7 Mon Sep 17 00:00:00 2001 From: alecsandru Date: Sat, 4 May 2024 14:16:02 +0000 Subject: [PATCH] Update 'k8s/initialize.yml' --- k8s/initialize.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/k8s/initialize.yml b/k8s/initialize.yml index 7d9f136..79ef803 100644 --- a/k8s/initialize.yml +++ b/k8s/initialize.yml @@ -28,7 +28,13 @@ - 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: Create dummy host to hold the token + add_host: + name: "K8S_CP_JOIN_DH" + token: "K8S_CP_JOIN_COMMAND.stdout" + - name: Show command + debug: + msg: "{{ hostvars['K8S_CP_JOIN_DH']['token'] }}" # - name: Reboot machine to finaliza presetup # reboot: