-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathuclalib_newmysql.yml
69 lines (61 loc) · 1.9 KB
/
uclalib_newmysql.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
58
59
60
61
62
63
64
65
66
67
68
69
---
- name: Playbook to migrate MySQL servers
hosts:
- p-d-mysqlsrc01.library.ucla.edu
- p-d-mysqlreplica01.library.ucla.edu
become: yes
become_method: sudo
vars:
mysql_vers: "5.7.28-1.el7"
mysql_pkgs:
- "mysql-community-server-{{ mysql_vers }}"
- "mysql-community-client-{{ mysql_vers }}"
- "mysql-community-libs-{{ mysql_vers }}"
- "mysql-community-common-{{ mysql_vers }}"
- "mysql-community-libs-compat-{{ mysql_vers }}"
service_definitions:
mysql:
desc: "MySQL Port"
proto: tcp
port: "3306"
rule_definitions:
- family: ipv4
src_addr: 164.67.40.0/24
srv_name: mysql
action: accept
- family: ipv4
src_addr: 164.67.48.0/24
srv_name: mysql
action: accept
tasks:
- name: Install MySQL GPG
rpm_key:
key: https://repo.mysql.com/RPM-GPG-KEY-mysql
state: present
- name: Install MySQL community repo
yum_repository:
name: mysql57-community
description: MySQL 5.7 Community Server
baseurl: http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
gpgcheck: yes
enabled: yes
- name: Install MySQL community connectors repo
yum_repository:
name: mysql-connectors-community
description: MySQL Connectors Community
baseurl: http://repo.mysql.com/yum/mysql-connectors-community/el/7/$basearch/
gpgcheck: yes
enabled: yes
- name: Install MySQL community tools repo
yum_repository:
name: mysql-tools-community
description: MySQL Tools Community
baseurl: http://repo.mysql.com/yum/mysql-tools-community/el/7/$basearch/
gpgcheck: yes
enabled: yes
- name: Install MySQL server and dependent packages
yum:
name: "{{ mysql_pkgs }}"
state: present
roles:
- { role: uclalib_role_firewalld }