mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
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:
parent
131efcff9d
commit
f13091d142
3 changed files with 51 additions and 0 deletions
|
@ -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 ###################################################
|
||||
####################################################################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue