Add runtime option to docker_container module (#47247)

* Add runtime option to docker_container module

Signed-off-by: Antoine Bardoux <abardoux@nvidia.com>

* Add changelog fragment

Signed-off-by: Antoine Bardoux <abardoux@nvidia.com>

* Add idempotency test for docker_container.runtime

Signed-off-by: Antoine Bardoux <abardoux@nvidia.com>
This commit is contained in:
Pluggi 2018-10-19 01:04:17 -07:00 committed by John R Barker
commit f13091d142
3 changed files with 51 additions and 0 deletions

View file

@ -2457,6 +2457,39 @@
- restart_retries_2 is not changed
- restart_retries_3 is changed
####################################################################
## runtime #########################################################
####################################################################
- name: runtime
docker_container:
image: alpine:3.8
command: '/bin/sh -v -c "sleep 10m"'
name: "{{ cname }}"
runtime: runc
state: started
register: runtime_1
- name: runtime (idempotency)
docker_container:
image: alpine:3.8
command: '/bin/sh -v -c "sleep 10m"'
name: "{{ cname }}"
runtime: runc
state: started
register: runtime_2
- name: cleanup
docker_container:
name: "{{ cname }}"
state: absent
stop_timeout: 1
- assert:
that:
- runtime_1 is changed
- runtime_2 is not changed
####################################################################
## security_opts ###################################################
####################################################################