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
9abd31b1
Commit
9abd31b1
authored
Apr 27, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2794 from stoned/role-library
Add module path library/ if it exists in role directory
parents
91a467bc
75b51f79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
lib/ansible/playbook/play.py
+7
-3
No files found.
lib/ansible/playbook/play.py
View file @
9abd31b1
...
@@ -125,7 +125,8 @@ class Play(object):
...
@@ -125,7 +125,8 @@ class Play(object):
# <rolename>/tasks/main.yml
# <rolename>/tasks/main.yml
# <rolename>/handlers/main.yml
# <rolename>/handlers/main.yml
# <rolename>/vars/main.yml
# <rolename>/vars/main.yml
# and it auto-extends tasks/handlers/vars_files as appropriate if found
# <rolename>/library
# and it auto-extends tasks/handlers/vars_files/module paths as appropriate if found
if
roles
is
None
:
if
roles
is
None
:
roles
=
[]
roles
=
[]
...
@@ -172,8 +173,9 @@ class Play(object):
...
@@ -172,8 +173,9 @@ class Play(object):
task
=
utils
.
path_dwim
(
self
.
basedir
,
os
.
path
.
join
(
path
,
'tasks'
,
'main.yml'
))
task
=
utils
.
path_dwim
(
self
.
basedir
,
os
.
path
.
join
(
path
,
'tasks'
,
'main.yml'
))
handler
=
utils
.
path_dwim
(
self
.
basedir
,
os
.
path
.
join
(
path
,
'handlers'
,
'main.yml'
))
handler
=
utils
.
path_dwim
(
self
.
basedir
,
os
.
path
.
join
(
path
,
'handlers'
,
'main.yml'
))
vars_file
=
utils
.
path_dwim
(
self
.
basedir
,
os
.
path
.
join
(
path
,
'vars'
,
'main.yml'
))
vars_file
=
utils
.
path_dwim
(
self
.
basedir
,
os
.
path
.
join
(
path
,
'vars'
,
'main.yml'
))
if
not
os
.
path
.
isfile
(
task
)
and
not
os
.
path
.
isfile
(
handler
)
and
not
os
.
path
.
isfile
(
vars_file
):
library
=
utils
.
path_dwim
(
self
.
basedir
,
os
.
path
.
join
(
path
,
'library'
))
raise
errors
.
AnsibleError
(
"found role at
%
s, but cannot find
%
s or
%
s or
%
s"
%
(
path
,
task
,
handler
,
vars_file
))
if
not
os
.
path
.
isfile
(
task
)
and
not
os
.
path
.
isfile
(
handler
)
and
not
os
.
path
.
isfile
(
vars_file
)
and
not
os
.
path
.
isdir
(
library
):
raise
errors
.
AnsibleError
(
"found role at
%
s, but cannot find
%
s or
%
s or
%
s or
%
s"
%
(
path
,
task
,
handler
,
vars_file
,
library
))
if
os
.
path
.
isfile
(
task
):
if
os
.
path
.
isfile
(
task
):
nt
=
dict
(
include
=
task
,
vars
=
has_dict
)
nt
=
dict
(
include
=
task
,
vars
=
has_dict
)
if
when
:
if
when
:
...
@@ -190,6 +192,8 @@ class Play(object):
...
@@ -190,6 +192,8 @@ class Play(object):
new_handlers
.
append
(
nt
)
new_handlers
.
append
(
nt
)
if
os
.
path
.
isfile
(
vars_file
):
if
os
.
path
.
isfile
(
vars_file
):
new_vars_files
.
append
(
vars_file
)
new_vars_files
.
append
(
vars_file
)
if
os
.
path
.
isdir
(
library
):
utils
.
plugins
.
module_finder
.
add_directory
(
library
)
tasks
=
ds
.
get
(
'tasks'
,
None
)
tasks
=
ds
.
get
(
'tasks'
,
None
)
post_tasks
=
ds
.
get
(
'post_tasks'
,
None
)
post_tasks
=
ds
.
get
(
'post_tasks'
,
None
)
...
...
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