Enable imports to work on a snippet based system, allowing for instance a library of common EC2 functions

to be reused between modules.  See library/system/service and library/system/ping for initial examples.  Can
work the old way to just import 'basic', or can import the new way to import multiple pieces of code from
module_utils/.
reviewable/pr18780/r1
Michael DeHaan 11 years ago
parent 3c3392a2d9
commit bc6d454b5e

@ -48,7 +48,9 @@ def main():
result['ping'] = module.params['data']
module.exit_json(**result)
# this is magic, see lib/ansible/module_common.py
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
### boilerplate: import common module snippets here
from ansible.module_utils.basic import *
### invoke the module
main()

@ -1205,7 +1205,11 @@ def main():
module.exit_json(**result)
# this is magic, see lib/ansible/module_common.py
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
### boilerplate: import common module snippets here
from ansible.module_utils.basic import *
### invoke the module
main()

Loading…
Cancel
Save