mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-11-03 19:58:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			620 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			620 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
---
 | 
						|
- name: Find matching nginx configs for {{ domain }}
 | 
						|
  ansible.builtin.find:
 | 
						|
    paths: "{{ NGINX.DIRECTORIES.HTTP.SERVERS }}"
 | 
						|
    patterns: "*.{{ domain }}.conf"
 | 
						|
  register: find_result
 | 
						|
 | 
						|
- 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 |