ansible-nginx/handlers/main.yml

47 lines
998 B
YAML

---
- name: Reload nginx
ansible.builtin.command: nginx -t
notify:
- Real-reload nginx
- Docker reload nginx
- name: Restart nginx
ansible.builtin.command: nginx -t
notify:
- Real-restart nginx
- Docker restart nginx
- name: Real-reload nginx
ansible.builtin.service:
name: nginx
state: reloaded
when: ansible_virtualization_type != 'docker'
- name: Real-restart nginx
ansible.builtin.service:
name: nginx
state: restarted
when: ansible_virtualization_type != 'docker'
- name: Docker reload nginx
ansible.builtin.command: service nginx reload
args:
warn: false
when: ansible_virtualization_type == 'docker'
- name: Docker restart nginx
ansible.builtin.command: service nginx restart
args:
warn: false
when: ansible_virtualization_type == 'docker'
- name: Restart nginx freebsd
ansible.builtin.service:
name: nginx
state: restarted
when: ansible_distribution == "FreeBSD"
- name: Setup
ansible.builtin.setup: