aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml
diff options
context:
space:
mode:
authorcarey.xu <carey.xuhan@huawei.com>2015-12-04 09:40:39 +0800
committercarey.xu <carey.xuhan@huawei.com>2015-12-04 11:17:50 +0800
commit86782f3e375274cb65dc0b0b7d48450e73e85df3 (patch)
tree1a1c09b4b7c98e62a3102494e62ef408c0e80822 /deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml
parent5de09de80aac43e61ec411ad598e8cd915d9cadd (diff)
database script refactor
JIRA: COMPASS-176 Change-Id: I0f87903a94a8072af274d6d5dcf4dd5041f297e6 Signed-off-by: carey.xu <carey.xuhan@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml')
-rw-r--r--deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml24
1 files changed, 24 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml b/deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml
new file mode 100644
index 00000000..16783ed4
--- /dev/null
+++ b/deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml
@@ -0,0 +1,24 @@
+---
+- name: create all needed db
+ mysql_db: name={{ item.db }} state=present
+ with_items: "{{ credentials }}"
+
+- name: create service db user
+ mysql_user:
+ name={{ item[0].user }}
+ password={{ item[0].password }}
+ priv=*.*:ALL,GRANT
+ host={{ item[1] }}
+ state=present
+ with_nested:
+ - "{{ credentials }}"
+ - ['%', 'localhost', inventory_hostname]
+
+- name: create wsrep db user
+ mysql_user:
+ name={{ WSREP_SST_USER }}
+ password={{ WSREP_SST_PASS }}
+ priv=*.*:ALL,GRANT
+ host={{ item }}
+ state=present
+ with_items: ['%', 'localhost', inventory_hostname]