Save the transfer of the module file for new style modules, because we can inject the arguments into the modules.

Module consumers using the API don't have to know how this works.  base64 stuff is only there
because escaping a docstring inside a docstring was a bit of a challenge :)
reviewable/pr18780/r1
Michael DeHaan 13 years ago
parent 47cd5de2cc
commit 4ac5fcf3a3

18
ping

@ -17,15 +17,15 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
try:
import json
except ImportError:
import simplejson as json
import base64
import os
import syslog
def main():
module = AnsibleModule(
argument_spec = dict()
)
module.exit_json(ping='pong')
syslog.openlog('ansible-%s' % os.path.basename(__file__))
syslog.syslog(syslog.LOG_NOTICE, 'Invoked as-is')
# this is magic, see lib/ansible/module_common.py
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
main()
print json.dumps({ "ping" : "pong" })

Loading…
Cancel
Save