Add tests for container_user connection attribute
Add a test to ensure container_user executes as the correct user inside the container. Change-Id: I0f8443ee4681af38fc09135668b12f852f2dcb31 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
1449f5ec01
commit
37f1df3a33
|
@ -67,3 +67,19 @@
|
|||
action:
|
||||
module: ping
|
||||
delegate_to: "{{ groups['all_containers'][0] }}"
|
||||
|
||||
- name: Test container_user attribute
|
||||
hosts: container1
|
||||
tasks:
|
||||
- name: Ensure container alt user
|
||||
user:
|
||||
name: testing
|
||||
group: users
|
||||
- name: Execute command with container_user set
|
||||
command: whoami
|
||||
vars:
|
||||
container_user: testing
|
||||
register: whoami_output
|
||||
changed_when: false
|
||||
failed_when:
|
||||
- whoami_output.stdout != 'testing'
|
||||
|
|
Loading…
Reference in New Issue