diff --git a/playbook.yml b/playbook.yml index 36b0595..8ac6a46 100644 --- a/playbook.yml +++ b/playbook.yml @@ -101,6 +101,9 @@ serial: 1 tasks: + - ansible.builtin.debug: + var: cluster + - name: 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') }}" @@ -116,13 +119,13 @@ src: /var/lib/rancher/k3s/server/token register: k3s_token - - name: Add to dictionary + - name: Update dictionary ansible.builtin.set_fact: cluster: >- - "{{ cluster | combine( - { 'mastertoken': ( k3s_token.content | b64decode ) }, + cluster | combine( + { 'mastertoken': ( k3s_token.content | b64decode | trim ) }, { 'apiurl': 'https://' + ( cluster.virtualip | ansible.utils.ipaddr('address') ) + ':6443' } - ) }}" + ) when: cluster.mastertoken is not defined