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:
Felix Fontein
2021-01-03 13:30:09 +01:00
committed by GitHub
parent e4b747d788
commit c7a3d9f057
4 changed files with 50 additions and 0 deletions
@@ -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 #########################################################
####################################################################