49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
- name: Ensure apt dependencies are installed
|
|
become: true
|
|
ansible.builtin.apt:
|
|
name:
|
|
- acl
|
|
- git
|
|
- python3
|
|
- python3-pip
|
|
- python3-setuptools
|
|
|
|
- name: Ensure python peotry is installed
|
|
become: true
|
|
ansible.builtin.pip:
|
|
name: poetry
|
|
|
|
- name: Ensure foobazdmx user exists
|
|
become: true
|
|
ansible.builtin.user:
|
|
name: foobazdmx
|
|
|
|
- name: Install foobazdmx
|
|
notify: Restart foobazdmx
|
|
block:
|
|
- name: Clone foobazdmx repository
|
|
become: true
|
|
ansible.builtin.git:
|
|
repo: https://ccchh-ansible:glpat-istRKj5ivdBs_u9Tsdbp@gitlab.hamburg.ccc.de/ccchh/foobazdmx.git
|
|
dest: /opt/foobazdmx
|
|
version: main
|
|
- name: Install python dependencies
|
|
become: true
|
|
become_user: foobazdmx
|
|
ansible.builtin.command:
|
|
cmd: poetry install
|
|
chdir: /opt/foobazdmx
|
|
changed_when: false
|
|
- name: Generate foobazdmx service file
|
|
become: true
|
|
ansible.builtin.template:
|
|
src: foobazdmx.service.j2
|
|
dest: /etc/systemd/system/foobazdmx.service
|
|
mode: "0755"
|
|
- name: Enable and start foobazdmx service
|
|
become: true
|
|
ansible.builtin.systemd:
|
|
service: foobazdmx.service
|
|
state: started
|
|
enabled: true
|