-
Notifications
You must be signed in to change notification settings - Fork 1
/
CentOS7x_Install-Percona-MySQL-Client-playbook.yml
57 lines (46 loc) · 1.89 KB
/
CentOS7x_Install-Percona-MySQL-Client-playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
################################################################################
# description: Installs Percona MySQL client on CentOS7x
# usage: ansible-playbook CentOS7x_Install-Percona-MySQL-Client-playbook.yml --extra-vars 'HostOrGroup=YourServerOrGroupNameGoesHere'
# author: Ernest G. Wilson II <ErnestGWilsonII@gmail.com> (https://github.com/ernestgwilsonii)
# license: MIT
################################################################################
# Ansible Playbook options
# REF: http://docs.ansible.com/ansible/playbooks.html
#####################################################
- name: Install Percona MySQL client on CentOS7x
hosts: "{{ HostOrGroup|default ('FATAL ERROR --> HostOrGroup NOT SET! You must specify either a Host or a Group name!') }}"
serial: "100%"
gather_facts: False
tasks:
# Install yum packages
# REF: http://docs.ansible.com/ansible/yum_module.html
######################################################
- name: Install the Percona yum repository for CentOS7x via remote rpm
yum:
name: http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm
state: present
- name: Install the Percona MySQL client package in CentOS7x (downloads from Percona's yum repo)
yum:
name=Percona-Server-client-57.x86_64
state=latest
# Tweak settings in INI files
# REF: http://docs.ansible.com/ansible/ini_file_module.html
###########################################################
- name: Specify protocol tcp under the client section in /etc/my.cnf
ini_file:
dest: /etc/my.cnf
section: client
option: protocol
value: 'tcp'
owner: root
group: root
mode: 0644
state: present
- name: Specify port 3306 under the client section in /etc/my.cnf
ini_file:
dest: /etc/my.cnf
section: client
option: port
value: '3306'
state: present