Testing playbook: Dir tree . |-- lib | `-- timetest.py `-- test.yml 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 })