-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Description
Description
The Salt documentation for beacons and reactors states:
An event initiated by a beacon, when it arrives at the master will be wrapped inside a second event, such that the data object containing the beacon information will be
data['data'], rather thandata.For example, to access the
idfield of the beacon event in a reactor file, you will need to reference{{ data['data']['id'] }}rather than{{ data['id'] }}as for events initiated directly on the event bus.
When I try to access {{ data['data']['id'] }} in a reactor state triggered by a beacon, my state fails to render with SaltRenderError: Jinja variable 'dict object' has no attribute 'data'. Once I switched to using {{ data['id'] }}, it started working.
Suggested Fix
It's possible my understanding of the documentation is incorrect, but the docs seem very explicit about the behavior, and that is not what I am seeing.
Type of documentation
Salt reactor system documentation
Location or format of documentation
https://docs.saltproject.io/en/3003/topics/reactor/index.html#beacons-and-reactors
EDIT: I realize that I misread the version of Salt we are using -- I have linked version 3003.3 of the documentation, but we are actually running version 3000.3 -- that being said, I did check the v3000.3 tag on GitHub and the 'Beacons and Reactos' section appears to be the same.
Additional context
Below is my beacon definition, which is defined in a local pillar file and applied to the minion against which I am testing:
cat /srv/pillar/justin/beacons/init.sls
beacons:
service:
- services:
eap7-standalone:
onchangeonly: True
delay: 0
emitatstartup: False
uncleanshutdown: /var/opt/rh/eap7/run/wildfly/eap7-standalone.pid
And I have documented the non-working example for my own notes in a OneNote document from which the following screenshot was taken:
