-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook-deploy.yml
46 lines (36 loc) · 1.23 KB
/
playbook-deploy.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
---
- hosts: luftsensor_deploy
vars:
repo_dest: /home/administrator/proj/feinstaub-json-mqtt-bridge
python_venv: '{{ repo_dest }}/venv'
tasks:
- name: update/checkout git repo
git:
repo: 'https://github.com/tbs1-bo/feinstaub-json-mqtt-bridge.git'
dest: '{{ repo_dest }}'
version: master
notify: restart json2mqtt service
- name: install dependencies from requirements file in repo
pip:
requirements: '{{ repo_dest }}/requirements.txt'
virtualenv: '{{ python_venv }}'
virtualenv_python: python3
- name: install supervisor package
become: yes
apt:
name: supervisor
- name: copy supervisor configuration file
become: yes
copy:
src: services/supervisor.conf
dest: /etc/supervisor/conf.d/json2mqtt.conf
- name: generating documentation
local_action: command make -C sphinx_doc html
- name: commiting documentation to local repository
local_action: command git commit --allow-empty --author='Ansible <ansible@exmaple.com>' -m "[autogenerated] ansible generated documentation" docs
handlers:
- name: restart json2mqtt service
become: yes
supervisorctl:
name: json2mqtt
state: restarted