Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RedHat 8.10 makes the bastion ansible-core installation to fail #283

Closed
sdelabarre opened this issue May 24, 2024 · 6 comments · Fixed by #284
Closed

RedHat 8.10 makes the bastion ansible-core installation to fail #283

sdelabarre opened this issue May 24, 2024 · 6 comments · Fixed by #284

Comments

@sdelabarre
Copy link
Contributor

sdelabarre commented May 24, 2024

8.10 = 8.1 which is < 8.5 :

# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.10 (Ootpa)

# if [[ $(cat /etc/redhat-release | sed 's/[^0-9.]*//g') > 8.5 ]];
then echo "Yes > 8.5"; else echo "NO <= 8.5";
fi


Run :
NO <= 8.5

We need to find a better way...

This is in modules/1_bastion/bastion.tf

Cheers

@yussufsh
Copy link
Contributor

/cc @Prajyot-Parab @cs-zhang

@sdelabarre
Copy link
Contributor Author

We may use the redhat-release rpm instead, and use -gt instead of > .

I tested the following :

cat test.sh

if [[ $( rpm -q redhat-release | awk -F'-' '{print $3}' | sed -e 's/\.//g' ) -gt 85 ]]
     then echo "Yes > 8.5"
     else echo "NO <= 8.5"
fi

if [[ $(rpm --query notanrpm| awk -F'-' '{print $3}' | sed -e 's/\.//g' ) -gt 85 ]]
     then echo "Yes > 8.5"
     else echo "NO <= 8.5"
fi


if [[ $(echo "test-test-8.11" | awk -F'-' '{print $3}' | sed -e 's/\.//g' ) -gt 85 ]]
     then echo "Yes > 8.5"
     else echo "NO <= 8.5"
fi


if [[ $(echo "" | awk -F'-' '{print $3}' | sed -e 's/\.//g' ) -gt 85 ]]
     then echo "Yes > 8.5"
     else echo "NO <= 8.5"
fi

if [[ $(echo "test-test-8.5" | awk -F'-' '{print $3}' | sed -e 's/\.//g' ) -gt 85 ]]
     then echo "Yes > 8.5"
     else echo "NO <= 8.5"
fi

./test.sh

Yes > 8.5
NO <= 8.5
Yes > 8.5
NO <= 8.5
NO <= 8.5

@Prajyot-Parab
Copy link
Collaborator

@sydefree 8.10 = 8.1 which is < 8.5 this does not seem correct to me (do correct me if I missed something here).
ref - https://access.redhat.com/articles/3078

@sdelabarre
Copy link
Contributor Author

I do agree @Prajyot-Parab in terms on versioning . BUT, in a decimal sh test it does.

@Prajyot-Parab
Copy link
Collaborator

I do agree @Prajyot-Parab in terms on versioning . BUT, in a decimal sh test it does.

can you point me to that sh.

@sdelabarre
Copy link
Contributor Author

Hello @Prajyot-Parab
^^

This is in modules/1_bastion/bastion.tf starting line 241

# Additional repo for installing ansible package
if ( [[ -z "${var.rhel_subscription_username}" ]] || [[ "${var.rhel_subscription_username}" == "<subscription-id>" ]] ) && [[ -z "${var.rhel_subscription_org}" ]]; then
  sudo yum install -y epel-release
  sudo yum install -y ansible
elif [[ $(cat /etc/redhat-release | sed 's/[^0-9.]*//g') > 8.5 ]]; then
  sudo yum install -y ansible-core
else
  sudo subscription-manager repos --enable ${var.ansible_repo_name}
  sudo yum install -y ansible-core
fi
EOF
    ]
  }
}

yussufsh added a commit to yussufsh/ocp4-upi-powervm that referenced this issue Jul 12, 2024
Fixes ocp-power-automation#283

Signed-off-by: Yussuf Shaikh <yussuf.shaikh1@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants