hpc-cloud/roles/mariadb/tasks/main.yml

22 lines
759 B
YAML
Raw Normal View History

# Install a docker based mariadb.
---
- include: ../common/tasks/docker.yml
- name: install service file.
template:
src: files/mysql.service
dest: /etc/systemd/system/mysql.service
mode: 644
owner: root
group: root
- name: install service file
command: systemctl daemon-reload
- name: make sure service is started
systemd:
name: mysql.service
state: started
2017-05-10 11:21:17 +02:00
- name: create keystone db and credentials.
command: echo "create database if not exists keystone; \n
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone'; \n
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone'" \
| mysql -uroot -pgeheim --host 127.0.0.1