admin管理员组文章数量:1296907
I'm new to SaltStack and would like to know if there's a solution to a problem I have that follows "best practices."
I have something like this snippet in an orchestrator, waiting for a specific event to be available on the event bus.
trigger_some_slow_process:
salt.state:
- sls: start_slow_process
#Wait for expected event when target state is reached.
wait_for_some_event:
salt.wait_for_event:
- name: some/status/crashed/{{important_value}}/final
- timeout: 300 # Maximum time (in seconds) to wait for the event
- require:
- salt: trigger_some_slow_process
I'd like to include some extra information in the event and access the attributes. I would think this is possible since it's not unusual for an event to have several attributes. The event is dispatched from a beacon. I think it'll be more anized if I could access the attributes and have it all in the orchestrator instead of jam-packing all of the attributes and parsing the event tag.
The problem is that if I don't match against that particular information, the event will not be unique.
Essentially I want to trigger some process, and a beacon is monitoring the process until a state is reached, so I can be alerted asynchronously. Once it completes, the beacon dispatches an event detecting the condition, and I want to receive the beacon event, and (on the orchestrator/ salt master) wait until the expected event is present.
In this particular case, I'd like to have the important_value
in the event data, instead of stuffing it in the event tag.
Is it possible to use a reactor to put the values in a pillar? I'd like the wait to be inside the orchestrator, since otherwise I'm going to have a lot of short files, making maintaining and understanding the flow of tasks more difficult.
Is there a way to handle this elegantly in SaltStack?
I'm new to SaltStack and would like to know if there's a solution to a problem I have that follows "best practices."
I have something like this snippet in an orchestrator, waiting for a specific event to be available on the event bus.
trigger_some_slow_process:
salt.state:
- sls: start_slow_process
#Wait for expected event when target state is reached.
wait_for_some_event:
salt.wait_for_event:
- name: some/status/crashed/{{important_value}}/final
- timeout: 300 # Maximum time (in seconds) to wait for the event
- require:
- salt: trigger_some_slow_process
I'd like to include some extra information in the event and access the attributes. I would think this is possible since it's not unusual for an event to have several attributes. The event is dispatched from a beacon. I think it'll be more anized if I could access the attributes and have it all in the orchestrator instead of jam-packing all of the attributes and parsing the event tag.
The problem is that if I don't match against that particular information, the event will not be unique.
Essentially I want to trigger some process, and a beacon is monitoring the process until a state is reached, so I can be alerted asynchronously. Once it completes, the beacon dispatches an event detecting the condition, and I want to receive the beacon event, and (on the orchestrator/ salt master) wait until the expected event is present.
In this particular case, I'd like to have the important_value
in the event data, instead of stuffing it in the event tag.
Is it possible to use a reactor to put the values in a pillar? I'd like the wait to be inside the orchestrator, since otherwise I'm going to have a lot of short files, making maintaining and understanding the flow of tasks more difficult.
Is there a way to handle this elegantly in SaltStack?
Share Improve this question asked Feb 11 at 22:27 joshuarjoshuar 1872 silver badges10 bronze badges1 Answer
Reset to default 1orchestration knows nothing about events. salt.wait_for_events is a module and only tracks the tags and the id information.
as for what the reactor can do. the reactor can put the info in an inline pillar.
like
the reactor example:
runner.state.orch:
- mod: stage2
- pillar:
tag: {{tag}}
event: {{ data |json}}
that will at least make orchestration aware of the event information.
本文标签: salt projectSaltstack Waiting for event in orchestrator with specific attributesStack Overflow
版权声明:本文标题:salt project - Saltstack: Waiting for event in orchestrator with specific attributes - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741631140a2389373.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论