Skip to content

Instantly share code, notes, and snippets.

@silviud
Last active April 12, 2017 17:49
Show Gist options
  • Save silviud/6382400 to your computer and use it in GitHub Desktop.
Save silviud/6382400 to your computer and use it in GitHub Desktop.
Debian/Ubuntu install Percona Server with Ansible
# file for pressed
# password is empty
percona-server-server-5.6 percona-server-server/root_password password
percona-server-server-5.6 percona-server-server/root_password_again password
# playbook
---
# Common task list
- name: Install python packagess
apt: pkg={{ item }} state=present
with_items:
- vim
- python-pycurl
- python-mysqldb
- name: Copy Percona key
copy: src=percona.gpg dest=/etc/apt/percona.gpg owner=root mode=400
- name: Percona key
apt_key: file=/etc/apt/percona.gpg state=present
- name: Copy Percona repo
copy: src=percona.repo dest=/etc/apt/sources.list.d/percona.list owner=root
- name: Update apt
raw: apt-get update
- name: Apt debconf create
copy: src=apt-debconf-mysql.conf dest=/root/.apt-debconf-mysql.conf owner=root mode=400
# answer are written into /var/cache/debconf/templates.dat on Ubuntu 12.04
# the file can be deleted !
- name: Apt debconf selecttions
action: command debconf-set-selections /root/.apt-debconf-mysql.conf
- name: Install Percona Server
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment