Files
securityonion/salt/orch/deploy_newnode.sls
m0duspwnens 3d4fd59a15 orchit
2024-05-03 13:48:51 -04:00

48 lines
1.2 KiB
Plaintext

{% set MANAGER = salt['pillar.get']('setup:manager') %}
{% set NEWNODE = salt['pillar.get']('setup:newnode') %}
# tell the minion to populate the mine with data from mine_functions which is populated during setup
# this only needs to happen on non managers since they handle this during setup
# and they need to wait for ca creation to update the mine
{{NEWNODE}}_update_mine:
salt.function:
- name: mine.update
- tgt: {{ NEWNODE }}
- retry:
attempts: 36
interval: 5
# we need to prepare the manager for a new searchnode or heavynode
{% if NEWNODE.split('_')|last in ['searchnode', 'heavynode'] %}
manager_run_es_soc:
salt.state:
- tgt: {{ MANAGER }}
- sls:
- elasticsearch
- soc
- queue: True
- retry:
attempts: 3
interval: 60
- require:
- salt: {{NEWNODE}}_update_mine
{% endif %}
{{NEWNODE}}_run_highstate:
salt.state:
- tgt: {{ NEWNODE }}
- highstate: True
- queue: True
- retry:
attempts: 5
interval: 60
{{NEWNODE}}_set_highstate_cron:
salt.state:
- tgt: {{ NEWNODE }}
- sls:
- setup.highstate_cron
- queue: True
- onfail:
- salt: {{NEWNODE}}_run_highstate