78 lines
2.0 KiB
YAML
Raw Normal View History

2022-11-12 20:45:00 +01:00
- name: "Remove all directories"
file:
2022-12-19 23:50:57 +01:00
path: "/var/www/{{ item.git_name }}"
2022-11-12 20:45:00 +01:00
state: absent
2022-12-28 18:08:18 +01:00
when: "item.git_name is defined and project_name is not defined and conf_name is not defined"
2022-11-12 20:45:00 +01:00
with_items:
2022-12-19 23:46:55 +01:00
- "{{ project }}"
2022-11-12 20:45:00 +01:00
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
- name: "Remove single directory"
file:
2022-12-19 23:46:55 +01:00
path: "/var/www/{{ project_name }}"
2022-11-12 20:45:00 +01:00
state: absent
2022-12-19 23:46:55 +01:00
when: "project_name is defined"
2022-12-20 00:14:15 +01:00
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
2022-12-28 18:08:18 +01:00
- name: "Delete all symlink"
2022-12-20 00:14:15 +01:00
file:
path: "/etc/nginx/sites-enabled/{{ item.conf_name }}"
state: absent
2022-12-28 18:08:18 +01:00
when: "item.conf_name is defined and project_name is not defined and conf_name is not defined"
2022-12-20 00:14:15 +01:00
with_items:
- "{{ project }}"
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
2022-12-28 18:08:18 +01:00
- name: "remove all configure nginx"
2022-12-20 00:14:15 +01:00
file:
path: "/etc/nginx/sites-available/{{ item.conf_name }}"
state: absent
2022-12-28 18:08:18 +01:00
when: "item.conf_name is defined and project_name is not defined and conf_name is not defined"
2022-12-20 00:14:15 +01:00
with_items:
- "{{ project }}"
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
2022-12-28 18:08:18 +01:00
- name: "Delete single symlink"
file:
path: "/etc/nginx/sites-enabled/{{ conf_name }}"
state: absent
when: "conf_name is defined"
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
- name: "remove single configure nginx"
file:
path: "/etc/nginx/sites-available/{{ conf_name }}"
state: absent
when: "conf_name is defined"
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
2022-12-20 00:14:15 +01:00
- name: restart nginx
service:
name: nginx
state: restarted
2022-11-12 20:45:00 +01:00
vars:
ansible_become: yes
ansible_become_method: sudo
2022-12-28 18:08:18 +01:00
ansible_become_password: "{{ sudo_password }}"