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
5859af72
Commit
5859af72
authored
May 25, 2013
by
Serge van Ginderachter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
script support for roles: use the files/ directory
instead of an additional scripts/ directory
parent
0224dc46
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
6 deletions
+3
-6
docsite/latest/rst/bestpractices.rst
+1
-2
docsite/latest/rst/playbooks.rst
+1
-3
lib/ansible/runner/action_plugins/script.py
+1
-1
No files found.
docsite/latest/rst/bestpractices.rst
View file @
5859af72
...
...
@@ -48,12 +48,11 @@ The top level of the directory would contain files and directories like so::
main.yml # <-- tasks file can include smaller files if warranted
handlers/ #
main.yml # <-- handlers file
scripts/ #
foo.sh # <-- script files for use with the script resource
templates/ # <-- files for use with the template resource
ntp.conf.j2 # <------- templates end in .j2
files/ #
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
monitoring/ # ""
...
...
docsite/latest/rst/playbooks.rst
View file @
5859af72
...
...
@@ -463,14 +463,12 @@ Example project structure::
roles/
common/
files/
scripts/
templates/
tasks/
handlers/
vars/
webservers/
files/
scripts/
templates/
tasks/
handlers/
...
...
@@ -490,7 +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/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 script tasks can reference scripts in roles/x/
sript
s/ without having to path them relatively or absolutely
- Any script tasks can reference scripts in roles/x/
file
s/ 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
,
...
...
lib/ansible/runner/action_plugins/script.py
View file @
5859af72
...
...
@@ -42,7 +42,7 @@ class ActionModule(object):
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'
],
'
script
s'
,
source
,
self
.
runner
.
basedir
)
source
=
utils
.
path_dwim_relative
(
inject
[
'_original_file'
],
'
file
s'
,
source
,
self
.
runner
.
basedir
)
else
:
source
=
utils
.
path_dwim
(
self
.
runner
.
basedir
,
source
)
...
...
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