Giter VIP home page Giter VIP logo

Comments (10)

Nume avatar Nume commented on June 21, 2024 9

Ran into the same issue on a stock ubuntu 18.04 (which doesn't add universe per default).
Solved it by adding

- name: Add universe repository for bionic
  apt_repository: 
    repo: deb http://archive.ubuntu.com/ubuntu bionic universe
    state: present
  when: ansible_distribution_release == 'bionic'

in pre_tasks of my playbook

from ansible-docker.

nickjj avatar nickjj commented on June 21, 2024 1

Hi,

That's interesting. It passes the tests for Ubuntu 18.04 on https://travis-ci.org/nickjj/ansible-docker/jobs/446816674 and I've installed this role a lot of times on DigitalOcean using 18.04.

Also, it looks like gnupg2 exists on https://packages.ubuntu.com/bionic/gnupg2.

Have you ran apt-get update on your host at least once? This should be a part of any Ansible bootstrap strategy which is why this role doesn't run apt-get update on its own.

from ansible-docker.

pinkavaj avatar pinkavaj commented on June 21, 2024

That did the trick, thanks a lot and sorry for bothering!

from ansible-docker.

Zauxst avatar Zauxst commented on June 21, 2024

I'm having the same problem, I am not sure why gnupg2 is not present in the current repolist (even after apt-get update -y)

What I have did before running the play:

  • install the latest Ubuntu18.04 server on 2 virtualbox VMs.
  • install kubeadm, kubectl and kubelet ( like here: kubernetes.io )

If you need anything else from me to help you debug this problem I'll try and provide info.
I'll clone this machine to ensure the current configuration is not lost.

apt-cache search gnupg2; cat /etc/*-release; apt-cache policy
devscripts - scripts to make the life of a Debian Package maintainer easier
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 https://apt.kubernetes.io kubernetes-xenial/main amd64 Packages
     release o=kubernetes-xenial,a=kubernetes-xenial,n=kubernetes-xenial,l=kubernetes-xenial,c=main,b=amd64
     origin apt.kubernetes.io
 500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=main,b=amd64
     origin archive.ubuntu.com
 500 https://download.docker.com/linux/ubuntu bionic/edge amd64 Packages
     release o=Docker,a=bionic,l=Docker CE,c=edge,b=amd64
     origin download.docker.com
 500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     release o=Docker,a=bionic,l=Docker CE,c=stable,b=amd64
     origin download.docker.com
 500 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=main,b=amd64
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=main,b=amd64
     origin archive.ubuntu.com
Pinned packages:

from ansible-docker.

nickjj avatar nickjj commented on June 21, 2024

@Zauxst I think I narrowed down the problem.

If you run cat /etc/apt/sources.list do all of your URLs end with main?

If so, edit that file so the first one ends with main universe and then run sudo apt-get update.

I think the problem is your installation of Ubuntu didn't configure the apt source lists to allow community packages to be installed and gnupg2 and others fall into that category.

Doing that really isn't a responsibility of this role. It should be done when you bootstrap your server or configure apt IMO.

from ansible-docker.

Zauxst avatar Zauxst commented on June 21, 2024

@nickjj yes indeed, adding universe solved the problem. Thanks a lot for taking the time.

I'm not going to go into a philosophical debate about it, this is my 2cent of this topic:
If a role requires a package to finish running, that is not in main (in our case it was Universe) it should ensure the package is ready to be downloaded, or at least mention it in the script requirements.

Besides... Ubuntu=16.04 and 18.04 doesn't require gnupg2 according to the official installation. Only the Debian install does.

before:

cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu bionic main
deb http://archive.ubuntu.com/ubuntu bionic-security main
deb http://archive.ubuntu.com/ubuntu bionic-updates main

after gnupg2 was found.

apt-cache search gnupg2
devscripts - scripts to make the life of a Debian Package maintainer easier
gnupg2 - GNU privacy guard - a free PGP replacement (dummy transitional package)

from ansible-docker.

nickjj avatar nickjj commented on June 21, 2024

Yep, but in this case, adding it for Ubuntu doesn't do any harm and while it's possible to split it up, it drastically complicates the role (both at configuration and implementation levels).

My philosophy is determining whether or not to use universe, backports, etc. is a system level decision that should be configured once with an apt or similar role.

Having this role start to modify apt source lists to make a system level decision as important as that one doesn't seem reasonable IMO.

But, having it as part of the documentation makes sense. It's just most cloud providers have universe enabled by default, so I didn't even think to add that. I only figured it out because I ended up setting up a stock Ubuntu server (which only allows main) recently and ran into the problem first hand.

from ansible-docker.

mjeffin avatar mjeffin commented on June 21, 2024

Hi nick, thanks for sharing the role. It has been quite useful. I also encountered the issue on a newly provisioned aws bionic server and running the apt-update step fixed the issue. will add the it as the first step in all my future ansible playbook.
thanks.

from ansible-docker.

nickjj avatar nickjj commented on June 21, 2024

Hi, yeah it's expected you run an apt-get update when bootstrapping a server. Otherwise you wind up in a situation explained in my previous reply.

from ansible-docker.

nickjj avatar nickjj commented on June 21, 2024

Yep, that's standard. You may want to also consider offloading that task to a designated apt / bootstrap role since it's very much system dependent.

from ansible-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.