Skip to content

Commit

Permalink
Minor changes to bootstrap script and bump default Ansible version
Browse files Browse the repository at this point in the history
The python-virtualenv package no longer exists in RHEL8. This will point
to the proper package for virtualenv. Also bumping the default version
of Ansible for rpc-maas to 2.7.11.

Signed-off-by: Nathan Pawelek <[email protected]>
  • Loading branch information
Nathan Pawelek committed Apr 2, 2020
1 parent 114be33 commit 2ddd442
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions scripts/bootstrap-embedded-ansible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export OPTS=()
export CLONE_DIR="$(dirname $(readlink -f ${BASH_SOURCE[0]}))"
OPTS+=('CLONE_DIR')

export ANSIBLE_VERSION="${ANSIBLE_VERSION:-2.7.5.0}"
export ANSIBLE_VERSION="${ANSIBLE_VERSION:-2.7.11}"
OPTS+=('ANSIBLE_VERSION')

export ANSIBLE_EMBED_HOME="${HOME}/ansible_venv"
Expand All @@ -36,13 +36,17 @@ source /etc/os-release
export ID="$(echo ${ID} | awk -F'-' '{print $1}')"

if [[ ! -e "${ANSIBLE_EMBED_HOME}/bin/ansible" ]]; then
if [ ${ID} = "ubuntu" ]; then
if [ ${ID} = "ubuntu" ]; then
apt-get update
apt-get -y install python-virtualenv
elif [ ${ID} = "opensuse" ] || [ ${ID} = "suse" ]; then
zypper install -y python-virtualenv
elif [ ${ID} = "centos" ] || [ ${ID} = "redhat" ] || [ ${ID} = "rhel" ]; then
yum install -y python-virtualenv
if [ ${VERSION_ID} == "8."* ]; then
yum install -y python3-virtualenv
else
yum install -y python-virtualenv
fi
else
echo "Unknown operating system"
exit 99
Expand Down
2 changes: 1 addition & 1 deletion scripts/set-vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Set the compatible version of ansible for RPC Toolstack projects
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_PATH:-$HOME/magnanimous-turbo-chainsaw-$(date +%Y-%m-%d).log}"
export ANSIBLE_VERSION="${ANSIBLE_VERSION:-2.7.5.0}"
export ANSIBLE_VERSION="${ANSIBLE_VERSION:-2.7.11}"
export ANSIBLE_GATHERING="${ANSIBLE_GATHERING:-smart}"
export ANSIBLE_CACHE_PLUGIN="${ANSIBLE_CACHE_PLUGIN:-jsonfile}"
export ANSIBLE_CACHE_PLUGIN_CONNECTION="${ANSIBLE_CACHE_PLUGIN_CONNECTION:-/tmp/mtc_facts-$(date +%Y-%m-%d)}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ fi

if [[ ! -d "${MTC_WORKING_DIR}" ]]; then
git clone https://github.com/rcbops/magnanimous-turbo-chainsaw "${MTC_WORKING_DIR}"
elif [[ ! -d "${MTC_SCRIPTS_DIR}" ]]; then
else
pushd "${MTC_WORKING_DIR}"
git fetch --all
git reset --hard origin/master
Expand Down

0 comments on commit 2ddd442

Please sign in to comment.