Configuring the ARA Ansible plugins¶
ARA plugins uses the same mechanism and configuration files as Ansible to retrieve it’s configuration. It comes with sane defaults that can be customized if need be.
The order of priority is the following:
Environment variables
./ansible.cfg
(in the current working directory)~/.ansible.cfg
(in the home directory)/etc/ansible/ansible.cfg
When using the ansible.cfg
file, the configuration options must be set
under the ara namespace, like so:
[ara]
variable = value
ARA callback plugin¶
The ARA callback plugin is the component that recovers data throughout the execution of your playbook and sends it to the API.
By default, the callback plugin is set up to use the local API server with the offline API client but you can also send data to a remote API server, specify credentials or customize other parameters:
callback: ara
callback_type: notification
requirements:
- ara
short_description: Sends playbook execution data to the ARA API internally or over HTTP
description:
- Sends playbook execution data to the ARA API internally or over HTTP
options:
api_client:
description: The client to use for communicating with the API
default: offline
env:
- name: ARA_API_CLIENT
ini:
- section: ara
key: api_client
choices: ['offline', 'http']
api_server:
description: When using the HTTP client, the base URL to the ARA API server
default: http://127.0.0.1:8000
env:
- name: ARA_API_SERVER
ini:
- section: ara
key: api_server
api_username:
description: If authentication is required, the username to authenticate with
default: null
env:
- name: ARA_API_USERNAME
ini:
- section: ara
key: api_username
api_password:
description: If authentication is required, the password to authenticate with
default: null
env:
- name: ARA_API_PASSWORD
ini:
- section: ara
key: api_password
api_insecure:
description: Can be enabled to ignore SSL certification of the API server
type: bool
default: false
env:
- name: ARA_API_INSECURE
ini:
- section: ara
key: api_insecure
api_timeout:
description: Timeout, in seconds, before giving up on HTTP requests
type: integer
default: 30
env:
- name: ARA_API_TIMEOUT
ini:
- section: ara
key: api_timeout
ignored_facts:
description: List of host facts that will not be saved by ARA
type: list
default: ["ansible_env"]
env:
- name: ARA_IGNORED_FACTS
ini:
- section: ara
key: ignored_facts
ignored_arguments:
description: List of Ansible arguments that will not be saved by ARA
type: list
default: ["extra_vars"]
env:
- name: ARA_IGNORED_ARGUMENTS
ini:
- section: ara
key: ignored_arguments
For example, a customized callback plugin configuration might look like this in
an ansible.cfg
file:
[ara]
api_client = http
api_server = https://api.demo.recordsansible.org
api_username = user
api_password = password
api_timeout = 15
ignored_facts = '["ansible_env", "ansible_all_ipv4_addresses"]'
ignored_arguments = '["extra_vars", "vault_password_files"]'
or as environment variables:
export ARA_API_CLIENT=http
export ARA_API_SERVER="https://api.demo.recordsansible.org"
export ARA_API_USERNAME=user
export ARA_API_PASSWORD=password
export ARA_API_TIMEOUT=15
export ARA_IGNORED_FACTS='["ansible_env", "ansible_all_ipv4_addresses"]'
export ARA_IGNORED_ARGUMENTS='["extra_vars", "vault_password_files"]'
ARA action plugin: ara_record¶
The ara_record
action plugin recovers it’s configuration from the callback
plugin.
It is therefore not necessary to configure it explicitely other than
enabling Ansible to find it by setting action_plugins
in ansible.cfg
or
the ANSIBLE_ACTION_PLUGINS
environment variable.