From 49ff89dab26e1bbdb754b3107b120843d17bde14 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 21 Oct 2014 10:34:09 +0200 Subject: [PATCH] split role with mariadb/mail --- roles/mariadb/tasks/main.yml | 37 +++++++++++++++++++++++++ roles/mariadb/templates/root-.my.cnf.j2 | 4 +++ 2 files changed, 41 insertions(+) create mode 100644 roles/mariadb/tasks/main.yml create mode 100644 roles/mariadb/templates/root-.my.cnf.j2 diff --git a/roles/mariadb/tasks/main.yml b/roles/mariadb/tasks/main.yml new file mode 100644 index 0000000..2635e74 --- /dev/null +++ b/roles/mariadb/tasks/main.yml @@ -0,0 +1,37 @@ +--- + +- name: Install prerequisites packages + apt: pkg={{item}} state=installed install_recommends=no + with_items: + - python-software-properties + - php5-cli + - php5-mysql + +- name: Add MariaDB repository Key + apt_key: keyserver=keyserver.ubuntu.com id=0xcbcb082a1bb943db state=present + +- name: Add Mariadb repository file + template: src=etc_apt_sources.list.d_mariadb.list dest=/etc/apt/sources.list.d/mariadb.list + +- name: Install Mariadb packages + apt: pkg={{item}} state=installed update_cache=yes + with_items: + - mariadb-server-{{ mariadb_version | default(10) }} + - python-mysqldb + - percona-toolkit + +- name: Set root mysql password + mysql_user: name=root password={{mysql_root_password}} + +- name: File .my.cnf for root + template: src={{item.src}} dest={{item.dest}} + with_items : + - { src: root-.my.cnf , dest: /root/.my.cnf } + + +- name: Ensure 600 permissions on my.cnf + file: path=/root/.my.cnf mode=600 + + +# vim: set textwidth=0 ft=yaml ts=2 sw=2 expandtab: +# diff --git a/roles/mariadb/templates/root-.my.cnf.j2 b/roles/mariadb/templates/root-.my.cnf.j2 new file mode 100644 index 0000000..97621e8 --- /dev/null +++ b/roles/mariadb/templates/root-.my.cnf.j2 @@ -0,0 +1,4 @@ +[client] +user = root +password = {{ rootpassword }} +