Python Module not working

Hello,

while the example time module in the ansible documentation is working, i wrote a new simple test module, but this is not running:

`
import socket
import json

hostname = str(socket.gethostname())
print json.dumps({
“name” : hostname
})

`

hacking/test-module -m hacking/gethostname.py

This return something weird:

`

/home/.ansible_module_generated: Zeile 4: Syntaxfehler beim unerwarteten Wort (' /home/.ansible_module_generated: Zeile 4: hostname = str(socket.gethostname())’

Try putting a shebang line in your module. Make the following be the first line of your file:

#!/usr/bin/python

From your description of the cursor, your module is being executed by the shell instead of python. (The program, “import” is what changes the cursor like that.)

-Toshio