Add detach parameter. (#255)

This commit is contained in:
Felix Fontein
2021-12-22 17:37:08 +01:00
committed by GitHub
parent 5a23c4d336
commit 02596835b1
3 changed files with 90 additions and 40 deletions
@@ -162,11 +162,33 @@
- assert:
that:
- result is changed
- result.rc == 0
- result.stdout == very_long_string ~ '\n' ~ very_long_string2
- result.stdout_lines == [very_long_string, very_long_string2]
- result.stderr == ''
- result.stderr_lines == []
- "'exec_id' not in result"
- name: Execute in a present container (detached)
docker_container_exec:
container: "{{ cname }}"
argv:
- /bin/sh
- '-c'
- sleep 1m
detach: true
register: result
- debug: var=result
- assert:
that:
- result is changed
- "'rc' not in result"
- "'stdout' not in result"
- "'stderr' not in result"
- result.exec_id is string
always:
- name: Cleanup