mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
681 B
Python
32 lines
681 B
Python
6 years ago
|
#!/usr/bin/python
|
||
|
"""Ansible module to detect the presence of both the normal and Ansible-specific versions of Paramiko."""
|
||
|
|
||
|
from __future__ import absolute_import, division, print_function
|
||
|
|
||
|
__metaclass__ = type
|
||
|
|
||
|
from ansible.module_utils.basic import AnsibleModule
|
||
|
|
||
|
try:
|
||
|
import paramiko
|
||
|
except ImportError:
|
||
|
paramiko = None
|
||
|
|
||
|
try:
|
||
|
import ansible_paramiko
|
||
|
except ImportError:
|
||
|
ansible_paramiko = None
|
||
|
|
||
|
|
||
|
def main():
|
||
|
module = AnsibleModule(argument_spec={})
|
||
|
module.exit_json(**dict(
|
||
|
found=bool(paramiko or ansible_paramiko),
|
||
|
paramiko=bool(paramiko),
|
||
|
ansible_paramiko=bool(ansible_paramiko),
|
||
|
))
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
main()
|