mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 20:31:27 -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
|
@ -821,7 +821,8 @@ docker_container:
|
|||
description:
|
||||
- Before 2.3 this was 'ansible_docker_container' but was renamed due to conflicts with the connection plugin.
|
||||
- Facts representing the current state of the container. Matches the docker inspection output.
|
||||
- Note that facts are not part of registered vars but accessible directly.
|
||||
- Note that facts are part of the registered vars since Ansible 2.8. For compatibility reasons, the facts
|
||||
are also accessible directly.
|
||||
- Empty if C(state) is I(absent)
|
||||
- If detached is I(False), will include Output attribute containing any output from container run.
|
||||
returned: always
|
||||
|
@ -2196,6 +2197,7 @@ class ContainerManager(DockerBaseClass):
|
|||
|
||||
if self.facts:
|
||||
self.results['ansible_facts'] = {'docker_container': self.facts}
|
||||
self.results['docker_container'] = self.facts
|
||||
|
||||
def present(self, state):
|
||||
container = self._get_container(self.parameters.name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue