-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdropwpdb.yml
More file actions
36 lines (30 loc) · 803 Bytes
/
Copy pathdropwpdb.yml
File metadata and controls
36 lines (30 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
# Remove wordpress database in preparation for reloading fresh instance
# follow with
# - 'ansible-playbook -i inventory site.yml -l database' to recreate DB
# - stack_restart.yml to restart all app servers
- hosts: database
become: true
vars:
mariadb_databases:
- name: wordpress
mariadb_users:
- name: wordpress
password: wordpress
host: '%'
priv: wordpress.*:ALL
mariadb_root_password: 'password'
mariadb_bind_address: '0.0.0.0'
tasks:
- name: Remove the wordpress database
mysql_db:
name: "{{ item.name }}"
login_user: root
login_password: "{{ mariadb_root_password }}"
state: absent
with_items: "{{ mariadb_databases }}"
tags: mariadb
- debug:
var: db_delete
verbosity: 2
#