mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
Added remote templating engine using jinja2, see examples/playbook.yml for usage.
Cleanup is due in runner.py
This commit is contained in:
parent
5d6b0280d5
commit
440bac4a95
5 changed files with 121 additions and 19 deletions
|
@ -4,17 +4,26 @@ try:
|
|||
import json
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
import datetime
|
||||
import traceback
|
||||
|
||||
args = sys.argv[1:]
|
||||
startd = datetime.datetime.now()
|
||||
|
||||
cmd = subprocess.Popen(args, shell=False,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
try:
|
||||
cmd = subprocess.Popen(args, shell=False,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
out, err = cmd.communicate()
|
||||
except:
|
||||
print json.dumps({
|
||||
"failed" : 1,
|
||||
"traceback" : traceback.format_exc()
|
||||
})
|
||||
sys.exit(1)
|
||||
|
||||
out, err = cmd.communicate()
|
||||
endd = datetime.datetime.now()
|
||||
delta = endd - startd
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue