42 lines
1,023 B
YAML
42 lines
1,023 B
YAML
---
|
|
# Create service user
|
|
- include_tasks: service_user.yml
|
|
|
|
- name: Install Python dependencies
|
|
apt:
|
|
name:
|
|
- python3-iso8601
|
|
- python3-jinja2
|
|
update_cache: true
|
|
register: apt_result
|
|
retries: 3
|
|
until: apt_result is succeeded
|
|
|
|
- name: "Clone re2o {{ service_name }} project"
|
|
git:
|
|
repo: "{{ service_repo }}"
|
|
dest: "{{ service_homedir }}/{{ service_name }}"
|
|
version: "{{ service_version }}"
|
|
force: true
|
|
become: true
|
|
become_user: "{{ service_user }}"
|
|
|
|
- name: "Configure re2o {{ service_name }} project"
|
|
community.general.ini_file:
|
|
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
|
|
...
|