Giter VIP home page Giter VIP logo

Comments (9)

TheSaM07 avatar TheSaM07 commented on July 24, 2024 2

Resolved : add to change docker.yml and add the following line :


docker.yml

  • name: Example
    hosts: "all"
    become: true
    become_method: sudo

    roles:

    • role: "nickjj.docker"
      vars:
      docker__users: ["administrator"]
      tags: ["docker"]

from ansible-docker.

nickjj avatar nickjj commented on July 24, 2024

Hi,

That typically happens when something bad happens with apt (package installation failure, etc.).

I'm not sure what you did exactly but I see you closed this issue. What did you end up doing?

from ansible-docker.

TheSaM07 avatar TheSaM07 commented on July 24, 2024

Hello, thanks for your reply.
As I do not know what's wrong with the vm, but I have done many things with apt, nothing successful. I was able to install the dependencies manually with sudo apt, but now I have this error at Add Docker's public GPG key : FAILED! => {"changed": false, "cmd": "/usr/bin/apt-key add -", "msg": "Warning: apt-key output should not be parsed

They should be both the same as nothing was installed on it but the OS, that's why I've asked the team for a new install of both, I've closed the issue for now and I will try to redeploy again when they're up, because as you've said that's nothing related to the role.
Regards

from ansible-docker.

TheSaM07 avatar TheSaM07 commented on July 24, 2024

With a fresh install of ubuntu I still have the problem on both.
Any ideas ?

image

from ansible-docker.

nickjj avatar nickjj commented on July 24, 2024

What version of Ubuntu are you using?

from ansible-docker.

TheSaM07 avatar TheSaM07 commented on July 24, 2024

image

from ansible-docker.

nickjj avatar nickjj commented on July 24, 2024

Interesting, I've never seen that error and I've installed this role dozens of times on Ubuntu 20.04.

What version of Ansible are you using?

I also never had to set become_method: sudo because sudo is the default. Maybe you overrode Ansible's defaults in your ansible.cfg file? You can see it's the default based on https://github.com/ansible/ansible/blob/4b673484f06fa9464601c27706c8a43d1e11bbcb/examples/ansible.cfg#L341.

from ansible-docker.

TheSaM07 avatar TheSaM07 commented on July 24, 2024

ansible --version returns :
image

I did not change the ansible.cfg
The thing is that I use the devops azure as repository for the yml files and I run ansible playbooks from there with a release pipeline.

Well, I had many issues but you're right, I have removed become_method and it's still working. I was using become_user = administrator, it was working on only one node before the new install of the vms.
Right now, it's working and I'm new with ansible so I do make mistakes for sure ;)
Thanks for your work.

from ansible-docker.

nickjj avatar nickjj commented on July 24, 2024

Ah that makes sense then. When in doubt check the readme's example playbook. It has everything you need at the playbook level to make things work, which in this case is setting become: true because root access is needed by this role to apt install packages and create certain config files in various /etc paths, etc..

Often times you'll create some type of admin user and run Ansible as that user. Setting become: true makes sure tasks are run with sudo by default, otherwise you would run into permission issues for that admin user when encountering tasks that require root.

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.