|
|
@ -2,12 +2,20 @@
|
|
|
|
# issue #590: I am an Ansible new-style Python module that tries to use
|
|
|
|
# issue #590: I am an Ansible new-style Python module that tries to use
|
|
|
|
# ansible.module_utils.distro.
|
|
|
|
# ansible.module_utils.distro.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import ansible
|
|
|
|
from ansible.module_utils.basic import AnsibleModule
|
|
|
|
from ansible.module_utils.basic import AnsibleModule
|
|
|
|
from ansible.module_utils import distro
|
|
|
|
|
|
|
|
|
|
|
|
if ansible.__version__ > '2.8':
|
|
|
|
|
|
|
|
from ansible.module_utils import distro
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
distro = None
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
def main():
|
|
|
|
module = AnsibleModule(argument_spec={})
|
|
|
|
module = AnsibleModule(argument_spec={})
|
|
|
|
module.exit_json(info=distro.info())
|
|
|
|
if ansible.__version__ > '2.8':
|
|
|
|
|
|
|
|
module.exit_json(info=distro.info())
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
module.exit_json(info={'id': None})
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|
|
|
|
main()
|
|
|
|