mirror of
https://github.com/Crocmagnon/ansible.git
synced 2024-11-27 01:38:04 +01:00
create dir && restart service on change
This commit is contained in:
parent
d3f116052c
commit
031c804d97
2 changed files with 14 additions and 0 deletions
|
@ -6,3 +6,5 @@ services:
|
|||
- ./:/app
|
||||
ports:
|
||||
- "9008:8080"
|
||||
init: true
|
||||
tty: true
|
||||
|
|
|
@ -3,6 +3,11 @@
|
|||
hosts: servers
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Create dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ dir }}"
|
||||
state: directory
|
||||
mode: "0775"
|
||||
- name: Write app.py
|
||||
ansible.builtin.copy:
|
||||
src: files/test_headers/app.py
|
||||
|
@ -10,6 +15,8 @@
|
|||
mode: "0644"
|
||||
owner: gaugendre
|
||||
group: gaugendre
|
||||
notify:
|
||||
- Restart service
|
||||
- name: Write docker-compose.yaml
|
||||
ansible.builtin.copy:
|
||||
src: files/test_headers/docker-compose.yaml
|
||||
|
@ -21,5 +28,10 @@
|
|||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ dir }}"
|
||||
state: present
|
||||
handlers:
|
||||
- name: Restart service
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ dir }}"
|
||||
state: restarted
|
||||
vars:
|
||||
dir: /mnt/data/test_headers
|
||||
|
|
Loading…
Reference in a new issue