Looking for information on how to output machine readable output form ansible-playbook.


This is done using one of the configuration options. For a general overview of configuring Ansible, see the configuration documentation, in particular the callback plugin configuration.

Callback plugins change how Ansible provides feedback on the progress and state of tasks. There are several options for JSON output:

  1. JSON output to stdout
  2. JSON to syslog

Setting these configuration options can be done either in a configuration file (ansible.cfg) or with environment variables (ANSIBLE_XXX), depending on what you prefer. To quote the current documentation:

Changes can be made and used in a configuration file which will be searched for in the following order:

   ANSIBLE_CONFIG (environment variable if set)
   ansible.cfg (in the current directory)
   ~/.ansible.cfg (in the home directory)

Ansible will process the above list and use the first file found, all others are ignored.

Assuming you want to send the output to stdout then, your ansible.cfg could look like:


Using environment variables:

  • Appreciate your help!
    – CLJ
    Aug 16 '20 at 23:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.