| @@ -1,22 +1,22 @@ | |||||
| --- | --- | ||||
| - name: Installing required Python mysqldb module for Ansible to manage databases | - name: Installing required Python mysqldb module for Ansible to manage databases | ||||
| apt: pkg=python-mysqldb state=installed | |||||
| apt: name=python-pymysql | |||||
| # - name: Creating my-cnf for root user | # - name: Creating my-cnf for root user | ||||
| # template: src=root-my-cnf.j2 dest=/root/.my.cnf mode=0600 | # template: src=root-my-cnf.j2 dest=/root/.my.cnf mode=0600 | ||||
| - name: creating mailserver MySQL database | - name: creating mailserver MySQL database | ||||
| mysql_db: name=mailserver state=present | |||||
| mysql_db: name=mailserver | |||||
| - name: creating Roundcube MySQL database | - name: creating Roundcube MySQL database | ||||
| mysql_db: name=roundcube state=present | |||||
| mysql_db: name=roundcube | |||||
| - name: copying MySQL database schema to server | - name: copying MySQL database schema to server | ||||
| copy: src=schema.sql dest=/tmp | copy: src=schema.sql dest=/tmp | ||||
| - name: setting up SQL schema of mailserver database | - name: setting up SQL schema of mailserver database | ||||
| mysql_db: name=mailserver state=import target=/tmp/schema.sql | mysql_db: name=mailserver state=import target=/tmp/schema.sql | ||||
| # - name: set the MySQL root user's password | # - name: set the MySQL root user's password | ||||
| # mysql_user: name=root password={{ispmail_mysql_root_password}} state=present | |||||
| # mysql_user: name=root password={{ispmail_mysql_root_password}} | |||||
| - name: creating MySQL user to read the mailserver database | - 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 | |||||
| mysql_user: name=mailuser password={{ispmail_mysql_mailuser_password}} priv=mailserver.*:SELECT,INSERT,UPDATE,DELETE | |||||
| - name: creating MySQL user for roundcube | - name: creating MySQL user for roundcube | ||||
| mysql_user: name=roundcube password={{ispmail_mysql_roundcube_password}} priv=roundcube.*:ALL state=present | |||||
| mysql_user: name=roundcube password={{ispmail_mysql_roundcube_password}} priv=roundcube.*:ALL | |||||
| - name: copying MySQL test data to server | - name: copying MySQL test data to server | ||||
| copy: src=test.sql dest=/tmp | copy: src=test.sql dest=/tmp | ||||
| when: ispmail_populate_test_data == true | when: ispmail_populate_test_data == true | ||||
| @@ -24,6 +24,6 @@ | |||||
| mysql_db: name=mailserver state=import target=/tmp/test.sql | mysql_db: name=mailserver state=import target=/tmp/test.sql | ||||
| when: ispmail_populate_test_data == true | when: ispmail_populate_test_data == true | ||||
| # - name: set the MySQL root user's password | # - name: set the MySQL root user's password | ||||
| # mysql_user: name=root password={{ispmail_mysql_root_password}} state=present | |||||
| # mysql_user: name=root password={{ispmail_mysql_root_password}} | |||||
| # - name: Create root's .my.cnf | # - name: Create root's .my.cnf | ||||
| # template: src=my-cnf.j2 dest=/root/.my.cnf mode=0600 | # template: src=my-cnf.j2 dest=/root/.my.cnf mode=0600 | ||||