---

# Now install MariaDB Server and setup a testing database
- name: install the latest version of MariaDB
  dnf: name=mariadb-server state=latest
  tags:
    - mariadb

- name: install the Python extensions for MariaDB
  dnf: name=MySQL-python state=latest
  tags:
    - mariadb

- name: Ensure MariaDB is started now, and again on startup
  service: name=mariadb enabled=yes state=started
  tags:
    - mariadb

- name: Create Hibernate testing users for MariaDB
  mysql_user: name=hibernate_user password=hibernate_password priv=*.*:ALL state=present
  tags:
    - mariadb

- name: Create Hibernate ORM testing users for MariaDB
  mysql_user: name=hibernate_orm_test password=hibernate_orm_test priv=*.*:ALL state=present
  tags:
    - mariadb

- name: Ensure the MariaDB testing database exists
  mysql_db: name=testingdb state=present login_user=hibernate_user login_password=hibernate_password
  tags:
    - mariadb

- name: Ensure the MariaDB second testing database exists
  mysql_db: name=hibernate_orm_test state=present login_user=hibernate_orm_test login_password=hibernate_orm_test
  tags:
    - mariadb

- name: Apply MariaDB tuning suited for unit tests
  copy: src=my.cnf dest=/etc/my.cnf owner=root group=root mode=0644
  tags:
    - mariadb
  notify:
     - Restart MariaDB

---

# Now install MariaDB Server and setup a testing database
- name: install the latest version of MariaDB
  dnf: name=mariadb-server state=latest
  tags:
    - mariadb

- name: install the Python extensions for MariaDB
  dnf: name=MySQL-python state=latest
  tags:
    - mariadb

- name: Ensure MariaDB is started now, and again on startup
  service: name=mariadb enabled=yes state=started
  tags:
    - mariadb

- name: Apply MariaDB tuning suited for unit tests
  copy: src=my.cnf dest=/etc/my.cnf owner=root group=root mode=0644 force=yes
  tags:
    - mariadb

- name: Ensure MariaDB is started now, and again on startup
  service: name=mariadb enabled=yes state=restarted
  tags:
    - mariadb

- name: Create Hibernate testing users for MariaDB
  mysql_user: name=hibernate_user password=hibernate_password priv=*.*:ALL state=present
  tags:
    - mariadb

- name: Create Hibernate ORM testing users for MariaDB
  mysql_user: name=hibernate_orm_test password=hibernate_orm_test priv=*.*:ALL state=present
  tags:
    - mariadb

- name: Ensure the MariaDB testing database exists
  mysql_db: name=testingdb state=present login_user=hibernate_user login_password=hibernate_password
  tags:
    - mariadb

- name: Ensure the MariaDB second testing database exists
  mysql_db: name=hibernate_orm_test state=present login_user=hibernate_orm_test login_password=hibernate_orm_test
  tags:
    - mariadb


Apply MariaDB configuration before user creation
Apply MariaDB configuration before user creation
