Avoid casting to string
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Danny Bessems 2022-04-20 12:15:04 +02:00
parent aef012b4dc
commit ab0c96c5e1
1 changed files with 7 additions and 4 deletions

View File

@ -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