flatten the "playbooks" directory for better structure
All checks were successful
/ Ansible Lint (push) Successful in 1m33s
All checks were successful
/ Ansible Lint (push) Successful in 1m33s
Because of how Ansible local relative search paths work, the global "files" and "templates" directories need to be next to the playbooks. However its not intuitive to look into the playbooks directory to find the files and templates for a host. Therefore flatten the playbooks directory to get rid of this confusing structure. Also see: https://docs.ansible.com/ansible/latest/playbook_guide/playbook_pathing.html#resolving-local-relative-paths
This commit is contained in:
parent
fab4942852
commit
abc738c9c2
147 changed files with 0 additions and 0 deletions
60
roles/foobazdmx/tasks/main.yaml
Normal file
60
roles/foobazdmx/tasks/main.yaml
Normal file
|
@ -0,0 +1,60 @@
|
|||
- 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: "{{ foobazdmx_repo_url }}"
|
||||
dest: /opt/foobazdmx
|
||||
version: "{{ foobazdmx_version }}"
|
||||
- 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
|
||||
- name: Generate foobazdmx-shop service file
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: foobazdmx-shop.service.j2
|
||||
dest: /etc/systemd/system/foobazdmx-shop.service
|
||||
mode: "0755"
|
||||
- name: Enable and start foobazdmx-shop service
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
service: foobazdmx-shop.service
|
||||
state: started
|
||||
enabled: true
|
Loading…
Add table
Add a link
Reference in a new issue