infrastructure/roles/teamspeak_fallback/tasks/main.yml

37 lines
1.1 KiB
YAML
Raw Normal View History

2024-09-26 22:02:36 +00:00
---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }}
vars:
svc: "{{ teamspeak_fallback_svc }}"
block:
- name: Import tasks to create service directory
ansible.builtin.import_tasks: tasks/steps/create-service-directory.yml
- name: Copy the docker-compose file
ansible.builtin.copy:
src: docker-compose.yml
dest: "{{ (service_path, 'docker-compose.yml') | path_join }}"
mode: "0644"
- name: Template the conditional-start script
ansible.builtin.template:
src: conditional-start.sh.j2
dest: "{{ (service_path, 'conditional-start.sh') | path_join }}"
mode: "0755"
- name: Copy the system service
ansible.builtin.template:
src: teamspeak-fallback.service.j2
dest: /etc/systemd/system/teamspeak-fallback.service
mode: "0644"
become: true
- name: Enable the system service
ansible.builtin.systemd_service:
name: teamspeak-fallback.service
state: started
enabled: true
daemon_reload: true
become: true