ansible-development-environ.../roles/ara/tasks/main.yml

70 lines
1.5 KiB
YAML

---
# tasks file for ara
- name: install required packages
package:
name: "{{ ara_packages }}"
state: present
register: ara_install_required_packages
until: ara_install_required_packages is succeeded
retries: 3
- name: install ara
pip:
name: ara
state: present
register: ara_install_ara
until: ara_install_ara is succeeded
retries: 3
- name: create ara service
import_role:
name: robertdebock.development_environment.service
- name: find callback_plugins path
block:
- name: try python2
command: "{{ ara_setup_command_python2 }}"
register: ara_callback_plugins
changed_when: no
rescue:
- name: try python3
command: "{{ ara_setup_command_python3 }}"
register: ara_callback_plugins
changed_when: no
- name: configure ansible to use ara
ini_file:
path: "{{ ara_configuration_file }}"
section: defaults
option: callback_plugins
value: "{{ ara_callback_plugins.stdout }}"
notify:
- restart ara
when:
- ara_configuration_file is defined
- ara_callback_plugins.stdout is defined
- name: configure ara
ini_file:
path: "{{ ara_configuration_file }}"
section: ara
option: "{{ item.option }}"
value: "{{ item.value }}"
notify:
- restart ara
with_items:
- "{{ ara_configuration }}"
when:
- ara_configuration is defined
loop_control:
label: "{{ item.option }}"
- name: start and enable ara
service:
name: ara
state: started
enabled: yes
when:
- ansible_virtualization_type != "docker"