summaryrefslogtreecommitdiff
path: root/openstack/usr/share/openstack/postgres.yml
diff options
context:
space:
mode:
Diffstat (limited to 'openstack/usr/share/openstack/postgres.yml')
-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 5ff9355e..76888c18 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