mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
for discussion
This commit is contained in:
parent
1308fb8670
commit
5bcd0c9ded
2 changed files with 23 additions and 10 deletions
|
@ -6,3 +6,4 @@
|
||||||
#squash_actions = apk, apt, dnf, homebrew, openbsd_pkg, pacman, pkgng, yum, zypper, package
|
#squash_actions = apk, apt, dnf, homebrew, openbsd_pkg, pacman, pkgng, yum, zypper, package
|
||||||
[defaults]
|
[defaults]
|
||||||
interpreter_python=/usr/local/ansible/bin/python3
|
interpreter_python=/usr/local/ansible/bin/python3
|
||||||
|
collections_path=/usr/local/ansible/collections/ansible_collections/
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
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.18.2]
|
CURR_VER=undefined # Ansible version you have installed, e.g. [core 2.18.2]
|
||||||
GOOD_VER=2.18.2 # Orig for 'yum install [rpm]' & XO laptops (pip install)
|
GOOD_VER=2.18.2 # Orig for 'yum install [rpm]' & XO laptops (pip install)
|
||||||
|
CWD=$(pwd)
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -221,6 +222,15 @@ if [[ $(dpkg --print-architecture) == "i386" ]] && apt-cache show ansible-core >
|
||||||
# 2023-08-10 #3613/#3615/#3617: apt-not-pip kludge for legacy 32-bit i386
|
# 2023-08-10 #3613/#3615/#3617: apt-not-pip kludge for legacy 32-bit i386
|
||||||
# (DEBIAN 12+ ETC) avoids #3547 rust/wheels/cryptography compiling mess!
|
# (DEBIAN 12+ ETC) avoids #3547 rust/wheels/cryptography compiling mess!
|
||||||
$APT_PATH/apt -y install ansible-core # Bookworm ~= ansible-core 2.14.3
|
$APT_PATH/apt -y install ansible-core # Bookworm ~= ansible-core 2.14.3
|
||||||
|
echo -e "\n\nIIAB requires these ~4 Ansible Collections: (we upgrade them here if possible!)\n"
|
||||||
|
ansible-galaxy collection install --force-with-deps \
|
||||||
|
-r /opt/iiab/iiab/collections.yml \
|
||||||
|
-p /usr/share/ansible/collections
|
||||||
|
# 2021-02-24: 'ansible-galaxy collection list' lists those installed. (#2659)
|
||||||
|
# 2020-11-28: The ~3 Ansible Collections used by IIAB (~37MB) once lived here:
|
||||||
|
# /root/.ansible/collections/ansible_collections
|
||||||
|
# But going forward they'll be stored herein: [~24MB for 4 Collections as of 2021-05-19]
|
||||||
|
# /usr/share/ansible/collections/ansible_collections
|
||||||
else
|
else
|
||||||
# 2023-03-22: OS's like Ubuntu 23.04 and Debian 12 (e.g. with Python 3.11+) ask
|
# 2023-03-22: OS's like Ubuntu 23.04 and Debian 12 (e.g. with Python 3.11+) ask
|
||||||
# that virtual environments (venv) be used to safely isolate pip installs:
|
# that virtual environments (venv) be used to safely isolate pip installs:
|
||||||
|
@ -285,21 +295,22 @@ EOF
|
||||||
for bin in ansible*; do
|
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
|
||||||
fi
|
|
||||||
|
|
||||||
# (Re)running collection installs appears safe, with --force-with-deps to force
|
# (Re)running collection installs appears safe, with --force-with-deps to force
|
||||||
# upgrade of collection and dependencies it pulls in. Note Ansible may support
|
# upgrade of collection and dependencies it pulls in. Note Ansible may support
|
||||||
# explicit upgrading of collections (--upgrade / -U flag) in version "2.11"
|
# explicit upgrading of collections (--upgrade / -U flag) in version "2.11"
|
||||||
# with PR ansible/ansible#73336. See also IIAB PRs #2647 #2652 #2653 #2655.
|
# with PR ansible/ansible#73336. See also IIAB PRs #2647 #2652 #2653 #2655.
|
||||||
echo -e "\n\nIIAB requires these ~4 Ansible Collections: (we upgrade them here if possible!)\n"
|
echo "start is $CWD"
|
||||||
ansible-galaxy collection install --force-with-deps \
|
echo "current is $(pwd)"
|
||||||
-r /opt/iiab/iiab/collections.yml \
|
echo -e "\n\nIIAB requires these ~4 Ansible Collections: (we upgrade them here if possible!)\n"
|
||||||
-p /usr/share/ansible/collections
|
cp $CWD/collections.yml /usr/local/ansible/
|
||||||
# 2021-02-24: 'ansible-galaxy collection list' lists those installed. (#2659)
|
cd /usr/local/ansible/
|
||||||
# 2020-11-28: The ~3 Ansible Collections used by IIAB (~37MB) once lived here:
|
. bin/activate
|
||||||
# /root/.ansible/collections/ansible_collections
|
bin/ansible-galaxy collection install --force-with-deps -r collections.yml -p collections
|
||||||
# But going forward they'll be stored herein: [~24MB for 4 Collections as of 2021-05-19]
|
deactivate
|
||||||
# /usr/share/ansible/collections/ansible_collections
|
fi
|
||||||
|
# But going forward they'll be stored herein: [~24MB for 4 Collections as of 2025-02-18]
|
||||||
|
# /usr/local/ansible/collections/ansible_collections
|
||||||
|
|
||||||
# 2021-04-19: No longer needed, per PR #2743 testing
|
# 2021-04-19: No longer needed, per PR #2743 testing
|
||||||
#echo -e "\n\nCreating/verifying directory /etc/ansible & installing /etc/ansible/hosts\n"
|
#echo -e "\n\nCreating/verifying directory /etc/ansible & installing /etc/ansible/hosts\n"
|
||||||
|
@ -309,6 +320,7 @@ ansible-galaxy collection install --force-with-deps \
|
||||||
echo -e "\n\nSUCCESS! PLEASE VERIFY ANSIBLE WITH COMMANDS LIKE:\n"
|
echo -e "\n\nSUCCESS! PLEASE VERIFY ANSIBLE WITH COMMANDS LIKE:\n"
|
||||||
echo -e " ansible --version"
|
echo -e " ansible --version"
|
||||||
echo -e " /usr/local/ansible/bin/pip3 show ansible-core"
|
echo -e " /usr/local/ansible/bin/pip3 show ansible-core"
|
||||||
|
echo -e " /usr/local/ansible/bin/ansible-galaxy collection list\n\n"
|
||||||
echo -e ' apt -a list "ansible*"'
|
echo -e ' apt -a list "ansible*"'
|
||||||
echo -e " ansible-galaxy collection list\n\n"
|
echo -e " ansible-galaxy collection list\n\n"
|
||||||
#echo -e "WARNING: Start a new Linux shell, if it changed from /usr/bin to /usr/local/bin\n\n"
|
#echo -e "WARNING: Start a new Linux shell, if it changed from /usr/bin to /usr/local/bin\n\n"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue