Avoid casting to string
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
aef012b4dc
commit
ab0c96c5e1
11
playbook.yml
11
playbook.yml
@ -101,6 +101,9 @@
|
|||||||
serial: 1
|
serial: 1
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
|
- ansible.builtin.debug:
|
||||||
|
var: cluster
|
||||||
|
|
||||||
- name: Install K3s binary
|
- name: Install K3s binary
|
||||||
ansible.builtin.shell:
|
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,traefik --tls-san {{ cluster.virtualip | ansible.utils.ipaddr('address') }}"
|
||||||
@ -116,13 +119,13 @@
|
|||||||
src: /var/lib/rancher/k3s/server/token
|
src: /var/lib/rancher/k3s/server/token
|
||||||
register: k3s_token
|
register: k3s_token
|
||||||
|
|
||||||
- name: Add to dictionary
|
- name: Update dictionary
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
cluster: >-
|
cluster: >-
|
||||||
"{{ cluster | combine(
|
cluster | combine(
|
||||||
{ 'mastertoken': ( k3s_token.content | b64decode ) },
|
{ 'mastertoken': ( k3s_token.content | b64decode | trim ) },
|
||||||
{ 'apiurl': 'https://' + ( cluster.virtualip | ansible.utils.ipaddr('address') ) + ':6443' }
|
{ 'apiurl': 'https://' + ( cluster.virtualip | ansible.utils.ipaddr('address') ) + ':6443' }
|
||||||
) }}"
|
)
|
||||||
|
|
||||||
when: cluster.mastertoken is not defined
|
when: cluster.mastertoken is not defined
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user