Closed kentahikaru closed 3 years ago
I actually have a separate dedicated project for K8s on Pi, https://github.com/geerlingguy/raspberry-pi-dramble — but the error you're hitting above is due to not using sudo
/ become
to run the apt operation. You need to make sure to add something like become: yes
in your play.
Hello Jeff, thanks for reply. I don't think so. I'm using main.yml from your example and it starts with:
---
- hosts: kube
become: true
What is interesting is that it's failing only on one node and other 2 are running fine.
Thanks. I will check that project too.
So in inventory file i had 2 hosts with same IP.
Ah, well that would also cause interesting issues :)
Hello Jeff, can i ask you for a help ? (If this is not a correct channel please redirect me)
I'm trying to build kubernetes cluster on raspberry pis. As a first step i have managed to do it by following instruction and making simple bash script to do it. It works on vagrant and RPis.
However, i'd like to do it using ansible. Hense i read your books and came to cluster-local-vms example.
That example, as i undestand, is moreless following instructions from docker and kubernetes about how to install them. .. + security.
So i decided to use it as start point ... so i copied almost all of it to my test project (except deployment part, i just want to build cluster as first step and build from that)
However, i stumbled upon problem. When i run "vagrant up" in example's folder it works fine. When i run it in my project, i'm getting following error:
TASK [geerlingguy.security : Install fail2ban (Debian).] *********************** fatal: [kube2]: FAILED! => {"cache_update_time": 1604516116, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\" install 'fail2ban'' failed: E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)\nE: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?\n", "rc": 100, "stderr": "E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)\nE: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?\n", "stderr_lines": ["E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)", "E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?"], "stdout": "", "stdout_lines": []} changed: [kube3] changed: [kube1]
I checked all files and my copied version is practically the same as your example. I don't understand why is it failing. Could you please point me to the right direction ? Thank you.