1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00

Merge pull request #2750 from holta/gpg-key

scripts/ansible: apt-key command is going away, so load .gpg key from repo
This commit is contained in:
A Holt 2021-04-27 14:15:26 -04:00 committed by GitHub
commit 8026de3acf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 8 deletions

View file

@ -92,11 +92,19 @@ if [ ! -f /etc/debian_version ]; then # e.g. RaspiOS, Ubuntu, Mint & Debian
exit 1
fi
echo -e "\napt update; install dirmngr; PPA to /etc/apt/sources.list.d/iiab-ansible.list\n"
$APT_PATH/apt update
$APT_PATH/apt -y install dirmngr
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu $CODENAME main" \
# 2021-04-26: JV & @holta WIP. The apt-key command is going away, and the past
# practice of putting keys in /etc/apt/trusted.gpg.d is considered insecure:
# https://www.linuxuprising.com/2021/01/apt-key-is-deprecated-how-to-add.html
# https://askubuntu.com/questions/1286545/what-commands-exactly-should-replace-the-deprecated-apt-key/1307181#1307181
# So we put .gpg key in repo iiab/iiab, also for reliable installs/containers.
#echo -e "\napt update; install dirmngr; PPA to /etc/apt/sources.list.d/iiab-ansible.list\n"
#$APT_PATH/apt update
#$APT_PATH/apt -y install dirmngr
#echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu $CODENAME main" \
echo "deb [signed-by=/usr/share/keyrings/iiab-ansible-keyring.gpg] http://ppa.launchpad.net/ansible/ansible/ubuntu $CODENAME main" \
> /etc/apt/sources.list.d/iiab-ansible.list
# In future we might instead consider 'add-apt-repository ppa:ansible/ansible'
# or 'apt-add-repository ppa:ansible/bionic/ansible' etc, e.g. for streamlined
# removal using 'apt-add-repository -r' -- however that currently requires
@ -108,11 +116,15 @@ echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu $CODENAME main" \
# problem). This workaround installs 2.9.6-1ppa~disco onto RaspiOS, from
# https://launchpad.net/~ansible/+archive/ubuntu/ansible
#echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu disco main" \
# > /etc/apt/sources.list.d/iiab-ansible.list
# > /etc/apt/sources.list.d/iiab-ansible.list
echo -e '\nIF YOU FACE ERROR "signatures couldn'"'"'t be verified because the public key is not available" THEN REPEATEDLY RE-RUN "sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 93C4A3FD7BB9C367"\n'
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 93C4A3FD7BB9C367
echo -e 'PPA source "deb http://ppa.launchpad.net/ansible/ansible/ubuntu '$CODENAME' main"'
# 2021-04-26: JV & @holta WIP: (see above)
#echo -e '\nIF YOU FACE ERROR "signatures couldn'"'"'t be verified because the public key is not available" THEN REPEATEDLY RE-RUN "sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 93C4A3FD7BB9C367"\n'
#apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 93C4A3FD7BB9C367
cp /opt/iiab/iiab/scripts/iiab-ansible-keyring.gpg /usr/share/keyrings/iiab-ansible-keyring.gpg
#chmod 644 /usr/share/keyrings/iiab-ansible-keyring.gpg
echo -e 'PPA source "deb [signed-by=/usr/share/keyrings/iiab-ansible-keyring.gpg] http://ppa.launchpad.net/ansible/ansible/ubuntu '$CODENAME' main"'
echo -e "successfully saved to /etc/apt/sources.list.d/iiab-ansible.list\n"
echo -e "IF *OTHER* ANSIBLE SOURCES APPEAR BELOW, PLEASE MANUALLY REMOVE THEM TO"
echo -e 'ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n'

Binary file not shown.