wpremove.yaml
- name: Wordpress Remove
hosts: 192.168.200.102
tasks:
- name: Stop Apache2 Service
service:
name: apache2
state: stopped
ignore_errors: true
- name: Remove Apache2 Package
apt:
name: apache2, php, php-mysql, php-gd, php-mbstring
state: absent
purge: yes
- name: Remove Dep-Apache2 Package
apt:
autoremove: yes
purge: yes
- name: Remove Apache Configuration
file:
path: /etc/apache2
state: absent
- name: Delete Wordpress Archive Files
file:
path: /tmp/wordpress-5.8.tar.gz
state: absent
- name: Delete Wordpress App
file:
path: /var/www/html
state: absent
- name: MySQL Remove
hosts: 192.168.200.102
tasks:
- name: Stop MySQL Service
service:
name: mysql
state: stopped
ignore_errors: true
- name: Remove MySQL Package
apt:
name: mysql-server, python3-pymysql, mysql-common, mysql-client
state: absent
purge: yes
- name: Remove MySQL Configuration
file:
path: /etc/mysql
state: absent
- name: Remove Dep-MySQL Package
apt:
autoremove: yes
purge: yes
- name: Cleanup Databases
file:
path: /var/lib/mysql
state: absent
삭제 플레이북
-> 재설치를 고려해 삭제한다
1. 서비스를 중단(stop)
2. 패키지 제거
3. 의존성 패키지 제거 (autoremove)
4. 설정파일 제거
'클라우드 > 앤서블(Ansible)' 카테고리의 다른 글
앤서블 Ansible 작업 제어 1 / 반복문 (0) | 2021.08.02 |
---|---|
앤서블 Ansible 변수 (0) | 2021.07.29 |
앤서블 Ansible 플레이북 ( playbook ) / wordpress 구성하기 2 (0) | 2021.07.29 |
앤서블 Ansible 플레이북 ( playbook ) / wordpress 구성하기 1 (0) | 2021.07.29 |
앤서블 Ansible Ad-hoc 명령으로 mysql 구성하기 (0) | 2021.07.28 |