mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-09 14:50:02 -07:00
docker_container: allow more mount modes for volumes (#46598)
* Being more strict about volume mount modes.
This commit is contained in:
parent
513be8923d
commit
77127d6768
3 changed files with 43 additions and 12 deletions
|
@ -3109,7 +3109,7 @@
|
|||
state: started
|
||||
volumes:
|
||||
- "/tmp:/tmp"
|
||||
- "/:/whatever"
|
||||
- "/:/whatever:rw,z"
|
||||
register: volumes_1
|
||||
|
||||
- name: volumes (idempotency)
|
||||
|
@ -3119,7 +3119,7 @@
|
|||
name: "{{ cname }}"
|
||||
state: started
|
||||
volumes:
|
||||
- "/:/whatever"
|
||||
- "/:/whatever:rw,z"
|
||||
- "/tmp:/tmp"
|
||||
register: volumes_2
|
||||
|
||||
|
@ -3141,10 +3141,22 @@
|
|||
state: started
|
||||
volumes:
|
||||
- "/tmp:/tmp"
|
||||
- "/tmp:/somewhereelse:ro"
|
||||
- "/tmp:/somewhereelse:ro,Z"
|
||||
stop_timeout: 1
|
||||
register: volumes_4
|
||||
|
||||
- name: volumes (different modes)
|
||||
docker_container:
|
||||
image: alpine:3.8
|
||||
command: '/bin/sh -c "sleep 10m"'
|
||||
name: "{{ cname }}"
|
||||
state: started
|
||||
volumes:
|
||||
- "/tmp:/tmp"
|
||||
- "/tmp:/somewhereelse:ro"
|
||||
stop_timeout: 1
|
||||
register: volumes_5
|
||||
|
||||
- name: cleanup
|
||||
docker_container:
|
||||
name: "{{ cname }}"
|
||||
|
@ -3157,6 +3169,7 @@
|
|||
- volumes_2 is not changed
|
||||
- volumes_3 is not changed
|
||||
- volumes_4 is changed
|
||||
- volumes_5 is changed
|
||||
|
||||
####################################################################
|
||||
## volumes_from ####################################################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue