Skip to content

Commit

Permalink
Merge pull request #748 from ministryofjustice/onr/DSOS-2681/fix-rhel…
Browse files Browse the repository at this point in the history
…-6-ami-base

fix issue with rhel 6 cryptography dependency from requirements.txt
  • Loading branch information
robertsweetman authored Apr 8, 2024
2 parents f2ccbaf + 7db0fb3 commit 850b1d1
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
1 change: 1 addition & 0 deletions ansible/constraints.rhel6.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cryptography==2.3
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ phases:
# install python dependencies outside of virtual env so ansible
# can be executed remotely
cd $ansible_dir/$repo/ansible
$python -m pip install -r requirements.txt
$python -m pip install -r requirements.txt -c constraints.rhel6.txt

# activate virtual environment
mkdir $ansible_dir/python-venv && cd "$_"
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion commonimages/base/rhel_6_10/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ locals {
parameters = []
}, {
name = "ansible"
version = "0.0.5" # set to last known working ansible component version
version = "0.0.14" # set to last known working ansible component version
parameters = [{
name = "Ami"
value = join("_", [var.ami_name_prefix, var.ami_base_name])
Expand Down
2 changes: 1 addition & 1 deletion commonimages/base/rhel_6_10/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BRANCH_NAME =
# GH_ACTOR_NAME =

configuration_version = "0.2.8"
configuration_version = "0.3.3"
description = "shared rhel 6.10 base image"

ami_base_name = "rhel_6_10"
Expand Down
6 changes: 1 addition & 5 deletions commonimages/base/shared.auto.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ image_pipeline = {
accounts_to_distribute_ami_by_branch = {
# push to main branch
main = [
"core-shared-services-production",
"oasys-national-reporting-development",
"oasys-national-reporting-preproduction",
"oasys-national-reporting-production",
"oasys-national-reporting-test"
"core-shared-services-production"
]

default = [
Expand Down
20 changes: 15 additions & 5 deletions commonimages/components/templates/ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ schemaVersion: 1.0
parameters:
- Version:
type: string
default: 0.0.11
default: 0.0.14
description: "Component version, increment if you make changes."
- Platform:
type: string
Expand Down Expand Up @@ -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 "$_"
Expand All @@ -101,9 +105,15 @@ phases:
# install requirements in virtual env
cd $ansible_dir/$repo/$ansible_repo_dir
$python -m pip install -r requirements.txt
ansible-galaxy role install -r requirements.yml
ansible-galaxy collection install -r requirements.yml --force
if [[ "$python" =~ 3.6 ]]; then
$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
else
$python -m pip install -r requirements.txt
ansible-galaxy role install -r requirements.yml
ansible-galaxy collection install -r requirements.yml --force
fi
# run ansible (note comma after localhost is deliberate)
ansible-playbook site.yml \
Expand Down

0 comments on commit 850b1d1

Please sign in to comment.