mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-07 08:54:01 -07:00
fixes to config/setting retrieval
- better variable precedence management - universal plugin option handling - also updated comments for future directions - leverage fragments for plugins - removed fact namespacing - added 'firendly name' field - updated missing descriptions - removed some unused yaml entries, updated others to reflect possible future - documented more plugins - allow reading docs using alias - short licenses - corrected args for 'all plugins' - fixed -a option for ansible-doc - updated vars plugins to allow docs - fixed 'gathering' - only set options IF connection - added path list and renamed pathspec mostly the diff is , vs : as separator - readded removed config entries that were deprecated but had no message ... and deprecated again - now deprecated entries give warning when set
This commit is contained in:
parent
f88750d665
commit
075ead8fb0
70 changed files with 1862 additions and 1292 deletions
|
@ -44,5 +44,17 @@ def get_plugin_class(obj):
|
|||
|
||||
class AnsiblePlugin(with_metaclass(ABCMeta, object)):
|
||||
|
||||
def get_option(self, option):
|
||||
return C.get_plugin_option(get_plugin_class(self), self.name, option)
|
||||
def __init__(self):
|
||||
self.options = {}
|
||||
|
||||
def get_option(self, option, hostvars=None):
|
||||
if option not in self.options:
|
||||
option_value = C.config.get_config_value(option, plugin_type=get_plugin_class(self), plugin_name=self.name, variables=hostvars)
|
||||
self.set_option(option, option_value)
|
||||
return self.options.get(option)
|
||||
|
||||
def set_option(self, option, value):
|
||||
self.options[option] = value
|
||||
|
||||
def set_options(self, options):
|
||||
self.options = options
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue