Skip to content

Commit

Permalink
Add install_python3 and prepare tasks for python
Browse files Browse the repository at this point in the history
  • Loading branch information
drmatthews committed Dec 18, 2023
1 parent c3d5958 commit f3e8848
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/molecule/resources/inventory/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,18 @@ selinux_enabled: false
server_locale: "en_GB.UTF-8"

# mirsg.infrastructure.install_python
install_python:
install_python3:
version: "3"
pip_version: "21.3.1"
pip_executable: "pip3"
system_packages:
- python3
- python3-pip
- python3-setuptools
pip_packages:
- cryptography

install_python2:
version: "2"
pip_version: "20.3.4"
pip_executable: "pip"
Expand All @@ -17,6 +28,8 @@ install_python:
pip_packages:
- cryptography

install_python: "{{ install_python_3 }}" # default to Python 3

# mirsg.infrastructure.firewalld
allow_public_access: true
internal_zone_open_services:
Expand Down
12 changes: 12 additions & 0 deletions tests/molecule/resources/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
regexp: "^FirewallBackend="
line: FirewallBackend=iptables

- name: Check the major Python version for the OS
tags: python
block:
- name: Check default version
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 if default_python_version is version('2') else install_python3 }}"

- name: Setup for PostgreSQL
tags: postgresql
block:
Expand Down

0 comments on commit f3e8848

Please sign in to comment.