summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-05-28 16:45:43 (GMT)
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-05-29 09:10:45 (GMT)
commit6322f4d2fe14968a243c825ded4e8c9d251d3eac (patch)
tree796c94a0cad26127191d55009b9788a5a15c289d
parent600ce594fb822cc40bafc1f70dd16082ff5545a7 (diff)
downloaddefinitions-baserock/pedroalvarez/openstack-kilo-mariadb.tar.gz
Configure Mysql user in postgres.yml for nowbaserock/pedroalvarez/openstack-kilo-mariadb
-rw-r--r--openstack/usr/share/openstack/postgres.yml31
1 files changed, 31 insertions, 0 deletions
diff --git a/openstack/usr/share/openstack/postgres.yml b/openstack/usr/share/openstack/postgres.yml
index 5ff9355..76888c1 100644
--- a/openstack/usr/share/openstack/postgres.yml
+++ b/openstack/usr/share/openstack/postgres.yml
@@ -46,3 +46,34 @@
state: started
with_items:
- postgres-server
+
+### MARIADB conf
+ - name: Create postgres user
+ user:
+ name: mysql
+ comment: MySQL Server
+ shell: /sbin/nologin
+ home: /var/lib/mysql
+
+ - name: Install database priviledge tables
+ shell: mysql_install_db --basedir=/usr --datadir=/var/lib/mysql --user=mysql
+
+ - name: Setup mysql server daemon
+ shell: install -v -m755 -o mysql -g mysql -d /run/mysqld
+
+ - name: Enable and start postgres services
+ service:
+ name: "{{ item }}"
+ enabled: yes
+ state: started
+ with_items:
+ - mariadb
+
+ - name: Create a database user (for the first run only)
+ mysql_user:
+ name: "{{ mysqldb_admin_user | default('root') }}"
+ password: "{{ mysqldb_admin_password | default('toor') }}"
+ priv: "*.*:ALL"
+ host: localhost
+ state: present
+ ignore_errors: yes