@ -79,6 +79,9 @@ class ActionModule(ActionBase):
parts = [ to_text ( s , errors = ' surrogate_or_strict ' ) for s in shlex . split ( raw_params . strip ( ) ) ]
parts = [ to_text ( s , errors = ' surrogate_or_strict ' ) for s in shlex . split ( raw_params . strip ( ) ) ]
source = parts [ 0 ]
source = parts [ 0 ]
# Support executable paths and files with spaces in the name.
executable = to_native ( self . _task . args . get ( ' executable ' , ' ' ) , errors = ' surrogate_or_strict ' )
try :
try :
source = self . _loader . get_real_file ( self . _find_needle ( ' files ' , source ) , decrypt = self . _task . args . get ( ' decrypt ' , True ) )
source = self . _loader . get_real_file ( self . _find_needle ( ' files ' , source ) , decrypt = self . _task . args . get ( ' decrypt ' , True ) )
except AnsibleError as e :
except AnsibleError as e :
@ -109,7 +112,11 @@ class ActionModule(ActionBase):
# add preparation steps to one ssh roundtrip executing the script
# add preparation steps to one ssh roundtrip executing the script
env_dict = dict ( )
env_dict = dict ( )
env_string = self . _compute_environment_string ( env_dict )
env_string = self . _compute_environment_string ( env_dict )
script_cmd = ' ' . join ( [ env_string , target_command ] )
if executable :
script_cmd = ' ' . join ( [ env_string , executable , target_command ] )
else :
script_cmd = ' ' . join ( [ env_string , target_command ] )
if self . _play_context . check_mode :
if self . _play_context . check_mode :
raise _AnsibleActionDone ( )
raise _AnsibleActionDone ( )