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:
Felix Fontein 2019-02-18 14:41:34 +01:00 committed by John R Barker
parent 8222ebd23a
commit 37b0f5c81b
7 changed files with 50 additions and 26 deletions

View file

@ -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)