Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script engine #50005

Merged
merged 9 commits into from
Oct 17, 2018
Merged

script engine #50005

merged 9 commits into from
Oct 17, 2018

Conversation

austinpapp
Copy link
Contributor

What does this PR do?

Creates events based on an arbitrary script's stdout.

The script engine will scrap stdout of the given script and generate an event based on the presence of the 'tag' key and it's value.

If there is a data obj available, that will also be fired along with the tag.

Example:

Given the following json output from a script's stdout:

            { "tag" : "lots/of/tacos",
              "data" : { "toppings" : "cilantro" }
            }

This will fire the event on the event bus:

{"tag": "lots/of/tacos", "data": {"toppings": "cilantro"}}

Any available serializer to salt can be specified to deserialized stdout such as yaml, json.

What issues does this PR fix or reference?

n/a

Tests written?

Yes

Commits signed with GPG?

No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@garethgreenaway
Copy link
Contributor

@austinpapp This looks cool! Nicely done. Looks like one of your tests is failing though.

@austinpapp
Copy link
Contributor Author

@garethgreenaway will take a look. thanks. :)

@cachedout
Copy link
Contributor

I have wanted to see this functionality for a while so this is awesome. One thought, though, is that this engine's name really isn't very intuitive. Is script_events or something better? I'm not sure. Thoughts?

@austinpapp
Copy link
Contributor Author

@cachedout thanks! wrt the naming, yea i thought about that but essentially all engines generate events. seemed redundant to add event to the name. however, im not closely tied to any particular name so if you feel its a better choice, sounds good :)

@garethgreenaway garethgreenaway merged commit 1e25bd2 into saltstack:develop Oct 17, 2018
@austinpapp austinpapp deleted the script-engine branch January 2, 2019 16:31
garethgreenaway added a commit to garethgreenaway/salt that referenced this pull request Sep 19, 2019
dwoz added a commit that referenced this pull request Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants