docker_volume: improve force option (deprecate, add new option) (#51145)

* docker_volume: Deprecating force option, adding recreate option.

* Add changelog.

* Remove mis-placed force: yes for docker_volume.
This commit is contained in:
Felix Fontein
2019-02-03 21:09:24 +01:00
committed by ansibot
parent 470af47ea8
commit 89a1c68f98
7 changed files with 53 additions and 16 deletions

View File

@@ -20,12 +20,18 @@
name: "{{ vname }}"
register: create_2
- name: Create a volume (force)
- name: "Create a volume (recreate: options-changed)"
docker_volume:
name: "{{ vname }}"
force: yes
recreate: options-changed
register: create_3
- name: "Create a volume (recreate: always)"
docker_volume:
name: "{{ vname }}"
recreate: always
register: create_4
- name: Remove a volume
docker_volume:
name: "{{ vname }}"
@@ -43,6 +49,7 @@
- create_1 is changed
- create_2 is not changed
- create_3 is not changed
- create_4 is changed
- absent_1 is changed
- absent_2 is not changed
@@ -80,7 +87,7 @@
o: size=200m,uid=1000
register: driver_options_3
- name: Create a volume with options (changed, force)
- name: "Create a volume with options (changed, recreate: options-changed)"
docker_volume:
name: "{{ vname }}"
driver: local
@@ -88,7 +95,7 @@
type: tempfs
device: tmpfs
o: size=200m,uid=1000
force: yes
recreate: options-changed
register: driver_options_4
- name: Cleanup
@@ -130,12 +137,12 @@
ansible.test.1: hello
register: driver_labels_3
- name: Create a volume with labels (less, force)
- name: "Create a volume with labels (less, recreate: options-changed)"
docker_volume:
name: "{{ vname }}"
labels:
ansible.test.1: hello
force: yes
recreate: options-changed
register: driver_labels_4
- name: Create a volume with labels (more)
@@ -146,13 +153,13 @@
ansible.test.3: ansible
register: driver_labels_5
- name: Create a volume with labels (more, force)
- name: "Create a volume with labels (more, recreate: options-changed)"
docker_volume:
name: "{{ vname }}"
labels:
ansible.test.1: hello
ansible.test.3: ansible
force: yes
recreate: options-changed
register: driver_labels_6
- name: Cleanup