Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added gpg missing dependency in nginx role #430

Merged
merged 1 commit into from
Sep 28, 2020

Conversation

vjrj
Copy link
Collaborator

@vjrj vjrj commented Sep 28, 2020

Both in ubuntu 18.04 and 20.04 I get an error:

fatal: [ala-install-test-1]: FAILED! => {"changed": false, "msg": "Failed to find required executable gpg in paths: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"}

during task " Add PPA key for Nginx repository".

I added gpg for these base ubuntu images that does not have gpg preinstalled.

Partially mentioned in #372.

@djtfmartin djtfmartin merged commit 3f2f9b8 into AtlasOfLivingAustralia:master Sep 28, 2020
@Rita-C
Copy link
Contributor

Rita-C commented Oct 2, 2020

@vjrj , I encountered the following error when deploying specieslists-test, could it be related to this change?

TASK [nginx : Add gpg dep for nginx repo] ********************************************************************************************************************************************************
fatal: [nectar-lists-test.ala.org.au]: FAILED! => {"changed": false, "msg": "No package matching 'gpg' is available"}

@ansell
Copy link
Contributor

ansell commented Oct 2, 2020

@vjrj I am going to revert this Pull Request as it needs more testing to not break installs for other Ubuntu images that don't have that issue. The gpg package should be pulled in as part of the base Ubuntu image for all cases through the apt package which installs apt-key, but it isn't clear why it isn't there in the case you describe:

# apt show apt
Package: apt
Version: 1.2.32ubuntu0.1
Priority: important
Section: admin
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: APT Development Team <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 3,541 kB
Depends: libapt-pkg5.0 (>= 1.2.32ubuntu0.1), libc6 (>= 2.15), libgcc1 (>= 1:3.0), libstdc++6 (>= 5.2), init-system-helpers (>= 1.18~), ubuntu-keyring, gpgv | gpgv2, gnupg | gnupg2, adduser
Suggests: aptitude | synaptic | wajig, dpkg-dev (>= 1.17.2), apt-doc, python-apt
Breaks: apt-utils (<< 1.1.3), manpages-it (<< 2.80-4~), manpages-pl (<< 20060617-3~), openjdk-6-jdk (<< 6b24-1.11-0ubuntu1~), sun-java5-jdk (>> 0), sun-java6-jdk (>> 0)
Replaces: bash-completion (<< 1:2.1-4.2+fakesync1), manpages-it (<< 2.80-4~), manpages-pl (<< 20060617-3~), openjdk-6-jdk (<< 6b24-1.11-0ubuntu1~), sun-java5-jdk (>> 0), sun-java6-jdk (>> 0)
Task: minimal
Build-Essential: yes
Supported: 5y
Download-Size: 1,087 kB
APT-Manual-Installed: yes
APT-Sources: http://au.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
Description: commandline package manager
 This package provides commandline tools for searching and
 managing as well as querying information about packages
 as a low-level access to all features of the libapt-pkg library.
 .
 These include:
  * apt-get for retrieval of packages and information about them
    from authenticated sources and for installation, upgrade and
    removal of packages together with their dependencies
  * apt-cache for querying available information about installed
    as well as installable packages
  * apt-cdrom to use removable media as a source for packages
  * apt-config as an interface to the configuration settings
  * apt-key as an interface to manage authentication keys

@vjrj
Copy link
Collaborator Author

vjrj commented Oct 2, 2020

Which version of ubuntu are you using? Without gpg (or similar) the nginx role fails for me in a fresh 18.04 ubuntu server:

TASK [nginx : Add PPA key for Nginx repository] ********************************
Friday 02 October 2020  07:45:28 +0200 (0:00:00.067)       0:01:17.191 ******** 
fatal: [ala-install-test-1]: FAILED! => {"changed": false, "msg": "Failed to find required executable gpg in paths: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"}

I also tested the PR on 20.04, and gpg is present there:

$ dpkg -l gpg
(...)
ii  gpg            2.2.19-3ubuntu2 amd64        GNU Privacy Guard -- minimalist public key operations

It seems that the issue it's relate to the way apt keys are added, see:
ansible/ansible#55590
specially this comment:
ansible/ansible#55590 (comment)
where they mention that apt-key is deprecated since three years ago.

In:
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_key_module.html
only mentions "The below requirements are needed on the host that executes this module. gpg"

gpg package is present in bionic and focal:
https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=gpg
so I don't understand why is falling you.

@vjrj
Copy link
Collaborator Author

vjrj commented Oct 2, 2020

It sounds like this nectar-lists-test.ala.org.au is ubuntu 16.04. I've just tested:

E: Package 'gpg' has no installation candidate    

vjrj added a commit to vjrj/ala-install that referenced this pull request Oct 2, 2020
@ansell
Copy link
Contributor

ansell commented Oct 5, 2020

Thanks for tracking the issue down.

I have opened a separate issue for replacing our use of apt-key with direct insertion of the keys into the file system #438

@Rita-C
Copy link
Contributor

Rita-C commented Oct 6, 2020

Thanks for resolving this issue, deploying to specieslists-test works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants