Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker_swarm_service: rename return variable to swarm_service #53229

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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."
8 changes: 6 additions & 2 deletions lib/ansible/modules/cloud/docker/docker_swarm_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,17 @@
'''

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",
Expand Down Expand Up @@ -1852,7 +1856,7 @@ def main():
changed=changed,
rebuilt=rebuilt,
changes=changes,
ansible_docker_service=facts,
swarm_service=facts,
)
if client.module._diff:
before, after = dsm.diff_tracker.get_before_after()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
- name: assert service args are correct
assert:
that:
- output.ansible_docker_service.args == ['sleep', '1800']
- output.swarm_service.args == ['sleep', '1800']

- name: set service mode to global
register: output
Expand Down Expand Up @@ -88,7 +88,7 @@

- name: fake image key as it is not predictable
set_fact:
ansible_docker_service_output: "{{ output.ansible_docker_service|combine({'image': 'busybox'}) }}"
ansible_docker_service_output: "{{ output.swarm_service|combine({'image': 'busybox'}) }}"

- name: assert service matches expectations
assert:
Expand Down