Files @ 32f61f233098
Branch filter:

Location: majic-ansible-roles/roles/database_server/tasks/main.yml

branko
Noticket: Fixed documentation and examples for CA certificate deployment in common role. Fixed usage instructions, mainly some syntax changes and more explicit listing of parameters and such. Fixed path to truststore file for mail_forwarder role. Fixed testsite configurtion for CA certificates.
---

- name: Install MariaDB
  apt: name="{{ item }}" state=installed
  with_items:
    - mariadb-client
    - mariadb-server
    - python-mysqldb

- name: Enable MariaDB service on boot (workaround for systemctl broken handling of SysV)
  command: rcconf -on mysql
  register: result
  changed_when: result.stderr == ""

- name: Enable and start MariaDB
  service: name=mysql state=started

- name: Set password for the root database user
  mysql_user: check_implicit_admin=yes name=root password="{{ db_root_password }}"

- name: Deploy username and password for the root database user
  template: src="root_my.cnf.j2" dest="/root/.my.cnf"
            owner=root group=root mode=400

- name: Set UTF-8 encoding as default for MariaDB
  copy: src="utf8.cnf" dest="/etc/mysql/conf.d/utf8.cnf"
        owner=root group=root mode=644
  notify: Restart MariaDB

- name: Explicitly run all handlers
  include: ../handlers/main.yml
  when: "handlers | default(False) | bool() == True"
  tags:
    - handlers