Commit 6dd16db6 authored by nanahira's avatar nanahira

handlers

parent d8e54d3b
---
- name: restart docker services
docker_compose:
project_src: '{{handler.path}}'
restarted: yes
services: '{{handler.services}}'
---
- name: restart nginx
become: true
shell: 'nginx -t && nginx -s reload'
---
- name: shell
become: true
shell: '{{handler.command}}'
args:
chdir: '{{handler.path}}'
---
- name: restart systemd
become: true
systemd:
name: '{{handler.name}}'
state: restarted
......@@ -22,6 +22,7 @@
checksum: yes
archive: no
perms: yes
notify: handler
- name: templates directory
file:
path: '{{ service_path }}/templates'
......@@ -35,9 +36,16 @@
owner: '{{ ansible_user_id }}'
group: '{{ ansible_user_id }}'
follow: yes
notify: handler
- name: docker-compose up -d
docker_compose:
project_src: '{{ service_path }}'
remove_orphans: true
build: '{{build}}'
pull: '{{pull}}'
handlers:
- name: handle
include_tasks: 'handlers/{{item.type}}.yaml'
vars:
handler: '{{item}}'
with_items: '{{handlers}}'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment