feat(pretix): add ansible role and playbook
This commit is contained in:
30
roles/pretix/tasks/prepare-systemd.yml
Normal file
30
roles/pretix/tasks/prepare-systemd.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
- name: Ensure ansible facts are collected
|
||||
ansible.builtin.setup:
|
||||
gather_subset:
|
||||
- "!all"
|
||||
- "pkg_mgr"
|
||||
- "distribution"
|
||||
- "distribution_release"
|
||||
- "distribution_version"
|
||||
- "distribution_major_version"
|
||||
|
||||
- name: Ensure system packages are present (apt)
|
||||
ansible.builtin.apt:
|
||||
name: "{{ package }}"
|
||||
state: "{{ pretix_state }}"
|
||||
loop: "{{ pretix_packages[ansible_distribution | lower][ansible_distribution_major_version] }}"
|
||||
loop_control:
|
||||
loop_var: "package"
|
||||
when: ansible_facts['pkg_mgr'] == 'apt'
|
||||
|
||||
- name: Ensure systemd unit is present
|
||||
ansible.builtin.template:
|
||||
src: "pretix.service.j2"
|
||||
dest: "{{ pretix_systemd_unit_file_path }}"
|
||||
register: pretix_systemd_unit_info
|
||||
|
||||
- name: Ensure systemd is reloaded
|
||||
ansible.builtin.systemd_service:
|
||||
daemon_reload: true
|
||||
when: pretix_systemd_unit_info.changed
|
Reference in New Issue
Block a user