2022-08-05 20:59:55 +02:00

38 lines
960 B
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
#- name: debug
# debug:
# msg: "Service: {{ service }}"
- name: "{{ service }} | create docker-compose directory"
file:
path: /opt/docker-compose/{{ service }}
state: directory
mode: '0755'
tags: [ 'docker_{{ service }}' ]
- name: "{{ service }} | copy docker-compose file"
template:
src: compose/{{ service }}.yml.j2
dest: /opt/docker-compose/{{ service }}/docker-compose.yml
owner: root
group: root
mode: 0644
notify: "{{ service }}-restart"
tags: [ 'docker_{{ service }}' ]
- name: "{{ service }} | install unit file to systemd"
template:
src: systemd/docker-compose.service.j2
dest: /etc/systemd/system/docker-compose@{{ service }}.service
owner: root
group: root
mode: 0600
tags: [ 'docker_{{ service }}' ]
- name: "{{ service }} | enable service"
systemd:
daemon_reload: yes
name: docker-compose@{{ service }}
enabled: true
tags: [ 'docker_{{ service }}' ]