Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

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

Open
percygrunwald wants to merge 1 commit intogeerlingguy:masterfrom
percygrunwald:add_ansible_user
Open

Add ansible user to enable testing of roles with non-root user#11
percygrunwald wants to merge 1 commit intogeerlingguy:masterfrom
percygrunwald:add_ansible_user

Conversation

@percygrunwald
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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

@geerlingguy
Copy link
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants