From 645262736b7d87c74f5508357ac9ed15ef445a1a Mon Sep 17 00:00:00 2001 From: robertsweetman Date: Fri, 5 Apr 2024 10:46:11 +0100 Subject: [PATCH] fix issue with rhel 6 requirements installing incompatible crypto lib --- .../rhel_6_10/stig_rhel6_ansible.yml.tftpl | 2 +- commonimages/base/rhel_6_10/locals.tf | 2 +- commonimages/base/rhel_6_10/terraform.tfvars | 2 +- commonimages/components/templates/ansible.yml | 14 +++++++++++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/commonimages/base/components/rhel_6_10/stig_rhel6_ansible.yml.tftpl b/commonimages/base/components/rhel_6_10/stig_rhel6_ansible.yml.tftpl index 93ee9996..d6994019 100644 --- a/commonimages/base/components/rhel_6_10/stig_rhel6_ansible.yml.tftpl +++ b/commonimages/base/components/rhel_6_10/stig_rhel6_ansible.yml.tftpl @@ -65,7 +65,7 @@ phases: # install requirements in virtual env cd $ansible_dir/$repo/ansible - $python -m pip install -r requirements.txt + $python -m pip install -r requirements.txt -c constraints.rhel6.txt ansible-galaxy role install -r requirements.rhel6.yml ansible-galaxy collection install -r requirements.rhel6.yml --force diff --git a/commonimages/base/rhel_6_10/locals.tf b/commonimages/base/rhel_6_10/locals.tf index 646c0eac..cb3a80a9 100644 --- a/commonimages/base/rhel_6_10/locals.tf +++ b/commonimages/base/rhel_6_10/locals.tf @@ -12,7 +12,7 @@ locals { parameters = [] }, { name = "ansible" - version = "0.0.5" # set to last known working ansible component version + version = "0.0.12" # set to last known working ansible component version parameters = [{ name = "Ami" value = join("_", [var.ami_name_prefix, var.ami_base_name]) diff --git a/commonimages/base/rhel_6_10/terraform.tfvars b/commonimages/base/rhel_6_10/terraform.tfvars index 26798b00..24aac570 100644 --- a/commonimages/base/rhel_6_10/terraform.tfvars +++ b/commonimages/base/rhel_6_10/terraform.tfvars @@ -2,7 +2,7 @@ # BRANCH_NAME = # GH_ACTOR_NAME = -configuration_version = "0.2.9" +configuration_version = "0.3.0" description = "shared rhel 6.10 base image" ami_base_name = "rhel_6_10" diff --git a/commonimages/components/templates/ansible.yml b/commonimages/components/templates/ansible.yml index 244bc787..0e6a60d3 100644 --- a/commonimages/components/templates/ansible.yml +++ b/commonimages/components/templates/ansible.yml @@ -5,7 +5,7 @@ schemaVersion: 1.0 parameters: - Version: type: string - default: 0.0.11 + default: 0.0.12 description: "Component version, increment if you make changes." - Platform: type: string @@ -83,7 +83,11 @@ phases: # install python dependencies outside of virtual env so ansible # can be executed remotely cd $ansible_dir/$repo/$ansible_repo_dir - $python -m pip install -r requirements.txt + if [[ "$python" =~ 3.6]]; then + $python -m pip install -r requirements.txt -c constraints.rhel6.txt + else + $python -m pip install -r requirements.txt + fi # activate virtual environment mkdir $ansible_dir/python-venv && cd "$_" @@ -101,7 +105,11 @@ phases: # install requirements in virtual env cd $ansible_dir/$repo/$ansible_repo_dir - $python -m pip install -r requirements.txt + if [[ "$python" =~ 3.6]]; then + $python -m pip install -r requirements.txt -c constraints.rhel6.txt + else + $python -m pip install -r requirements.txt + fi ansible-galaxy role install -r requirements.yml ansible-galaxy collection install -r requirements.yml --force