ansible-nginx/handlers/main.yml

43 lines
1.1 KiB
YAML
Raw Normal View History

2015-07-15 17:14:39 +07:00
---
2015-07-15 20:18:51 +07:00
2023-05-30 20:28:55 +07:00
- name: Reload nginx # noqa: no-changed-when
2021-09-01 16:58:39 +07:00
ansible.builtin.command: nginx -t
notify:
2022-11-25 15:52:40 +07:00
- Real-reload nginx
- Docker reload nginx
2023-05-30 20:28:55 +07:00
- name: Restart nginx # noqa: no-changed-when
2021-09-01 16:58:39 +07:00
ansible.builtin.command: nginx -t
notify:
2022-11-25 15:52:40 +07:00
- Real-restart nginx
- Docker restart nginx
2017-11-03 16:30:24 +07:00
2022-11-25 15:52:40 +07:00
- name: Real-reload nginx
2021-09-01 16:58:39 +07:00
ansible.builtin.service:
2017-10-26 20:47:30 +07:00
name: nginx
state: reloaded
when: ansible_virtualization_type != 'docker'
2022-11-25 15:52:40 +07:00
- name: Real-restart nginx
2021-09-01 16:58:39 +07:00
ansible.builtin.service:
2017-11-03 16:30:24 +07:00
name: nginx
state: restarted
when: ansible_virtualization_type != 'docker'
2023-05-30 20:28:55 +07:00
- name: Docker reload nginx # noqa: no-changed-when command-instead-of-module
2021-09-01 16:58:39 +07:00
ansible.builtin.command: service nginx reload
when: ansible_virtualization_type == 'docker'
2023-05-30 20:28:55 +07:00
- name: Docker restart nginx # noqa: no-changed-when command-instead-of-module
2021-09-01 16:58:39 +07:00
ansible.builtin.command: service nginx restart
when: ansible_virtualization_type == 'docker'
2017-11-03 16:30:24 +07:00
2022-11-25 15:52:40 +07:00
- name: Restart nginx freebsd
2021-09-01 16:58:39 +07:00
ansible.builtin.service:
2017-10-26 20:47:30 +07:00
name: nginx
state: restarted
when: ansible_distribution == "FreeBSD"
2017-10-26 20:50:59 +07:00
2022-11-25 15:52:40 +07:00
- name: Setup
2021-09-01 16:58:39 +07:00
ansible.builtin.setup: