Search code examples
ansiblerhelrhel7

What sudo privileges needed to run docker_container with become:yes


What sudo privileges needed to run docker_container with become:yes..?

I don't want to use wild card sudo NOPASSWD to ansible user but wanted to restrict to the specific commands. Any thoughts..?

I tried with NOPASSWD: /bin/docker* but didin't worked. NOPASSWD: ALL is a working solution.


Solution

  • you can add your user to the docker group that should do. Change the /etc/group file.

    # cat /etc/group
    docker:x:991:<username>