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 9, 2023
1 parent b835a40 commit 9907485
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tasks/check_default_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- name: Check if Python 2 is the default version for the OS
ansible.builtin.set_fact:
default_python_version: "2"
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)
- name: Check if Python 3 is the default version for the OS
ansible.builtin.set_fact:
default_python_version: "3"
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)

0 comments on commit 9907485

Please sign in to comment.