1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

scripts/ansible: 2.14.5, cryptography==40.0.1 on armhf, for-loop fix

This commit is contained in:
root 2023-04-24 13:07:24 -04:00
parent 544a1f2959
commit 78c22d3df5

View file

@ -7,8 +7,8 @@
# https://github.com/iiab/iiab/wiki/Technical-Contributors-Guide#female_detective-understanding-ansible # https://github.com/iiab/iiab/wiki/Technical-Contributors-Guide#female_detective-understanding-ansible
APT_PATH=/usr/bin # Avoids problematic /usr/local/bin/apt on Linux Mint APT_PATH=/usr/bin # Avoids problematic /usr/local/bin/apt on Linux Mint
CURR_VER=undefined # Ansible version you have installed, e.g. [core 2.14.4] CURR_VER=undefined # Ansible version you have installed, e.g. [core 2.14.5]
GOOD_VER=2.14.4 # Orig for 'yum install [rpm]' & XO laptops (pip install) GOOD_VER=2.14.5 # Orig for 'yum install [rpm]' & XO laptops (pip install)
# 2021-06-22: The apt approach (with PPA source in /etc/apt/sources.list.d/ and # 2021-06-22: The apt approach (with PPA source in /etc/apt/sources.list.d/ and
# .gpg key etc) are commented out with ### below. Associated guidance/comments # .gpg key etc) are commented out with ### below. Associated guidance/comments
@ -205,14 +205,21 @@ $APT_PATH/apt -y install python3-venv
echo -e "\nCreate virtual environment for Ansible" echo -e "\nCreate virtual environment for Ansible"
python3 -m venv /usr/local/ansible python3 -m venv /usr/local/ansible
# Same detection as local_facts.fact https://github.com/iiab/iiab/issues/3547 # "if not ubuntu" (covers RasPiOC & Debian) would also work, but is overbroad:
if [ -f /etc/rpi-issue ] && [ "$(dpkg --print-architecture)" = armhfp ]; then # if ! grep -qi ubuntu /etc/os-release; then
#
# if [ -f /etc/rpi-issue ] && [[ $(dpkg --print-architecture) == armhf ]]; then
#
# 2023-03-24 #3547 similar to #3459 re: cryptography, piwheels, rust.
# Release problems chart: https://www.piwheels.org/project/cryptography/
if [[ $(dpkg --print-architecture) == armhf ]]; then # 32-bit ARM
/usr/local/ansible/bin/python3 -m pip install cryptography==40.0.1 /usr/local/ansible/bin/python3 -m pip install cryptography==40.0.1
fi fi
/usr/local/ansible/bin/python3 -m pip install --upgrade ansible-core /usr/local/ansible/bin/python3 -m pip install --upgrade ansible-core
echo -e "\nCreate symlinks /usr/local/bin/ansible* -> /usr/local/ansible/bin/ansible*" echo -e "\nCreate symlinks /usr/local/bin/ansible* -> /usr/local/ansible/bin/ansible*"
for bin in /usr/local/ansible/bin/ansible*; do cd /usr/local/ansible/bin
for bin in ansible*; do
ln -sf /usr/local/ansible/bin/"$bin" /usr/local/bin/"$bin" ln -sf /usr/local/ansible/bin/"$bin" /usr/local/bin/"$bin"
done done