docker-ubuntu1804-ansible
docker-ubuntu1804-ansible copied to clipboard
Add `ansible` user to enable testing of roles with non-`root` user
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: ...
I would also be interessted in such feature as we cannot test playbooks as a normal user (and using become method)
:+1:
@geerlingguy Any opinion on this? This is a needed feature to write complete tests with molecule.
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)