2022-11-11 14:10:43 +01:00
|
|
|
- name: Ensure apt dependencies are installed
|
2023-05-09 21:12:46 +02:00
|
|
|
become: true
|
2022-11-11 14:10:43 +01:00
|
|
|
ansible.builtin.apt:
|
|
|
|
name:
|
|
|
|
- acl
|
|
|
|
- git
|
|
|
|
- python3
|
|
|
|
- python3-pip
|
|
|
|
- python3-setuptools
|
2023-05-09 21:12:46 +02:00
|
|
|
|
2022-11-11 14:10:43 +01:00
|
|
|
- name: Ensure python peotry is installed
|
2023-05-09 21:12:46 +02:00
|
|
|
become: true
|
2022-11-11 14:10:43 +01:00
|
|
|
ansible.builtin.pip:
|
|
|
|
name: poetry
|
2023-05-09 21:12:46 +02:00
|
|
|
|
2022-11-11 14:10:43 +01:00
|
|
|
- name: Ensure foobazdmx user exists
|
2023-05-09 21:12:46 +02:00
|
|
|
become: true
|
2022-11-11 14:10:43 +01:00
|
|
|
ansible.builtin.user:
|
|
|
|
name: foobazdmx
|
2023-05-09 21:12:46 +02:00
|
|
|
|
2022-11-11 14:10:43 +01:00
|
|
|
- name: Install foobazdmx
|
|
|
|
notify: Restart foobazdmx
|
|
|
|
block:
|
|
|
|
- name: Clone foobazdmx repository
|
2023-05-09 21:12:46 +02:00
|
|
|
become: true
|
2022-11-11 14:10:43 +01:00
|
|
|
ansible.builtin.git:
|
|
|
|
repo: https://thinkcccentre-ansible:glpat-VegCzyjuDjB19SggAqm1@gitlab.hamburg.ccc.de/yuri/foobazdmx.git
|
|
|
|
dest: /opt/foobazdmx
|
2022-11-22 20:44:41 +01:00
|
|
|
version: bf6170aa12fa5de9b9667be9b744ad7ee6157dde
|
2022-11-11 14:10:43 +01:00
|
|
|
- name: Install python dependencies
|
2023-05-09 21:12:46 +02:00
|
|
|
become: true
|
2022-11-11 14:10:43 +01:00
|
|
|
become_user: foobazdmx
|
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: poetry install
|
|
|
|
chdir: /opt/foobazdmx
|
|
|
|
changed_when: false
|
|
|
|
- name: Generate foobazdmx service file
|
2023-05-09 21:12:46 +02:00
|
|
|
become: true
|
2022-11-11 14:10:43 +01:00
|
|
|
ansible.builtin.template:
|
|
|
|
src: foobazdmx.service.j2
|
|
|
|
dest: /etc/systemd/system/foobazdmx.service
|
|
|
|
mode: "0755"
|
|
|
|
- name: Enable and start foobazdmx service
|
2023-05-09 21:12:46 +02:00
|
|
|
become: true
|
2022-11-11 14:10:43 +01:00
|
|
|
ansible.builtin.systemd:
|
|
|
|
service: foobazdmx.service
|
|
|
|
state: started
|
|
|
|
enabled: true
|