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 11 years ago
parent 1d3782cfc7
commit 4c9ebe8522

@ -41,6 +41,9 @@ class ActionModule(object):
# FIXME: error handling
args = " ".join(tokens[1:])
source = template.template(self.runner.basedir, source, inject)
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

Loading…
Cancel
Save