mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
docker_container: cgroup_parent (#59)
* Document that the Docker SDK for Python is used by the module. * Allow to specify cgroup_parent for container.
This commit is contained in:
@@ -157,6 +157,40 @@
|
||||
- capabilities_3 is not changed
|
||||
- capabilities_4 is changed
|
||||
|
||||
####################################################################
|
||||
## cgroup_parent ###################################################
|
||||
####################################################################
|
||||
|
||||
- name: cgroup_parent
|
||||
docker_container:
|
||||
image: "{{ docker_test_image_alpine }}"
|
||||
command: '/bin/sh -c "sleep 10m"'
|
||||
name: "{{ cname }}"
|
||||
state: started
|
||||
cgroup_parent: ''
|
||||
register: cgroup_parent_1
|
||||
|
||||
- name: cgroup_parent (idempotency)
|
||||
docker_container:
|
||||
image: "{{ docker_test_image_alpine }}"
|
||||
command: '/bin/sh -c "sleep 10m"'
|
||||
name: "{{ cname }}"
|
||||
state: started
|
||||
cgroup_parent: ''
|
||||
register: cgroup_parent_2
|
||||
|
||||
- name: cleanup
|
||||
docker_container:
|
||||
name: "{{ cname }}"
|
||||
state: absent
|
||||
force_kill: yes
|
||||
diff: no
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- cgroup_parent_1 is changed
|
||||
- cgroup_parent_2 is not changed
|
||||
|
||||
####################################################################
|
||||
## command #########################################################
|
||||
####################################################################
|
||||
|
||||
Reference in New Issue
Block a user