From 5b5a137a56e2d6197181a4f8bd78aec153d97189 Mon Sep 17 00:00:00 2001 From: djpbessems Date: Wed, 20 Apr 2022 17:10:45 +0200 Subject: [PATCH] Housekeeping; Add pause --- playbook.yml | 22 ++++++++++++++-------- vars/hypervisor.vcenter.yml | 1 - 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/playbook.yml b/playbook.yml index 5cc8014..d61b9a6 100644 --- a/playbook.yml +++ b/playbook.yml @@ -102,37 +102,37 @@ - block: - - name: \[Initial node\] Install K3s binary + - name: Initial node -- Install K3s binary ansible.builtin.shell: cmd: "curl -sfL https://get.k3s.io | sh -s - server --cluster-init --disable local-storage,traefik --tls-san {{ cluster.virtualip | ansible.utils.ipaddr('address') }}" - - name: \[Initial node\] Retrieve token + - name: Initial node -- Retrieve token ansible.builtin.slurp: src: /var/lib/rancher/k3s/server/token register: k3s_token - - name: \[Initial node\] Store token + - name: Initial node -- Store token ansible.builtin.set_fact: clustertoken: "{{ k3s_token.content | b64decode | trim }}" - block: - - name: \[Install 'kube-vip'\] Retrieve manifest for RBAC + - name: Install 'kube-vip' -- Retrieve manifest for RBAC ansible.builtin.uri: url: https://kube-vip.io/manifests/rbac.yaml return_content: yes register: manifest_rbac - - name: \[Install 'kube-vip'\] Pull image + - name: Install 'kube-vip' -- Pull image ansible.builtin.shell: cmd: ctr image pull ghcr.io/kube-vip/kube-vip:latest - - name: \[Install 'kube-vip'\] Generate manifest for daemonSet + - name: Install 'kube-vip' -- Generate manifest for daemonSet ansible.builtin.shell: cmd: "ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:latest vip /kube-vip manifest daemonset --interface {{ ansible_default_ipv4.interface }} --address {{ cluster.virtualip | ansible.utils.ipaddr('address') }} --inCluster --taint --controlplane --services --arp --leaderElection" register: manifest_daemonset - - name: \[Install 'kube-vip'\] Inject manifest for installation + - name: Install 'kube-vip' -- Inject manifest for installation ansible.builtin.template: src: kube-vip.j2 dest: /var/lib/rancher/k3s/server/manifests/kube-vip.yml @@ -141,7 +141,13 @@ - block: - - name: \[Additional nodes\] Install K3s binary + - name: Wait for API to become available on virtual IP + ansible.builtin.wait_for: + host: "{{ cluster.virtualip | ansible.utils.ipaddr('address') }}" + port: 6443 + timeout: 300 + + - name: Additional nodes -- Install K3s binary ansible.builtin.shell: cmd: "curl -sfL https://get.k3s.io | sh -s - server --disable local-storage,traefik" environment: diff --git a/vars/hypervisor.vcenter.yml b/vars/hypervisor.vcenter.yml index e4bcd62..6d12865 100644 --- a/vars/hypervisor.vcenter.yml +++ b/vars/hypervisor.vcenter.yml @@ -6,5 +6,4 @@ hv: folder: /DeSchakel/vm/Development cluster: Cluster.Legacy datastore: NAS01.RAID5 - isodatastore: ESX00.SSD03 network: LAN