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
pull/3017/head
Serge van Ginderachter 12 years ago
parent 1d3782cfc7
commit 4c9ebe8522

@ -41,7 +41,10 @@ class ActionModule(object):
# FIXME: error handling
args = " ".join(tokens[1:])
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
source = source.replace('\x00','') # why does this happen here?

Loading…
Cancel
Save