diff --git a/playbook.yml b/playbook.yml index 31b44b4..05afbfb 100644 --- a/playbook.yml +++ b/playbook.yml @@ -104,7 +104,7 @@ - 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') }}" + cmd: "curl -sfL https://get.k3s.io | sh -s - server --cluster-init --disable local-storage --tls-san {{ cluster.virtualip | ansible.utils.ipaddr('address') }}" - name: Initial node -- Retrieve token ansible.builtin.slurp: @@ -150,17 +150,9 @@ - name: Additional nodes -- Install K3s binary ansible.builtin.shell: - cmd: "curl -sfL https://get.k3s.io | sh -s - server --disable local-storage,traefik" + cmd: "curl -sfL https://get.k3s.io | sh -s - server --disable local-storage" environment: - K3S_TOKEN: "{{ (hostvars[ansible_play_hosts[0]]).cluster.token }}" + K3S_TOKEN: "{{ cluster.token }}" # (hostvars[ansible_play_hosts[0]]).cluster.token K3S_URL: "{{ 'https://' + ( cluster.virtualip | ansible.utils.ipaddr('address') ) + ':6443' }}" when: inventory_hostname != ansible_play_hosts[0] - - - ansible.builtin.debug: - var: cluster - - ansible.builtin.set_fact: - cluster: "{{ cluster | combine( { 'token': ( k3s_token.content | b64decode | trim ) } ) }}" - delegate_to: "{{ ansible_play_hosts[0] }}" - - ansible.builtin.debug: - var: cluster