ensure manager is in /etc/hosts

This commit is contained in:
Josh Patterson
2025-04-09 11:19:18 -04:00
parent f6a0e62853
commit 0f120f7500
2 changed files with 4 additions and 0 deletions

View File

@@ -34,6 +34,8 @@ sool9-{{host}}:
grains: grains:
hypervisor_host: {{host ~ "_" ~ role}} hypervisor_host: {{host ~ "_" ~ role}}
preflight_cmds: preflight_cmds:
- |
tee -a /etc/hosts <<< "{{ MANAGERIP }} {{ MANAGERHOSTNAME }}"
- | - |
timeout 600 bash -c 'trap "echo \"Preflight Check: Failed to establish repo connectivity\"; exit 1" TERM; \ 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..."; \ while ! dnf makecache --repoid=securityonion >/dev/null 2>&1; do echo "Preflight Check: Waiting for repo connectivity..."; \

View File

@@ -40,6 +40,8 @@ cloud_profiles:
- source: salt://salt/cloud/cloud.profiles.d/socloud.conf.jinja - source: salt://salt/cloud/cloud.profiles.d/socloud.conf.jinja
- defaults: - defaults:
HYPERVISORS: {{HYPERVISORS}} HYPERVISORS: {{HYPERVISORS}}
MANAGERHOSTNAME: {{ grains.host }}
MANAGERIP: {{ pillar.host.mainip }}
- template: jinja - template: jinja
{% for role, hosts in HYPERVISORS.items() %} {% for role, hosts in HYPERVISORS.items() %}