mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-06-22 10:18:09 +02:00
enable fleet in global pillars before running fleet state during setup https://github.com/Security-Onion-Solutions/securityonion/issues/1857
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{% set ENROLLSECRET = salt['cmd.run']('docker exec so-fleet fleetctl get enroll-secret default') %}
|
||||
{% set ENROLLSECRET = salt['cmd.run']('docker exec so-fleet fleetctl get enroll-secret default', '') %}
|
||||
{% set MAININT = salt['pillar.get']('host:mainint') %}
|
||||
{% set MAINIP = salt['grains.get']('ip_interfaces').get(MAININT)[0] %}
|
||||
|
||||
|
||||
@@ -31,16 +31,17 @@ def run():
|
||||
print(line)
|
||||
|
||||
# Update the enroll secret in the secrets pillar
|
||||
for line in fileinput.input(SECRETSFILE, inplace=True):
|
||||
line = re.sub(r'fleet_enroll-secret: \S*', f"fleet_enroll-secret: {ESECRET}", line.rstrip())
|
||||
print(line)
|
||||
if ESECRET != "":
|
||||
for line in fileinput.input(SECRETSFILE, inplace=True):
|
||||
line = re.sub(r'fleet_enroll-secret: \S*', f"fleet_enroll-secret: {ESECRET}", line.rstrip())
|
||||
print(line)
|
||||
|
||||
# Update the Fleet host in the static pillar
|
||||
# Update the Fleet host in the static pillar
|
||||
for line in fileinput.input(STATICFILE, inplace=True):
|
||||
line = re.sub(r'fleet_hostname: \S*', f"fleet_hostname: '{HOSTNAME}'", line.rstrip())
|
||||
print(line)
|
||||
|
||||
# Update the Fleet IP in the static pillar
|
||||
# Update the Fleet IP in the static pillar
|
||||
for line in fileinput.input(STATICFILE, inplace=True):
|
||||
line = re.sub(r'fleet_ip: \S*', f"fleet_ip: '{MAINIP}'", line.rstrip())
|
||||
print(line)
|
||||
|
||||
Reference in New Issue
Block a user