Testing playbook: test.yml - hosts: localhost connection: local tasks: - timetest: lib/timetest.py #!/usr/bin/python import datetime import json date = str(datetime.datetime.now()) print json.dumps({ "time" : date })