From 8feca429e43400425ec8e464b9016a1709b5863a Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Thu, 25 Apr 2024 14:01:03 +0200 Subject: [PATCH] Fix nomad join --- artifacts/lrms/nomad_ai4eosc_fe_install.yml | 6 ++++-- artifacts/lrms/nomad_ai4eosc_wn_install.yml | 14 ++++++++++++-- templates/nomad_join_ai4eosc.yaml | 6 ++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/artifacts/lrms/nomad_ai4eosc_fe_install.yml b/artifacts/lrms/nomad_ai4eosc_fe_install.yml index ed55e30..604d2f0 100644 --- a/artifacts/lrms/nomad_ai4eosc_fe_install.yml +++ b/artifacts/lrms/nomad_ai4eosc_fe_install.yml @@ -9,14 +9,16 @@ pre_tasks: - name: Convert server_list to list set_fact: - server_list: [server_list] + server_list: + - "{{ server_list }}" when: - consul_server_join is not defined or consul_server_join == '' - server_list is string - name: Use consul_server_join to join the consul cluster set_fact: - server_list: [consul_server_join] + server_list: + - "{{ consul_server_join }}" when: consul_server_join is defined and consul_server_join != '' roles: - role: 'grycap.consul' diff --git a/artifacts/lrms/nomad_ai4eosc_wn_install.yml b/artifacts/lrms/nomad_ai4eosc_wn_install.yml index 52b45c9..b206df7 100644 --- a/artifacts/lrms/nomad_ai4eosc_wn_install.yml +++ b/artifacts/lrms/nomad_ai4eosc_wn_install.yml @@ -8,8 +8,18 @@ pre_tasks: - name: Convert server_list to list set_fact: - server_list: [server_list] - when: server_list is string + server_list: + - "{{ server_list }}" + when: + - consul_server_join is not defined or consul_server_join == '' + - server_list is string + + - name: Use consul_server_join to join the consul cluster + set_fact: + server_list: + - "{{ consul_server_join }}" + when: consul_server_join is defined and consul_server_join != '' + - name: Set nomad plugins var set_fact: nomad_plugins_var: diff --git a/templates/nomad_join_ai4eosc.yaml b/templates/nomad_join_ai4eosc.yaml index 9948843..05567d6 100644 --- a/templates/nomad_join_ai4eosc.yaml +++ b/templates/nomad_join_ai4eosc.yaml @@ -282,6 +282,9 @@ topology_template: nomad_server_list: { get_attribute: [ front, private_address ] } nomad_version: { get_input: nomad_version } consul_version: { get_input: consul_version } + consul_certs_url: { get_input: consul_cert_url } + nomad_certs_url: { get_input: nomad_cert_url } + consul_server_join: { get_input: consul_server_join } wn_pub: type: tosca.nodes.indigo.Compute @@ -332,6 +335,9 @@ topology_template: nomad_version: { get_input: nomad_version } consul_version: { get_input: consul_version } nomad_nvidia_support: true + consul_certs_url: { get_input: consul_cert_url } + nomad_certs_url: { get_input: nomad_cert_url } + consul_server_join: { get_input: consul_server_join } wn_gpu: type: tosca.nodes.indigo.Compute