Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support ansible by unprivileged user #200

Closed
wants to merge 1 commit into from

Conversation

genofire
Copy link

@genofire genofire commented May 6, 2020

by using become: yes

@geerlingguy
Copy link
Owner

Because almost all of this role requires root/become, I recommend setting it on the playbook level, or adding become: yes alongside the role, e.g.:

  roles:
    - role: geerlingguy.docker
      become: yes

Thanks!

@geerlingguy geerlingguy closed this May 6, 2020
@Sleuth56
Copy link

Putting this here for anyone like myself that needed to do this as an ansible task instead of a role declaration.
The below ansible code will run the geerlingguy.docker role as root. Assuming that you have not changed the become user ansible variable. become_user: will allow you to change the user. Put that under the become: yes line.
Reference: Ansible include_role docs

- name: Install docker
  ansible.builtin.include_role:
    name: geerlingguy.docker
    apply:
      become: yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants