1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Add roles support for the script module

allows to put scripts directly in a dir within the
role:

 roles/<role>/scripts/..

Same as the copy and template module.

As requested in and closes #2969
This commit is contained in:
Serge van Ginderachter 2013-05-24 22:10:46 +02:00
parent 1d3782cfc7
commit 4c9ebe8522

View file

@ -41,7 +41,10 @@ class ActionModule(object):
# FIXME: error handling # FIXME: error handling
args = " ".join(tokens[1:]) args = " ".join(tokens[1:])
source = template.template(self.runner.basedir, source, inject) source = template.template(self.runner.basedir, source, inject)
source = utils.path_dwim(self.runner.basedir, source) if '_original_file' in inject:
source = utils.path_dwim_relative(inject['_original_file'], 'scripts', source, self.runner.basedir)
else:
source = utils.path_dwim(self.runner.basedir, source)
# transfer the file to a remote tmp location # transfer the file to a remote tmp location
source = source.replace('\x00','') # why does this happen here? source = source.replace('\x00','') # why does this happen here?