mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 03:46:55 +00:00
Adjust deprecations (#1)
* First batch of c.g 2.0.0 deprecations. * Remove use_tls and force from docker_image. * More removals. * Change community.general 3.0.0 deprecations to community.docker 2.0.0. * Fix sanity. * Fixing some bugs. * Add PR URL to fragment. ci_complete ci_coverage * Improve docs, remove superfluous code.
This commit is contained in:
@@ -40,16 +40,6 @@ options:
|
||||
- Dictionary of label key/values to set for the volume
|
||||
type: dict
|
||||
|
||||
force:
|
||||
description:
|
||||
- With state C(present) causes the volume to be deleted and recreated if the volume already
|
||||
exist and the driver, driver options or labels differ. This will cause any data in the existing
|
||||
volume to be lost.
|
||||
- Deprecated. Will be removed in community.general 2.0.0. Set I(recreate) to C(options-changed) instead
|
||||
for the same behavior of setting I(force) to C(yes).
|
||||
type: bool
|
||||
default: no
|
||||
|
||||
recreate:
|
||||
description:
|
||||
- Controls when a volume will be recreated when I(state) is C(present). Please
|
||||
@@ -112,8 +102,6 @@ RETURN = '''
|
||||
volume:
|
||||
description:
|
||||
- Volume inspection results for the affected volume.
|
||||
- Note that facts are part of the registered vars since Ansible 2.8. For compatibility reasons, the facts
|
||||
are also accessible directly as C(docker_volume). Note that the returned fact will be removed in community.general 2.0.0.
|
||||
returned: success
|
||||
type: dict
|
||||
sample: {}
|
||||
@@ -145,23 +133,12 @@ class TaskParameters(DockerBaseClass):
|
||||
self.driver = None
|
||||
self.driver_options = None
|
||||
self.labels = None
|
||||
self.force = None
|
||||
self.recreate = None
|
||||
self.debug = None
|
||||
|
||||
for key, value in iteritems(client.module.params):
|
||||
setattr(self, key, value)
|
||||
|
||||
if self.force is not None:
|
||||
if self.recreate != 'never':
|
||||
client.fail('Cannot use the deprecated "force" '
|
||||
'option when "recreate" is set. Please stop '
|
||||
'using the force option.')
|
||||
client.module.warn('The "force" option of docker_volume has been deprecated '
|
||||
'in Ansible 2.8. Please use the "recreate" '
|
||||
'option, which provides the same functionality as "force".')
|
||||
self.recreate = 'options-changed' if self.force else 'never'
|
||||
|
||||
|
||||
class DockerVolumeManager(object):
|
||||
|
||||
@@ -287,7 +264,6 @@ class DockerVolumeManager(object):
|
||||
self.results.pop('actions')
|
||||
|
||||
volume_facts = self.get_existing_volume()
|
||||
self.results['ansible_facts'] = {u'docker_volume': volume_facts}
|
||||
self.results['volume'] = volume_facts
|
||||
|
||||
def absent(self):
|
||||
@@ -302,7 +278,6 @@ def main():
|
||||
driver=dict(type='str', default='local'),
|
||||
driver_options=dict(type='dict', default={}),
|
||||
labels=dict(type='dict'),
|
||||
force=dict(type='bool', removed_in_version='2.0.0', removed_from_collection='community.general'), # was Ansible 2.12
|
||||
recreate=dict(type='str', default='never', choices=['always', 'never', 'options-changed']),
|
||||
debug=dict(type='bool', default=False)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user