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/.
This commit is contained in:
Michael DeHaan 2013-10-26 11:09:30 -04:00
parent 3c3392a2d9
commit bc6d454b5e
2 changed files with 10 additions and 4 deletions

View file

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

View file

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