I'm using a reactor that's triggered whenever a minion is restarted. The reactor then completes 2 steps:
- run an orchestrator that executes a runner
- enforce minion configuration (checks if minion config has been changed, if there are changes the minion is restarted)
The issue I have is when enforcing the minion configuration if there are changes the minions are restarted causing the reactor to trigger for a second time. Is there a way to set the reactor to run only once while still enforcing the minion configuration?
This is my code:
reactor:
# call orchestrator & pass minion_id
call_orchestrator:
runner.state.orchestrate:
- args:
- mods: orch.salt_orchestrator
- pillar:
value: {{ data["id"] }}
# enforce config:
set_minion_conf:
local.state.apply:
- tgt: {{ data['id'] }}
- arg:
- salt_minion
orchestrator:
call_runner:
salt.runner:
- name: test_runner.up
- arg:
- grains: {{ minion_id }}
master:
reactor:
- 'salt/minion/*/start':
- /srv/salt/react/test.sls