roles/x/scripts support: update docs
also added example on where regular tasks fit in
This commit is contained in:
parent
4c9ebe8522
commit
0224dc464d
2 changed files with 7 additions and 0 deletions
|
@ -48,6 +48,8 @@ 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/ #
|
||||
|
|
|
@ -463,12 +463,14 @@ Example project structure::
|
|||
roles/
|
||||
common/
|
||||
files/
|
||||
scripts/
|
||||
templates/
|
||||
tasks/
|
||||
handlers/
|
||||
vars/
|
||||
webservers/
|
||||
files/
|
||||
scripts/
|
||||
templates/
|
||||
tasks/
|
||||
handlers/
|
||||
|
@ -488,6 +490,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/sripts/ 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,
|
||||
|
@ -526,6 +529,8 @@ If you want to define certain tasks to happen before AND after roles are applied
|
|||
- shell: echo 'hello'
|
||||
roles:
|
||||
- { role: some_role }
|
||||
tasks:
|
||||
- shell: echo 'still busy'
|
||||
post_tasks:
|
||||
- shell: echo 'goodbye'
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue