Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
fd77804b
Commit
fd77804b
authored
May 29, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3017 from sergevanginderachter/roles-script
Add roles support for the script module
parents
44e32cc4
5859af72
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletions
+8
-1
docsite/latest/rst/bestpractices.rst
+1
-0
docsite/latest/rst/playbooks.rst
+3
-0
lib/ansible/runner/action_plugins/script.py
+4
-1
No files found.
docsite/latest/rst/bestpractices.rst
View file @
fd77804b
...
@@ -52,6 +52,7 @@ The top level of the directory would contain files and directories like so::
...
@@ -52,6 +52,7 @@ The top level of the directory would contain files and directories like so::
ntp.conf.j2 # <------- templates end in .j2
ntp.conf.j2 # <------- templates end in .j2
files/ #
files/ #
bar.txt # <-- files for use with the copy resource
bar.txt # <-- files for use with the copy resource
foo.sh # <-- script files for use with the script resource
webtier/ # same kind of structure as "common" was above, done for the webtier role
webtier/ # same kind of structure as "common" was above, done for the webtier role
monitoring/ # ""
monitoring/ # ""
...
...
docsite/latest/rst/playbooks.rst
View file @
fd77804b
...
@@ -488,6 +488,7 @@ This designates the following behaviors, for each role 'x':
...
@@ -488,6 +488,7 @@ This designates the following behaviors, for each role 'x':
- If roles/x/handlers/main.yml exists, handlers listed therein will be added to the play
- If roles/x/handlers/main.yml exists, handlers listed therein will be added to the play
- If roles/x/vars/main.yml exists, variables listed therein will be added to the play
- If roles/x/vars/main.yml exists, variables listed therein will be added to the play
- Any copy tasks can reference files in roles/x/files/ without having to path them relatively or absolutely
- Any copy tasks can reference files in roles/x/files/ without having to path them relatively or absolutely
- Any script tasks can reference scripts in roles/x/files/ without having to path them relatively or absolutely
- Any template tasks can reference files in roles/x/templates/ without having to path them relatively or absolutely
- Any template tasks can reference files in roles/x/templates/ without having to path them relatively or absolutely
If any files are not present, they are just ignored. So it'
s
ok
to
not
have
a
'vars/'
subdirectory
for
the
role
,
If any files are not present, they are just ignored. So it'
s
ok
to
not
have
a
'vars/'
subdirectory
for
the
role
,
...
@@ -526,6 +527,8 @@ If you want to define certain tasks to happen before AND after roles are applied
...
@@ -526,6 +527,8 @@ If you want to define certain tasks to happen before AND after roles are applied
- shell: echo '
hello
'
- shell: echo '
hello
'
roles:
roles:
- { role: some_role }
- { role: some_role }
tasks:
- shell: echo '
still
busy
'
post_tasks:
post_tasks:
- shell: echo '
goodbye
'
- shell: echo '
goodbye
'
...
...
lib/ansible/runner/action_plugins/script.py
View file @
fd77804b
...
@@ -41,7 +41,10 @@ class ActionModule(object):
...
@@ -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'
],
'files'
,
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?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment