24 lines
951 B
YAML
24 lines
951 B
YAML
---
|
|
# included per website with state: absent, certificates and docroot are kept
|
|
- name: "{{ site.domain }}: deactivate and remove vhosts"
|
|
file:
|
|
path: "{{ item }}"
|
|
state: absent
|
|
loop:
|
|
- /etc/apache2/sites-enabled/{{ site.domain }}.conf
|
|
- /etc/apache2/sites-enabled/{{ site.domain }}-ssl.conf
|
|
- /etc/apache2/sites-available/{{ site.domain }}.conf
|
|
- /etc/apache2/sites-available/{{ site.domain }}-ssl.conf
|
|
- /etc/apache2/conf-available/{{ site.domain }}-ssl-optionalDirectives.conf
|
|
notify:
|
|
- reload apache2
|
|
|
|
- name: "{{ site.domain }}: stop certificate renewal"
|
|
shell: |
|
|
if /root/.acme.sh/acme.sh --list | awk 'NR>1 {print $1}' | grep -qxF '{{ site.domain }}'; then
|
|
/root/.acme.sh/acme.sh --remove -d '{{ site.domain }}' --ecc || /root/.acme.sh/acme.sh --remove -d '{{ site.domain }}'
|
|
echo removed
|
|
fi
|
|
register: _website_acme_remove
|
|
changed_when: "'removed' in _website_acme_remove.stdout"
|