Skip to content

Commit

Permalink
Merge pull request geerlingguy#250 from geerlingguy/jeromegamez-pytho…
Browse files Browse the repository at this point in the history
…n_by_interpreter

Infer required Python library from interpreter
  • Loading branch information
geerlingguy committed Apr 26, 2018
2 parents d46be5b + 4d920ad commit e7117fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tasks/setup-Debian.yml
Expand Up @@ -7,8 +7,12 @@
apt: update_cache=yes
when: mysql_installed.stat.exists == false

- name: Determine required MySQL Python libraries.
set_fact:
deb_mysql_python_package: "{% if 'python3' in ansible_python_interpreter|default('') %}python3-mysqldb{% else %}python-mysqldb{% endif %}"

- name: Ensure MySQL Python libraries are installed.
apt: "name=python-mysqldb state=present"
apt: "name={{ deb_mysql_python_package }} state=present"

- name: Ensure MySQL packages are installed.
apt: "name={{ item }} state=present"
Expand Down

0 comments on commit e7117fd

Please sign in to comment.