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

Add ansible user to enable testing of roles with non-root user #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

percygrunwald
Copy link
Contributor

Another change that I wanted to check if you'd consider merging.

Adds a non-root sudoer called ansible and ensures that sudo does not require a password to match how these images are set up in cloud providers like AWS/Azure/GCP.

Can be used with molecule/Docker like this:

# molecule/default/playbook.yml
---
- name: Converge
  hosts: all
  vars:
    ansible_user: ansible
  roles:
    - role: ...

@maximumG
Copy link

I would also be interessted in such feature as we cannot test playbooks as a normal user (and using become method)

👍

baztian added a commit to baztian/ansible-vscode that referenced this pull request Feb 8, 2021
@nkakouros
Copy link

@geerlingguy Any opinion on this? This is a needed feature to write complete tests with molecule.

@geerlingguy
Copy link
Owner

I do like this idea; the PR would need a bit of an update to work with the latest version, and I will only merge once I've had time to get it working across my other docker/ansible images (ubuntu 2004, 2204, debian 9/10/11 at least)

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.

4 participants