---
- name: Ensure python-soft-prop is installed
  apt:
    pkg: "{{item}}"
    state: latest
  with_items:
   - python-software-properties
# - name: Ensure the key is present
#   apt_key:
#     id: "0xcbcb082a1bb943db"
#     keyserver: keyserver.ubuntu.com
- name: Add repository
  apt_repository:
    repo: 'deb http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.0/debian wheezy main'
    state: present
  notify:
  - Update apt
- name: Ensure mariadb is installed
  apt:
    pkg: mariadb-server
    state: latest
- name: Ensure mariadb is running
  service:
    name: mysql
    state: started
    enabled: yes
- name: Create user "backup" if it not present
  mysql_user:
    name: backup
    password: "{{ lookup('password', '/tmp/mysqlpassword length=32') }}"
    priv: "*.*:SHOW DATABASES,SELECT,LOCK TABLES,RELOAD"
    state: present
---
- name: Ensure python-soft-prop is installed
  apt:
    pkg: "{{item}}"
    state: latest
  with_items:
   - python-software-properties
# - name: Ensure the key is present
#   apt_key:
#     id: "0xcbcb082a1bb943db"
#     keyserver: keyserver.ubuntu.com
- name: Add repository
  apt_repository:
    repo: 'deb http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.0/debian wheezy main'
    state: present
  notify:
  - Update apt
- name: Ensure mariadb is installed
  apt:
    pkg: mariadb-server
    state: latest
- name: Writes the UTF-8 version of the configuration
  copy:
    src: mariadb.cnf
    dest: /etc/mysql/conf.d/mariadb.cnf
- name: Remove TokuDB config file
  file:
    path: /etc/mysql/conf.d/tokudb.cnf
    state: absent
- name: Ensure mariadb is running
  service:
    name: mysql
    state: started
    enabled: yes
- name: Sets the root password if needed
  mysql_user:
    name: root
    password: "{{ lookup('password', '/tmp/mysqlrootpassword length=64') }}"
    state: present
- name: Writes /root~/.my.cnf with root password
  copy:
    src: my.cnf
    dest: /root/.my.cnf
    mode: 0600
    owner: root
    group: root
  sudo: yes
- name: Adds root password
  lineinfile:
    dest: /root/.my.cnf
    insertafter: "user=root"
    line: "password={{ lookup('file', '/tmp/mysqlrootpassword') }}"
- name: Create user "backup" if it not present
  mysql_user:
    name: backup
    password: "{{ lookup('password', '/tmp/mysqlbackuppassword length=32') }}"
    priv: "*.*:SHOW DATABASES,SELECT,LOCK TABLES,RELOAD"
    state: present
Add a good utf-8 conf for maria_db Minor fixes
Add a good utf-8 conf for maria_db
Minor fixes
