From 60540ca0e7513d154dc85e87d5b79f0ca20c4bb3 Mon Sep 17 00:00:00 2001 From: Daniel Matthews Date: Mon, 18 Dec 2023 21:48:25 +0000 Subject: [PATCH] Add pre tasks to converge playbook --- tests/molecule/resources/converge.yml | 13 +++++++++++++ tests/molecule/resources/prepare.yml | 12 ------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/molecule/resources/converge.yml b/tests/molecule/resources/converge.yml index 3e69e0dc..9d573ece 100644 --- a/tests/molecule/resources/converge.yml +++ b/tests/molecule/resources/converge.yml @@ -3,6 +3,19 @@ hosts: all become: true gather_facts: true + pre_tasks: + - name: Check the major Python version for the OS + tags: python + block: + - name: Check default version + ansible.builtin.include_role: + name: mirsg.infrastructure.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 }}" + roles: - role: mirsg.infrastructure.provision tags: provision diff --git a/tests/molecule/resources/prepare.yml b/tests/molecule/resources/prepare.yml index af92aca0..d0e4b210 100644 --- a/tests/molecule/resources/prepare.yml +++ b/tests/molecule/resources/prepare.yml @@ -17,18 +17,6 @@ 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.infrastructure.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: