I'd like to leverage systems with an API to provide variables to playbooks running on the controller.
Something similar to a dynamic inventory script loading from an external system.
For example with a curl command and can get the exact contents I need. IE: {"myVariable":"myValue"} or yaml format:
myVariable: myValue
I've looked at the uri module and it looks promising. The values returned by the GET call are embedded in the
returned contents along with many other API variables.
The idea being when I need a value that changes frequently or shouldn't be included in static playbooks I call the
external system that has the master value and load it.
I'd prefer not pulling the data into a variable file first. That would avoid file management issues.
I'm not too familiar with jinja2 but perhaps there's a way to take the output from URI and parse out the values.
I'm sure there is a way to do this that I haven't come across yet.
If anyone has already solved this point me in the right direction.
v/r