File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,14 @@ overwrite_global_mycnf: yes
15
15
# mysql_config_file: /etc/my.cnf
16
16
# mysql_config_include_dir: /etc/my.cnf.d
17
17
18
+ # Use repo.mysql.com to install mysql packages. Used only for Debian based systems
19
+ mysql_apt_repo_enable : false
20
+ # override this if you want to install older versions of mysql on newer OS releases
21
+ mysql_apt_repo_release : " {{ansible_distribution_release}}"
22
+ # check the repo for available entries
23
+ # Example: http://repo.mysql.com/apt/ubuntu/dists/trusty/
24
+ mysql_apt_repo_entries : [mysql-5.7]
25
+
18
26
# Pass in a comma-separated list of repos to use (e.g. "remi,epel"). Used only
19
27
# for RedHat systems (and derivatives).
20
28
mysql_enablerepo : " "
Original file line number Diff line number Diff line change 3
3
stat : path=/etc/init.d/mysql
4
4
register : mysql_installed
5
5
6
+ - name : Add repo.mysql.com apt key
7
+ apt_key : url=http://repo.mysql.com/RPM-GPG-KEY-mysql
8
+ when : mysql_apt_repo_enable
9
+
10
+ - name : Add repo.mysql.com apt repo
11
+ apt_repository :
12
+ repo : " deb http://repo.mysql.com/apt/{{ansible_distribution|lower}}/ {{mysql_apt_repo_release}} {{item}}"
13
+ with_items : " {{mysql_apt_repo_entries}}"
14
+ when : mysql_apt_repo_enable
15
+
16
+ - name : Update apt to prefer repo.mysql.com packages
17
+ copy :
18
+ content : |
19
+ Package: *
20
+ Pin: origin repo.mysql.com
21
+ Pin-Priority: 900
22
+ dest : /etc/apt/preferences.d/mysql
23
+ owner : root
24
+ group : root
25
+ mode : 0644
26
+ when : mysql_apt_repo_enable
27
+
6
28
- name : Update apt cache if MySQL is not yet installed.
7
29
apt : update_cache=yes
8
30
when : mysql_installed.stat.exists == false
You can’t perform that action at this time.
0 commit comments