Browse Source

Not setting MySQL root password to make playbook idempotent

merge-requests/1/merge
Christoph Haas 10 years ago
parent
commit
b36a9ef0d5
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      roles/ispmail-database/tasks/main.yml

+ 4
- 2
roles/ispmail-database/tasks/main.yml View File

@@ -1,14 +1,16 @@
---
- name: Installing required Python mysqldb module for Ansible to manage databases
apt: pkg=python-mysqldb state=installed
# - name: Creating my-cnf for root user
# template: src=root-my-cnf.j2 dest=/root/.my.cnf mode=0600
- name: creating mailserver MySQL database
mysql_db: name=mailserver state=present
- name: copying MySQL database schema to server
copy: src=schema.sql dest=/tmp
- name: setting up SQL schema of mailserver database
mysql_db: name=mailserver state=import target=/tmp/schema.sql
- name: set the MySQL root user's password
mysql_user: name=root password={{ispmail_mysql_root_password}} state=present
# - name: set the MySQL root user's password
# mysql_user: name=root password={{ispmail_mysql_root_password}} state=present
- name: creating MySQL user to read the mailserver database
mysql_user: name=mailuser password={{ispmail_mysql_mailuser_password}} priv=mailserver.*:SELECT,INSERT,UPDATE,DELETE state=present
- name: copying MySQL test data to server


Loading…
Cancel
Save