[2.7] docker_swarm_service: rename return variable to swarm_service (#53408)

* docker_swarm_service: rename return variable to swarm_service (#53229)

* Rename return variable to swarm_service.

* Add changelog.

* Add that old name will stay in Ansible 2.7.x.

(cherry picked from commit 61abbfc269)

* Keep old variable for backwards compatibility.
pull/53477/head
Felix Fontein 7 years ago committed by Toshio Kuratomi
parent 3eccd83891
commit 3380defd67

@ -0,0 +1,5 @@
bugfixes:
- "docker_swarm_service - the return value was documented as ``ansible_swarm_service``, but the
module actually returned ``ansible_docker_service``. Documentation and code have been updated
so that the variable is now called ``swarm_service``. In Ansible 2.7.x, the old name
``ansible_docker_service`` can still be used to access the result."

@ -299,13 +299,17 @@ requirements:
'''
RETURN = '''
ansible_swarm_service:
swarm_service:
returned: always
type: dict
description:
- Dictionary of variables representing the current state of the service.
Matches the module parameters format.
- Note that facts are not part of registered vars but accessible directly.
- Note that before Ansible 2.7.9, the return variable was documented as C(ansible_swarm_service),
while the module actually returned a variable called C(ansible_docker_service). The variable
was renamed to C(swarm_service) in both code and documentation for Ansible 2.7.9 and Ansible 2.8.0.
In Ansible 2.7.x, the old name C(ansible_docker_service) can still be used.
sample: '{
"args": [
"sleep",
@ -1193,7 +1197,14 @@ def main():
dsm = DockerServiceManager(client)
msg, changed, rebuilt, changes, facts = dsm.run()
client.module.exit_json(msg=msg, changed=changed, rebuilt=rebuilt, changes=changes, ansible_docker_service=facts)
client.module.exit_json(
msg=msg,
changed=changed,
rebuilt=rebuilt,
changes=changes,
swarm_service=facts,
ansible_docker_service=facts # kept for backwards-compatibility, will be removed in Ansible 2.8
)
if __name__ == '__main__':

Loading…
Cancel
Save