Comments (10)
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.
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.
That did the trick, thanks a lot and sorry for bothering!
from ansible-docker.
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.
@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.
@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.
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.
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.
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.
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)
- Support for docker.io package (in addition to ce and ee) HOT 4
- Failed : Install Docker's dependencies HOT 9
- Package dependency error for Docker installation on clean Ubuntu 18.04 HOT 11
- Ubuntu 20.04 ImportError: No module named pkg_resources HOT 10
- Avoid docker login issue with X11 HOT 11
- Expected behavior for DockerHub private repositories login options? HOT 19
- Failed to import the required Python library HOT 10
- Update apt cache before installing packages HOT 1
- Add way to add additional packages to install HOT 3
- Versioning pinning not working HOT 5
- Install Python packages: Could not get output from /usr/local/bin/virtualenv --help HOT 16
- Hi; Please consider suppressing credentials output in: Manage Docker registry login credentials HOT 8
- Upgrade edge case HOT 9
- I'm thinking about no longer setting up a virtualenv, pip installing docker / docker compose and switching the docker_login module to a shell script HOT 2
- docker not installed into /usr/local/bin HOT 4
- Unable to find pip in the virtualenv HOT 8
- Error in new v2.2.0 version when using ansible 2.9.14 HOT 3
- Docker Compose V1 causes the Install Python packages step to crash HOT 3
- Error with pip on basic usage HOT 2
- Task exception at: Install Python packages HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-docker.