Created
September 10, 2014 21:13
-
-
Save bjallen/5e4f7a6a09869601000c to your computer and use it in GitHub Desktop.
ansible mysql percona task
This file contains hidden or 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: Add Percona apt signing key | |
sudo: yes | |
apt_key: keyserver=keys.gnupg.net id=1C4CBDCDCD2EFD2A state=present | |
- name: Add Percona repository | |
sudo: yes | |
apt_repository: repo='deb http://repo.percona.com/apt trusty main' state=present | |
- name: Add Percona source repository | |
sudo: yes | |
apt_repository: repo='deb-src http://repo.percona.com/apt trusty main' state=present | |
- name: Update apt cache | |
sudo: yes | |
apt: update_cache=yes | |
- name: Install python packages | |
sudo: yes | |
apt: pkg={{ item }} state=present | |
with_items: | |
- vim | |
- python-pycurl | |
- python-mysqldb | |
- name: Install Percona packages | |
sudo: yes | |
apt: pkg={{ item }} state=present update_cache=yes | |
with_items: | |
- percona-server-common-5.6 | |
- percona-server-client-5.6 | |
- percona-server-server-5.6 | |
environment: | |
DEBIAN_FRONTEND: noninteractive | |
- name: Create Mysql configuration file | |
sudo: yes | |
template: src=server.my.cnf.j2 dest=/etc/mysql/my.cnf | |
notify: | |
- restart mysql | |
- name: Update mysql root password for all root accounts | |
sudo: yes | |
mysql_user: name=root host={{ item }} password={{ mysql_root_password }} | |
with_items: | |
- "{{ ansible_hostname }}" | |
- 127.0.0.1 | |
- ::1 | |
- localhost | |
- name: Copy .my.cnf file with root password credentials | |
sudo: yes | |
template: src=root.my.cnf.j2 dest=~/.my.cnf mode=0600 |
Hello,
Change to the new Percona ( https://www.percona.com/blog/2016/10/13/new-signing-key-for-percona-debian-and-ubuntu-packages/ ):
- name: Add Percona apt signing key
sudo: yes
apt_key: keyserver=keys.gnupg.net id=8507EFA5 state=present
And will work
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was having problems getting the key from the gnupg.net server so changed the server to ubuntu's own keyserver which also hosts that key: keyserver.ubuntu.com