Add docs for playbook names and labels

Change-Id: I7124f6030e736a5f096b48ff7245ddc8722a22b2
This commit is contained in:
David Moreau Simard 2019-05-23 11:49:35 -04:00
parent 89daa48a6b
commit f02f3a23f7
No known key found for this signature in database
GPG Key ID: CBEB466764A9E621
2 changed files with 51 additions and 0 deletions

View File

@ -15,6 +15,7 @@ Table of Contents
API: Authentication and security <api-security>
API: Endpoint documentation <api-documentation>
API: Usage with built-in clients <api-usage>
Setting playbook names and labels <playbook-names-and-labels>
Architecture and workflows <architecture>
.. toctree::

View File

@ -0,0 +1,50 @@
Setting playbook names and labels
=================================
ARA provides the ability for users to specify playbook names and labels in
order to better distinguish playbooks run in different environments or purposes.
Names and labels are also searchable by the ARA API, allowing you to find
playbooks matching your query.
Names and labels are set as regular Ansible variables:
- ``ara_playbook_name``
- ``ara_playbook_labels``
These variables can be provided by your Ansible inventory, directly in your
playbook file, as extra-vars or any other way supported by Ansible.
For example, in an inventory:
.. code-block:: ini
[dev]
host1
host2
[dev:vars]
ara_playbook_name=deploy-dev
ara_playbook_labels='["deploy", "dev"]'
In a playbook:
.. code-block:: yaml
- name: Deploy dev environment
hosts: dev
vars:
ara_playbook_name: deploy-dev
ara_playbook_labels:
- deploy
- dev
roles:
- application
Or as extra-vars:
.. code-block:: bash
ansible-playbook -i hosts playbook.yaml \
-e ansible_playbook_name=deploy-dev \
-e ansible_playbook_labels='["deploy", "dev"]'