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:
Logan V 2018-03-19 11:15:44 -05:00 committed by Paul Belanger
parent 1449f5ec01
commit 37f1df3a33
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
1 changed files with 16 additions and 0 deletions

View File

@ -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'