mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-12-07 09:56:41 +00:00
25 lines
754 B
YAML
25 lines
754 B
YAML
---
|
|
- name: Find matching nginx configs for {{ domain }}
|
|
ansible.builtin.find:
|
|
paths: "{{ NGINX.DIRECTORIES.HTTP.SERVERS }}"
|
|
patterns: "*.{{ domain }}.conf"
|
|
register: find_result
|
|
|
|
- name: "Reinitialize OpenResty Handler"
|
|
include_tasks: utils/load_handlers.yml
|
|
vars:
|
|
handler_role_name: "svc-prx-openresty"
|
|
|
|
- name: Remove wildcard nginx configs for {{ domain }}
|
|
ansible.builtin.file:
|
|
path: "{{ item.path }}"
|
|
state: absent
|
|
loop: "{{ find_result.files | default([]) }}"
|
|
when: item is defined
|
|
notify: restart openresty
|
|
|
|
- name: Remove exact nginx config for {{ domain }}
|
|
ansible.builtin.file:
|
|
path: "{{ [ NGINX.DIRECTORIES.HTTP.SERVERS, domain ~ '.conf'] | path_join }}"
|
|
state: absent
|
|
notify: restart openresty |