diff --git a/salt/salt/cloud/cloud.profiles.d/socloud.conf.jinja b/salt/salt/cloud/cloud.profiles.d/socloud.conf.jinja index 23fd15983..f8e5d5555 100644 --- a/salt/salt/cloud/cloud.profiles.d/socloud.conf.jinja +++ b/salt/salt/cloud/cloud.profiles.d/socloud.conf.jinja @@ -29,7 +29,11 @@ sool9_{{host}}: hypervisor_host: {{host ~ "_" ~ role}} preflight_cmds: - | - tee -a /etc/hosts <<< "{{ MANAGERIP }} {{ MANAGERHOSTNAME }}" + {%- set hostnames = [MANAGERHOSTNAME] %} + {%- if not (URL_BASE | ipaddr) and URL_BASE != MANAGERHOSTNAME %} + {%- do hostnames.append(URL_BASE) %} + {%- endif %} + tee -a /etc/hosts <<< "{{ MANAGERIP }} {{ hostnames | join(' ') }}" - | timeout 600 bash -c 'trap "echo \"Preflight Check: Failed to establish repo connectivity\"; exit 1" TERM; \ while ! dnf makecache --repoid=securityonion >/dev/null 2>&1; do echo "Preflight Check: Waiting for repo connectivity..."; \ diff --git a/salt/salt/cloud/config.sls b/salt/salt/cloud/config.sls index dce0e873a..cefd6ec78 100644 --- a/salt/salt/cloud/config.sls +++ b/salt/salt/cloud/config.sls @@ -14,6 +14,7 @@ {% if 'vrt' in salt['pillar.get']('features', []) %} {% set HYPERVISORS = salt['pillar.get']('hypervisor:nodes', {} ) %} {% from 'salt/map.jinja' import SALTVERSION %} +{% from 'vars/globals.map.jinja' import GLOBALS %} {% if HYPERVISORS %} cloud_providers: @@ -34,6 +35,7 @@ cloud_profiles: MANAGERHOSTNAME: {{ grains.host }} MANAGERIP: {{ pillar.host.mainip }} SALTVERSION: {{ SALTVERSION }} + URL_BASE: {{ GLOBALS.url_base }} - template: jinja - makedirs: True {% else %}