mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-30 04:49:09 -07:00
docker: provide alternatives to ansible_facts results (#51192)
* Try to stop using ansible_facts for docker modules. * Stop using facts returned from regular modules.
This commit is contained in:
parent
8222ebd23a
commit
37b0f5c81b
7 changed files with 50 additions and 26 deletions
|
@ -246,8 +246,11 @@ EXAMPLES = '''
|
|||
'''
|
||||
|
||||
RETURN = '''
|
||||
facts:
|
||||
description: Network inspection results for the affected network.
|
||||
docker_network:
|
||||
description:
|
||||
- Network inspection results for the affected network.
|
||||
- Note that facts are part of the registered vars since Ansible 2.8. For compatibility reasons, the facts
|
||||
are also accessible directly.
|
||||
returned: success
|
||||
type: dict
|
||||
sample: {}
|
||||
|
@ -575,7 +578,9 @@ class DockerNetworkManager(object):
|
|||
if not self.check_mode and not self.parameters.debug:
|
||||
self.results.pop('actions')
|
||||
|
||||
self.results['ansible_facts'] = {u'docker_network': self.get_existing_network()}
|
||||
network_facts = self.get_existing_network()
|
||||
self.results['ansible_facts'] = {u'docker_network': network_facts}
|
||||
self.results['docker_network'] = network_facts
|
||||
|
||||
def absent(self):
|
||||
self.diff_tracker.add('exists', parameter=False, active=self.existing_network is not None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue