summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker/library/docker_info.py
blob: 0d0ddae8b4b17922d0da617512bcb78bbfbb26e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
Ansible module for determining information about the docker host.

While there are several ansible modules that make use of the docker
api to expose container and image facts in a remote host, they
are unable to return specific information about the host machine
itself. This module exposes the same information obtained through
executing the `docker info` command on a docker host, in json format.
"""

from ansible.module_utils.docker_common import AnsibleDockerClient


def main():
    """Entrypoint for running an Ansible module."""
    client = AnsibleDockerClient()

    client.module.exit_json(
        info=client.info(),
    )


if __name__ == '__main__':
    main()