/
ara.yml
52 lines (52 loc) · 1.66 KB
/
ara.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
- hosts: all
user: root
vars:
- config_path: "{{ CONFIG_PATH|default('/etc/ansible/ansible.cfg') }}"
- host: "{{ HOST }}"
- port: "{{ PORT|default('8080') }}"
tasks:
- name: Install dependencies via dnf
dnf: name={{ item }} state=latest
with_items:
- python-pip
- gcc
- ansible
- python-devel
- libffi-devel
- openssl-devel
- redhat-rpm-config
- python-setuptools
- tree
- libselinux-python
when: ansible_pkg_mgr == 'dnf'
- name: Install dependencies via yum
yum: name={{ item }} state=latest
with_items:
- gcc
- python-devel
- libffi-devel
- openssl-devel
- redhat-rpm-config
when: ansible_pkg_mgr == 'yum'
- name: Install pip
easy_install: name=pip state=latest
- name: Install ara
pip: name={{ item }}
with_items:
- ara
- tox
- name: Enable ara plugin
lineinfile: dest={{ config_path }}
line={{ item.line }}
insertafter={{ item.insertafter }}
with_items:
- { line: "callback_plugins = /usr/lib/python2.7/site-packages/ara/callback:$VIRTUAL_ENV/lib/python2.7/site-packages/ara/callback:/usr/local/lib/python2.7/dist-packages/ara/callback", insertafter: "^#? some" }
- name: copy systemd service template
template: src=templates/ara.service.conf.j2 dest=/etc/systemd/system/ara.service owner=root group=root mode=0644
- name: daemon reload
shell: systemctl daemon-reload
- name: Enable service
service: name=ara enabled=yes
- name: start service
service: name=ara state=started