Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Add task file for checking default python version
Browse files Browse the repository at this point in the history
  • Loading branch information
p-j-smith committed Feb 8, 2023
1 parent 9ef7f75 commit 85b68da
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
- "!min"
- "!all"
pre_tasks:
- name: Set Python install version to 2 for older OSes
- name: Check the major Python version for the OS
ansible.builtin.include_role:
name: "mirsg.install_python"
tasks_from: "check_default_version"
- name: Set install_python variable based on the version to be installed
ansible.builtin.set_fact:
install_python: "{{ install_python2 }}"
when: >
(ansible_os_family == 'RedHat') and (ansible_distribution_major_version | int < 8) or
(ansible_distribution == 'Debian') and (ansible_distribution_major_version | int < 10) or
(ansible_distribution == 'Ubuntu') and (ansible_distribution_major_version | int < 18)
install_python: "{{ 'install_python2' if default_python_version is version('2') else 'install_python3' }}"
tasks:
- name: Install Python, pip, and setuptools
ansible.builtin.include_role:
Expand Down

0 comments on commit 85b68da

Please sign in to comment.