mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-02 19:32:47 +00: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:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user