LemmyNet / lemmy-ansible

A docker deploy for ansible
GNU Affero General Public License v3.0
248 stars 92 forks source link

Ansible installation: error using --ask-become-pass #22

Closed calbasi closed 2 years ago

calbasi commented 2 years ago

Hi, when using:

ansible-playbook -i inventory/hosts lemmy.yml --ask-become-pass

I get an error (the typical error on Debian when a user without privileges try to do an apt update:

TASK [install python for Ansible] **** fatal: [joan@collapse.cat]: FAILED! => {"changed": true, "msg": "non-zero return code", "rc": 100, "stderr": "Shared connection to collapse.cat closed.\r\n", "stderr_lines": ["Shared connection to collapse.cat closed."], "stdout": "\rS'està llegint la llista de paquets… 0%\r\rS'està llegint la llista de paquets… 100%\r\rS'està llegint la llista de paquets… Fet \r\r\n\u001b[1;31mE: \u001b[0mNo s'ha pogut obrir el fitxer de blocat /var/lib/apt/lists/lock - open (13: S’ha denegat el permís)\u001b[0m\r\n\u001b[1;31mE: \u001b[0mNo es pot blocar el directori /var/lib/apt/lists/\u001b[0m\r\n\u001b[1;33mW: \u001b[0mHi ha hagut un problema en desenllaçar el fitxer /var/cache/apt/pkgcache.bin - RemoveCaches (13: S’ha denegat el permís)\u001b[0m\r\n\u001b[1;33mW: \u001b[0mHi ha hagut un problema en desenllaçar el fitxer /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: S’ha denegat el permís)\u001b[0m\r\n", "stdout_lines": ["", "S'està llegint la llista de paquets… 0%", "", "S'està llegint la llista de paquets… 100%", "", "S'està llegint la llista de paquets… Fet ", "", "\u001b[1;31mE: \u001b[0mNo s'ha pogut obrir el fitxer de blocat /var/lib/apt/lists/lock - open (13: S’ha denegat el permís)\u001b[0m", "\u001b[1;31mE: \u001b[0mNo es pot blocar el directori /var/lib/apt/lists/\u001b[0m", "\u001b[1;33mW: \u001b[0mHi ha hagut un problema en desenllaçar el fitxer /var/cache/apt/pkgcache.bin - RemoveCaches (13: S’ha denegat el permís)\u001b[0m", "\u001b[1;33mW: \u001b[0mHi ha hagut un problema en desenllaçar el fitxer /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: S’ha denegat el permís)\u001b[0m"]}

But the error is gone when using:

ansible-playbook -i inventory/hosts lemmy.yml --become -K

dessalines commented 2 years ago

You mean we just need to change the README, if the second command works?

calbasi commented 2 years ago

Yes. I'm not an advanced Ansible user, and I don't know what's the difference between both commands and why one runs and the other sucks.

Nutomic commented 2 years ago

Did you change anything in ansible.cfg? It sets become = True, so there should be no need to set it on command line.

calbasi commented 2 years ago

I didn't change anything in change.cfg. I just did a "git pull" and fired ansible command.

Nutomic commented 2 years ago

Weird. Maybe setting the command line parameter causes the config to be ignored or something like that.

calbasi commented 2 years ago

Hi @Nutomic why have you dischard "-K" from my suggested command?

dessalines commented 2 years ago

K is the same as ask become pass