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

Add json parameter to get JSON output from ansible.command* #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jun 24, 2017

  1. Fix JSON quoting bug

    Quotes around the extra-vars JSON only make sense in a shell.
    Shells strip those quotes off and pass the whole thing in to the
    application. Ansible couldn't parse or understand the JSON with the
    quotes in place, so remove them and fix the tests accordingly.
    cognifloyd committed Jun 24, 2017
    Configuration menu
    Copy the full SHA
    8c2d845 View commit details
    Browse the repository at this point in the history
  2. v0.6.0: json parameter to get JSON for ad-hoc cmds

    This adds a json parameter to ansible.command and ansible.command_local.
    Using this parameter ensures that the stdout from a command is valid
    JSON. This is especially helpful to make variables/facts from the setup
    module (for example) available in an st2 workflow.
    
    To make this work, we depend on ansible's --tree parameter to save the
    output for each node in the 'tree' directory. We ignore all of ansible's
    stdout, and instead feed the contents of all of the tree/node files in
    one big json object (key is node name, and value is the output).
    
    Bump to 0.6.0
    
    Signed-off-by: Jacob Floyd <[email protected]>
    cognifloyd committed Jun 24, 2017
    Configuration menu
    Copy the full SHA
    20e6527 View commit details
    Browse the repository at this point in the history