|
|
@ -29,6 +29,7 @@ import tempfile
|
|
|
|
import time
|
|
|
|
import time
|
|
|
|
import base64
|
|
|
|
import base64
|
|
|
|
import getpass
|
|
|
|
import getpass
|
|
|
|
|
|
|
|
import codecs
|
|
|
|
|
|
|
|
|
|
|
|
import ansible.constants as C
|
|
|
|
import ansible.constants as C
|
|
|
|
import ansible.connection
|
|
|
|
import ansible.connection
|
|
|
@ -202,7 +203,7 @@ class Runner(object):
|
|
|
|
|
|
|
|
|
|
|
|
afd, afile = tempfile.mkstemp()
|
|
|
|
afd, afile = tempfile.mkstemp()
|
|
|
|
afo = os.fdopen(afd, 'w')
|
|
|
|
afo = os.fdopen(afd, 'w')
|
|
|
|
afo.write(data)
|
|
|
|
afo.write(data.encode("utf8"))
|
|
|
|
afo.flush()
|
|
|
|
afo.flush()
|
|
|
|
afo.close()
|
|
|
|
afo.close()
|
|
|
|
|
|
|
|
|
|
|
@ -512,6 +513,7 @@ class Runner(object):
|
|
|
|
|
|
|
|
|
|
|
|
source = utils.template(source, inject, self.setup_cache)
|
|
|
|
source = utils.template(source, inject, self.setup_cache)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print source
|
|
|
|
(host, ok, data, err) = (None, None, None, None)
|
|
|
|
(host, ok, data, err) = (None, None, None, None)
|
|
|
|
|
|
|
|
|
|
|
|
if not self.is_playbook:
|
|
|
|
if not self.is_playbook:
|
|
|
@ -542,7 +544,8 @@ class Runner(object):
|
|
|
|
copy_module = self._transfer_module(conn, tmp, 'copy')
|
|
|
|
copy_module = self._transfer_module(conn, tmp, 'copy')
|
|
|
|
|
|
|
|
|
|
|
|
# template the source data locally
|
|
|
|
# template the source data locally
|
|
|
|
source_data = file(utils.path_dwim(self.basedir, source)).read()
|
|
|
|
source_data = codecs.open(utils.path_dwim(self.basedir, source), encoding="utf8").read()
|
|
|
|
|
|
|
|
print source_data
|
|
|
|
resultant = ''
|
|
|
|
resultant = ''
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
resultant = utils.template(source_data, inject, self.setup_cache)
|
|
|
|
resultant = utils.template(source_data, inject, self.setup_cache)
|
|
|
|