I'm working on orchestration, and have run into a roadblock with the way that the orchestrate runner handles salt.wait_for_event:
I've got this beacon that looks for valid uuids in the apache2 log (I've edited the log settings so that if this entry appears, it will be the only thing present in the event data)
beacons:
log:
- file: /var/log/apache2/access.log
- tags:
bootstrap/request/event:
regex: .*[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}
When that event fires, it essentially means that a new minion will report to the master in a few minutes with an id of [role of host]-[some uuid] that's randomly chosen by a php script
That works as expected, and properly fires an event to the master.
What I wanted to do was something like this
## orch/master
...
wait_for_cache_provisioning:
salt.wait_for_event:
- name: salt/auth
- id_list:
- {{ data['raw'] }} ## <- this value would be a semi-randomized minion id in the format [type]-[uuid], e.g. cache-8342343f-4052-4b9a-b11c-144766741db8
- timeout: 600
validate_cache_key:
salt.wheel:
- name: key.accept
- match: {{ data['raw'] }}
- require:
- wait_for_cache_provisioning
cache_setup:
salt.state:
- tgt: {{ data['raw'] }}
- highstate: true
- require:
- validate_cache_key
...
I can't really find a way to access the beacon data without a reactor, but in that case the data wouldn't be available to state.orchestrate, it would just be available to the reactor state(s) that I specify.
My other thought was just to use globbing in salt.wait_for_event in the id_list, but that doesn't seem to be supported.
Can you use raw beacon data in state.orchestrate? Is there a better way to do this?
Thanks in advance!