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:
parent
3c3392a2d9
commit
bc6d454b5e
2 changed files with 10 additions and 4 deletions
|
@ -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…
Reference in a new issue