2019-05-03 22:42:55 +02:00
|
|
|
---
|
|
|
|
# Create service user
|
|
|
|
- include_tasks: service_user.yml
|
|
|
|
|
2020-05-07 14:55:12 +02:00
|
|
|
- name: Install Python dependencies
|
|
|
|
apt:
|
|
|
|
name:
|
|
|
|
- python3-iso8601
|
|
|
|
- python3-jinja2
|
|
|
|
update_cache: true
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
2019-08-29 07:04:37 +02:00
|
|
|
|
2019-05-03 22:42:55 +02:00
|
|
|
- name: "Clone re2o {{ service_name }} project"
|
|
|
|
git:
|
|
|
|
repo: "{{ service_repo }}"
|
|
|
|
dest: "{{ service_homedir }}/{{ service_name }}"
|
2019-05-04 18:43:20 +02:00
|
|
|
version: "{{ service_version }}"
|
2020-04-06 19:03:38 +02:00
|
|
|
force: true
|
2019-05-03 22:42:55 +02:00
|
|
|
become: true
|
|
|
|
become_user: "{{ service_user }}"
|
|
|
|
|
2020-05-21 18:06:37 +02:00
|
|
|
- name: "Configure re2o {{ service_name }} project"
|
|
|
|
community.general.ini_file:
|
2019-05-04 11:46:54 +02:00
|
|
|
path: "{{ service_homedir }}/config.ini"
|
|
|
|
section: Re2o
|
|
|
|
option: "{{ item.key }}"
|
|
|
|
value: "{{ item.value }}"
|
|
|
|
mode: 0600
|
|
|
|
become: true
|
|
|
|
become_user: "{{ service_user }}"
|
|
|
|
loop: "{{ service_config|dict2items }}"
|
|
|
|
|
|
|
|
- name: Link config file
|
|
|
|
file:
|
|
|
|
src: "{{ service_homedir }}/config.ini"
|
|
|
|
dest: "{{ service_homedir }}/{{ service_name }}/config.ini"
|
|
|
|
owner: "{{ service_user }}"
|
|
|
|
group: nogroup
|
|
|
|
state: link
|
|
|
|
|
2019-05-03 22:42:55 +02:00
|
|
|
- name: Indicate in motd service location
|
|
|
|
template:
|
|
|
|
src: update-motd.d/05-service.j2
|
|
|
|
dest: "/etc/update-motd.d/05-re2o-{{ service_name }}"
|
|
|
|
mode: 0755
|