Skip to content
Snippets Groups Projects
Verified Commit 93b4621c authored by Chris Croome's avatar Chris Croome
Browse files

only install community.general when version is < 7

parent 584ff1a1
No related branches found
No related tags found
No related merge requests found
Pipeline #35561 passed
......@@ -182,8 +182,15 @@ which jc && \
# https://packages.ubuntu.com/jammy/jc
jc --version || jc -h
# Install community.general 7.5.9
/usr/bin/ansible-galaxy collection install "community.general:==7.5.9" || exit
# Get the first digit of the installed version of community.general
comgen_installed=$(/usr/bin/ansible-galaxy collection list | grep community.general | sort -n | tail -n1 | awk '{ print $2 }' | sed 's/[.][0-9][.][0-9]$//')
if [[ "${comgen_installed}" -lt 7 ]];
then
# Install community.general 7.5.9
/usr/bin/ansible-galaxy collection install "community.general:==7.5.9" || exit
else
echo "The version of community.general installed appears to be greater than 7.5.9, so skipping the comgen install"
fi
# Install the ansible roles
/usr/bin/ansible-galaxy install -r requirements.yml --force || exit
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment