system-config/playbooks/roles/install-ansible/tasks/install_ara.yaml
David Moreau Simard 35e87d6879
Add support for enabling the ARA callback plugin in install-ansible
This change enables the installation of the ARA callback plugin in
the install-ansible role. It does not take care of any web reporting
capabilities.

ARA will not be installed and set up by default.
It can be installed and configured by setting
"install_ansible_enable_ara" to "true".

Co-Authored-By: David Moreau-Simard <dmsimard@redhat.com>
Co-Authored-By: Ian Wienand <iwienand@redhat.com>
Change-Id: Iea84ec8e23ca2e3f021aafae4e89c764f2e05bd2
2018-12-04 17:46:47 -05:00

39 lines
1.4 KiB
YAML

- name: Install pymysql for ara
pip:
name: pymysql
state: present
when: '"pymysql" in install_ansible_ara_config["database"]'
# If ansible_install_ansible_ara_version is not defined it should be "latest"
- name: Set ara default version to latest
set_fact:
install_ansible_ara_version: latest
when: install_ansible_ara_version is not defined
# If a version is not explicitly set we want to make sure to
# completely omit the version argument to pip, as it will be coming
# from the long-form install_ansible_ara_name variable. Additionally,
# if the version is the special value "latest", then we also want to
# omit any version number, but also set the package state to "latest".
- name: Set ARA version for installation
set_fact:
_install_ansible_ara_version: '{{ install_ansible_ara_version }}'
when: install_ansible_ara_version not in ('', 'latest')
- name: Set ARA package state for installation
set_fact:
_install_ansible_ara_state: latest
when: install_ansible_ara_version == 'latest'
- name: Install ARA
pip:
name: '{{ install_ansible_ara_name | default("ara") }}'
version: '{{ _install_ansible_ara_version | default(omit) }}'
state: '{{ _install_ansible_ara_state | default(omit) }}'
# For configuring the callback plugins location in ansible.cfg
- name: Get ARA's location for callback plugins
command: python3 -m ara.setup.callback_plugins
register: install_ansible_ara_callback_plugins
changed_when: false