Skip to content

Commit 4bdcc58

Browse files
committed
Fixes geerlingguy#374: Allow debian/ubuntu python package to be overidden.
1 parent b777096 commit 4bdcc58

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ The formats of these are the same as in the `mysql_user` module.
8484

8585
(RedHat/CentOS only) If you have enabled any additional repositories (might I suggest geerlingguy.repo-epel or geerlingguy.repo-remi), those repositories can be listed under this variable (e.g. `remi,epel`). This can be handy, as an example, if you want to install later versions of MySQL.
8686

87+
mysql_python_package_debian: ''
88+
89+
(Ubuntu/Debian only) If you need to explicitly set the MySQL Python package, you can set it here. If not set, it will default to `python-mysqldb` for Python 2 and `python3-mysqldb` for Python 3.
90+
8791
mysql_port: "3306"
8892
mysql_bind_address: '0.0.0.0'
8993
mysql_datadir: /var/lib/mysql

molecule/default/converge.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
hosts: all
44
become: true
55

6+
vars:
7+
mysql_python_package_debian: python3-mysqldb
8+
69
roles:
710
- role: geerlingguy.mysql
811

tasks/setup-Debian.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99

1010
- name: Determine required MySQL Python libraries.
1111
set_fact:
12-
deb_mysql_python_package: "{% if 'python3' in ansible_python_interpreter|default('') %}python3-mysqldb{% else %}python-mysqldb{% endif %}"
12+
mysql_python_package_debian: "{% if 'python3' in ansible_python_interpreter|default('') %}python3-mysqldb{% else %}python-mysqldb{% endif %}"
13+
when: mysql_python_package_debian is not defined
1314

1415
- name: Ensure MySQL Python libraries are installed.
1516
apt:
16-
name: "{{ deb_mysql_python_package }}"
17+
name: "{{ mysql_python_package_debian }}"
1718
state: present
1819

1920
- name: Ensure MySQL packages are installed.

0 commit comments

Comments
 (0)