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
13d78802
Commit
13d78802
authored
Feb 11, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4820 from mscherer/add_local_config
Add path for user defined plugin
parents
9fe0b883
72eab3c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
13 deletions
+22
-13
docsite/rst/intro_configuration.rst
+12
-6
lib/ansible/constants.py
+10
-7
No files found.
docsite/rst/intro_configuration.rst
View file @
13d78802
...
...
@@ -70,7 +70,7 @@ Actions are pieces of code in ansible that enable things like module execution,
This is a developer-centric feature that allows low-level extensions around Ansible to be loaded from
different locations::
action_plugins = /usr/share/ansible_plugins/action_plugins
action_plugins =
~/.ansible/plugins/action_plugins/:
/usr/share/ansible_plugins/action_plugins
Most users will not need to use this feature. See :doc:`developing_plugins` for more details.
...
...
@@ -135,10 +135,12 @@ Prior to 1.8, callbacks were never loaded for /usr/bin/ansible.
callback_plugins
================
Callbacks are pieces of code in ansible that get called on specific events, permitting to trigger notifications.
This is a developer-centric feature that allows low-level extensions around Ansible to be loaded from
different locations::
callback_plugins = /usr/share/ansible_plugins/callback_plugins
callback_plugins =
~/.ansible/plugins/callback_plugins/:
/usr/share/ansible_plugins/callback_plugins
Most users will not need to use this feature. See :doc:`developing_plugins` for more details
...
...
@@ -171,10 +173,12 @@ parameter string, like so::
connection_plugins
==================
Connections plugin permit to extend the channel used by ansible to transport commands and files.
This is a developer-centric feature that allows low-level extensions around Ansible to be loaded from
different locations::
connection_plugins = /usr/share/ansible_plugins/connection_plugins
connection_plugins =
~/.ansible/plugins/connection_plugins/:
/usr/share/ansible_plugins/connection_plugins
Most users will not need to use this feature. See :doc:`developing_plugins` for more details
...
...
@@ -230,10 +234,12 @@ rare instances to /bin/bash in rare instances when sudo is constrained, but in m
filter_plugins
==============
Filters are specific functions that can be used to extend the template system.
This is a developer-centric feature that allows low-level extensions around Ansible to be loaded from
different locations::
filter_plugins = /usr/share/ansible_plugins/filter_plugins
filter_plugins =
~/.ansible/plugins/filter_plugins/:
/usr/share/ansible_plugins/filter_plugins
Most users will not need to use this feature. See :doc:`developing_plugins` for more details
...
...
@@ -359,7 +365,7 @@ lookup_plugins
This is a developer-centric feature that allows low-level extensions around Ansible to be loaded from
different locations::
lookup_plugins = /usr/share/ansible_plugins/lookup_plugins
lookup_plugins =
~/.ansible/plugins/lookup_plugins/:
/usr/share/ansible_plugins/lookup_plugins
Most users will not need to use this feature. See :doc:`developing_plugins` for more details
...
...
@@ -562,7 +568,7 @@ vars_plugins
This is a developer-centric feature that allows low-level extensions around Ansible to be loaded from
different locations::
vars_plugins = /usr/share/ansible_plugins/vars_plugins
vars_plugins =
~/.ansible/plugins/vars_plugins/:
/usr/share/ansible_plugins/vars_plugins
Most users will not need to use this feature. See :doc:`developing_plugins` for more details
...
...
lib/ansible/constants.py
View file @
13d78802
...
...
@@ -86,6 +86,9 @@ def shell_expand_path(path):
path
=
os
.
path
.
expanduser
(
os
.
path
.
expandvars
(
path
))
return
path
def
get_plugin_paths
(
path
):
return
':'
.
join
([
os
.
path
.
join
(
x
,
path
)
for
x
in
[
os
.
path
.
expanduser
(
'~/.ansible/plugins/'
),
'/usr/share/ansible_plugins/'
]])
p
=
load_config_file
()
active_user
=
pwd
.
getpwuid
(
os
.
geteuid
())[
0
]
...
...
@@ -135,13 +138,13 @@ DEFAULT_SU_USER = get_config(p, DEFAULTS, 'su_user', 'ANSIBLE_SU_USER'
DEFAULT_ASK_SU_PASS
=
get_config
(
p
,
DEFAULTS
,
'ask_su_pass'
,
'ANSIBLE_ASK_SU_PASS'
,
False
,
boolean
=
True
)
DEFAULT_GATHERING
=
get_config
(
p
,
DEFAULTS
,
'gathering'
,
'ANSIBLE_GATHERING'
,
'implicit'
)
.
lower
()
DEFAULT_ACTION_PLUGIN_PATH
=
get_config
(
p
,
DEFAULTS
,
'action_plugins'
,
'ANSIBLE_ACTION_PLUGINS'
,
'/usr/share/ansible_plugins/action_plugins'
)
DEFAULT_CACHE_PLUGIN_PATH
=
get_config
(
p
,
DEFAULTS
,
'cache_plugins'
,
'ANSIBLE_CACHE_PLUGINS'
,
'/usr/share/ansible_plugins/cache_plugins'
)
DEFAULT_CALLBACK_PLUGIN_PATH
=
get_config
(
p
,
DEFAULTS
,
'callback_plugins'
,
'ANSIBLE_CALLBACK_PLUGINS'
,
'/usr/share/ansible_plugins/callback_plugins'
)
DEFAULT_CONNECTION_PLUGIN_PATH
=
get_config
(
p
,
DEFAULTS
,
'connection_plugins'
,
'ANSIBLE_CONNECTION_PLUGINS'
,
'/usr/share/ansible_plugins/connection_plugins'
)
DEFAULT_LOOKUP_PLUGIN_PATH
=
get_config
(
p
,
DEFAULTS
,
'lookup_plugins'
,
'ANSIBLE_LOOKUP_PLUGINS'
,
'/usr/share/ansible_plugins/lookup_plugins'
)
DEFAULT_VARS_PLUGIN_PATH
=
get_config
(
p
,
DEFAULTS
,
'vars_plugins'
,
'ANSIBLE_VARS_PLUGINS'
,
'/usr/share/ansible_plugins/vars_plugins'
)
DEFAULT_FILTER_PLUGIN_PATH
=
get_config
(
p
,
DEFAULTS
,
'filter_plugins'
,
'ANSIBLE_FILTER_PLUGINS'
,
'/usr/share/ansible_plugins/filter_plugins'
)
DEFAULT_ACTION_PLUGIN_PATH
=
get_config
(
p
,
DEFAULTS
,
'action_plugins'
,
'ANSIBLE_ACTION_PLUGINS'
,
get_plugin_paths
(
'action_plugins'
)
)
DEFAULT_CACHE_PLUGIN_PATH
=
get_config
(
p
,
DEFAULTS
,
'cache_plugins'
,
'ANSIBLE_CACHE_PLUGINS'
,
get_plugin_paths
(
'cache_plugins'
)
)
DEFAULT_CALLBACK_PLUGIN_PATH
=
get_config
(
p
,
DEFAULTS
,
'callback_plugins'
,
'ANSIBLE_CALLBACK_PLUGINS'
,
get_plugin_paths
(
'callback_plugins'
)
)
DEFAULT_CONNECTION_PLUGIN_PATH
=
get_config
(
p
,
DEFAULTS
,
'connection_plugins'
,
'ANSIBLE_CONNECTION_PLUGINS'
,
get_plugin_paths
(
'connection_plugins'
)
)
DEFAULT_LOOKUP_PLUGIN_PATH
=
get_config
(
p
,
DEFAULTS
,
'lookup_plugins'
,
'ANSIBLE_LOOKUP_PLUGINS'
,
get_plugin_paths
(
'lookup_plugins'
)
)
DEFAULT_VARS_PLUGIN_PATH
=
get_config
(
p
,
DEFAULTS
,
'vars_plugins'
,
'ANSIBLE_VARS_PLUGINS'
,
get_plugin_paths
(
'vars_plugins'
)
)
DEFAULT_FILTER_PLUGIN_PATH
=
get_config
(
p
,
DEFAULTS
,
'filter_plugins'
,
'ANSIBLE_FILTER_PLUGINS'
,
get_plugin_paths
(
'filter_plugins'
)
)
DEFAULT_LOG_PATH
=
shell_expand_path
(
get_config
(
p
,
DEFAULTS
,
'log_path'
,
'ANSIBLE_LOG_PATH'
,
''
))
CACHE_PLUGIN
=
get_config
(
p
,
DEFAULTS
,
'fact_caching'
,
'ANSIBLE_CACHE_PLUGIN'
,
'memory'
)
...
...
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