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
1aaf8606
Commit
1aaf8606
authored
Sep 15, 2012
by
Daniel Hokka Zakrisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Look for plugins in the playbook's basedir
parent
036f853d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
1 deletions
+17
-1
lib/ansible/callbacks.py
+3
-0
lib/ansible/playbook/__init__.py
+4
-0
lib/ansible/runner/__init__.py
+5
-0
lib/ansible/runner/connection.py
+5
-1
No files found.
lib/ansible/callbacks.py
View file @
1aaf8606
...
...
@@ -46,6 +46,9 @@ def call_callback_module(method_name, *args, **kwargs):
if
method
is
not
None
:
method
(
*
args
,
**
kwargs
)
def
load_more_callbacks
(
dirname
):
callbacks
.
extend
([
c
.
CallbackModule
()
for
c
in
utils
.
import_plugins
(
dirname
)
.
values
()])
def
vv
(
msg
,
host
=
None
):
return
verbose
(
msg
,
host
=
host
,
caplevel
=
1
)
...
...
lib/ansible/playbook/__init__.py
View file @
1aaf8606
...
...
@@ -20,6 +20,7 @@ import ansible.runner
import
ansible.constants
as
C
from
ansible
import
utils
from
ansible
import
errors
import
ansible.callbacks
import
os
import
collections
from
play
import
Play
...
...
@@ -120,6 +121,9 @@ class PlayBook(object):
self
.
basedir
=
os
.
path
.
dirname
(
playbook
)
(
self
.
playbook
,
self
.
play_basedirs
)
=
self
.
_load_playbook_from_file
(
playbook
)
self
.
module_path
=
self
.
module_path
+
os
.
pathsep
+
os
.
path
.
join
(
self
.
basedir
,
"library"
)
ansible
.
callbacks
.
load_more_callbacks
(
os
.
path
.
join
(
self
.
basedir
,
"callback_plugins"
))
self
.
lookup_plugins_list
.
update
(
utils
.
import_plugins
(
os
.
path
.
join
(
self
.
basedir
,
'lookup_plugins'
)))
# *****************************************************
...
...
lib/ansible/runner/__init__.py
View file @
1aaf8606
...
...
@@ -167,6 +167,11 @@ class Runner(object):
for
(
k
,
v
)
in
lookup_plugin_list
.
iteritems
():
self
.
lookup_plugins
[
k
]
=
v
.
LookupModule
(
self
)
for
(
k
,
v
)
in
utils
.
import_plugins
(
os
.
path
.
join
(
self
.
basedir
,
'action_plugins'
))
.
iteritems
():
self
.
action_plugins
[
k
]
=
v
.
ActionModule
(
self
)
for
(
k
,
v
)
in
utils
.
import_plugins
(
os
.
path
.
join
(
self
.
basedir
,
'lookup_plugins'
))
.
iteritems
():
self
.
lookup_plugins
[
k
]
=
v
.
LookupModule
(
self
)
# *****************************************************
def
_delete_remote_files
(
self
,
conn
,
files
):
...
...
lib/ansible/runner/connection.py
View file @
1aaf8606
...
...
@@ -34,11 +34,15 @@ class Connection(object):
def
__init__
(
self
,
runner
):
self
.
runner
=
runner
self
.
modules
=
None
def
connect
(
self
,
host
,
port
):
if
self
.
modules
is
None
:
self
.
modules
=
modules
.
copy
()
self
.
modules
.
update
(
utils
.
import_plugins
(
os
.
path
.
join
(
self
.
runner
.
basedir
,
'connection_plugins'
)))
conn
=
None
transport
=
self
.
runner
.
transport
module
=
modules
.
get
(
transport
,
None
)
module
=
self
.
modules
.
get
(
transport
,
None
)
if
module
is
None
:
raise
AnsibleError
(
"unsupported connection type:
%
s"
%
transport
)
conn
=
module
.
Connection
(
self
.
runner
,
host
,
port
)
...
...
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