Created
November 4, 2015 15:39
-
-
Save jasonrogena/088bb3c65c1c6deb3d55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Copy the MariaDB root non-interactive password | |
template: src=mariadb_non_interactive_password.sh.j2 dest=/tmp/mariadb_non_interactive_password.sh owner=root group=root mode=0700 | |
- name: Execute the MariaDN root non-interactive password file | |
shell: /tmp/mariadb_non_interactive_password.sh | |
- name: Delete the non-interactive password file | |
file: path=/tmp/mariadb_non_interactive_password.sh state=absent | |
- name: Add GPG key for MariaDB repo | |
apt_key: id=0xcbcb082a1bb943db url=http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xcbcb082a1bb943db | |
- name: Add MariaDB 10.1 repo | |
apt_repository: repo="deb http://sgp1.mirrors.digitalocean.com/mariadb/repo/10.1/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} main" state=present | |
register: add_mariadb_10_1_repo | |
- name: Install mariadb-server | |
apt: name={{ item }} state=present update_cache=yes | |
with_items: | |
- mariadb-server | |
- python-mysqldb # for ansible | |
notify: | |
- enable mariadb service | |
- start mariadb service | |
register: install_mariadb | |
- name: Create .my.conf file for root user | |
template: src=.my.cnf.j2 dest=/root/.my.cnf owner=root mode=0600 | |
- name: Update MariaDB root password for all root accounts | |
mysql_user: name=root host={{ item }} password={{ mariadb_root_password }} | |
with_items: | |
- "{{ inventory_hostname }}" | |
- 127.0.0.1 | |
- ::1 | |
- localhost | |
tags: mariadb | |
# vim: set ts=2 sw=2: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your
.my.cnf.j2
is actually with a dot in the file system? Will you remember it's actually there if it's invisible?