Browse Source

split role with mariadb/mail

root 9 years ago
parent
commit
49ff89dab2
2 changed files with 41 additions and 0 deletions
  1. +37
    -0
      roles/mariadb/tasks/main.yml
  2. +4
    -0
      roles/mariadb/templates/root-.my.cnf.j2

+ 37
- 0
roles/mariadb/tasks/main.yml View File

@ -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:
#

+ 4
- 0
roles/mariadb/templates/root-.my.cnf.j2 View File

@ -0,0 +1,4 @@
[client]
user = root
password = {{ rootpassword }}

Loading…
Cancel
Save