From 690d66f275272ffd1a7c828fc854d8eae0b84d21 Mon Sep 17 00:00:00 2001 From: djpbessems Date: Wed, 20 Apr 2022 12:04:15 +0200 Subject: [PATCH] Simplify template --- playbook.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/playbook.yml b/playbook.yml index d7cf184..4fa07b0 100644 --- a/playbook.yml +++ b/playbook.yml @@ -118,7 +118,11 @@ - name: Add to dictionary ansible.builtin.set_fact: - cluster: "{{ cluster | combine( { 'mastertoken': {{ k3s_token.contents | b64decode }} }, { 'apiurl': {{ 'https://' + ( cluster.virtualip | ansible.utils.ipaddr('address') ) + ':6443' }} } ) }}" + cluster: >- + "{{ cluster | combine( + { 'mastertoken': ( k3s_token.contents | b64decode ) }, + { 'apiurl': 'https://' + ( cluster.virtualip | ansible.utils.ipaddr('address') ) + ':6443' } + ) }}" when: cluster.mastertoken is not defined