From 913c1a89bfa85d5cd8d4054283a0c1982ef81369 Mon Sep 17 00:00:00 2001 From: Josh Brower Date: Mon, 8 Jun 2020 13:28:27 -0400 Subject: [PATCH] Fleet setup fixes --- salt/fleet/event_gen-packages.sls | 2 +- salt/reactor/fleet.sls | 8 ++++---- setup/so-setup | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/salt/fleet/event_gen-packages.sls b/salt/fleet/event_gen-packages.sls index 1bdccea48..e353eaf92 100644 --- a/salt/fleet/event_gen-packages.sls +++ b/salt/fleet/event_gen-packages.sls @@ -4,7 +4,7 @@ {% set VERSION = salt['pillar.get']('static:soversion') %} {% set CUSTOM_FLEET_HOSTNAME = salt['pillar.get']('static:fleet_custom_hostname', None) %} -{% if CUSTOM_FLEET_HOSTNAME != None && CUSTOM_FLEET_HOSTNAME != '' %} +{% if CUSTOM_FLEET_HOSTNAME != None and CUSTOM_FLEET_HOSTNAME != '' %} {% set HOSTNAME = CUSTOM_FLEET_HOSTNAME %} {% else %} {% set HOSTNAME = grains.host %} diff --git a/salt/reactor/fleet.sls b/salt/reactor/fleet.sls index 9c8023a71..609806de8 100644 --- a/salt/reactor/fleet.sls +++ b/salt/reactor/fleet.sls @@ -9,9 +9,9 @@ import subprocess def run(): MINIONID = data['id'] ACTION = data['data']['action'] - local_salt_dir = /opt/so/saltstack/local - STATICFILE = local_salt_dir + '/pillar/static.sls' - SECRETSFILE = local_salt_dir + '/pillar/secrets.sls' + LOCAL_SALT_DIR = "/opt/so/saltstack/local" + STATICFILE = f"{LOCAL_SALT_DIR}/pillar/static.sls" + SECRETSFILE = f"{LOCAL_SALT_DIR}/pillar/secrets.sls" if MINIONID.split('_')[-1] in ['master','eval','fleet','mastersearch','standalone']: if ACTION == 'enablefleet': @@ -58,7 +58,7 @@ def run(): PACKAGEVERSION += 1 # Run Docker container that will build the packages - gen_packages = subprocess.run(["docker", "run","--rm", "--mount", "type=bind,ssource=" + local_salt_dir + "/salt/fleet/packages,target=/output", \ + gen_packages = subprocess.run(["docker", "run","--rm", "--mount", f"type=bind,source={LOCAL_SALT_DIR}/salt/fleet/packages,target=/output", \ "--mount", "type=bind,source=/etc/ssl/certs/intca.crt,target=/var/launcher/launcher.crt", f"{ MASTER }:5000/soshybridhunter/so-fleet-launcher:{ VERSION }", \ f"{ESECRET}", f"{PACKAGEHOSTNAME}:8090", f"{PACKAGEVERSION}.1.1"], stdout=subprocess.PIPE, encoding='ascii') diff --git a/setup/so-setup b/setup/so-setup index 05aa0de27..c09b5ae7d 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -352,7 +352,7 @@ if [[ $is_minion ]]; then copy_ssh_key >> $setup_log 2>&1 fi -if [[ $is_fleet_standalone ]]; then +if [[ "$OSQUERY" = 1 ]]; then host_pillar >> $setup_log 2>&1 fi