mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
Config continued (#31024)
* included inventory and callback in new config allow inventory to be configurable updated connection options settings also updated winrm to work with new configs removed now obsolete set_host_overrides added notes for future bcoca, current one is just punting, it's future's problem updated docs per feedback added remove group/host methods to inv data moved fact cache from data to constructed cleaner/better options fix when vars are added extended ignore list to config dicts updated paramiko connection docs removed options from base that paramiko already handles left the look option as it is used by other plugin types resolve delegation updated cache doc options fixed test_script better fragment merge for options fixed proxy command restore ini for proxy normalized options moved pipelining to class updates for host_key_checking restructured mixins * fix typo
This commit is contained in:
parent
46c4f6311a
commit
23b1dbacaf
32 changed files with 667 additions and 366 deletions
|
@ -26,7 +26,7 @@ import warnings
|
|||
from copy import deepcopy
|
||||
|
||||
from ansible import constants as C
|
||||
from ansible.plugins import AnsiblePlugin
|
||||
from ansible.plugins import AnsiblePlugin, get_plugin_class
|
||||
from ansible.module_utils._text import to_text
|
||||
from ansible.utils.color import stringc
|
||||
from ansible.vars.clean import strip_internal_keys
|
||||
|
@ -81,8 +81,22 @@ class CallbackBase(AnsiblePlugin):
|
|||
''' helper for callbacks, so they don't all have to include deepcopy '''
|
||||
_copy_result = deepcopy
|
||||
|
||||
def set_options(self, options):
|
||||
self._plugin_options = options
|
||||
def set_option(self, k, v):
|
||||
self._plugin_options[k] = v
|
||||
|
||||
def set_options(self, task_keys=None, var_options=None, direct=None):
|
||||
''' This is different than the normal plugin method as callbacks get called early and really don't accept keywords.
|
||||
Also _options was already taken for CLI args and callbacks use _plugin_options instead.
|
||||
'''
|
||||
|
||||
# load from config
|
||||
self._plugin_options = C.config.get_plugin_options(get_plugin_class(self), self._load_name, keys=task_keys, variables=var_options)
|
||||
|
||||
# or parse specific options
|
||||
if direct:
|
||||
for k in direct:
|
||||
if k in self._plugin_options:
|
||||
self.set_option(k, direct[k])
|
||||
|
||||
def _dump_results(self, result, indent=None, sort_keys=True, keep_invocation=False):
|
||||
|
||||
|
|
|
@ -249,9 +249,6 @@ class CallbackModule(CallbackBase):
|
|||
# self.set_options({'api': 'data.logentries.com', 'port': 80,
|
||||
# 'tls_port': 10000, 'use_tls': True, 'flatten': False, 'token': 'ae693734-4c5b-4a44-8814-1d2feb5c8241'})
|
||||
|
||||
def set_option(self, name, value):
|
||||
raise AnsibleError("The Logentries callabck plugin does not suport setting individual options.")
|
||||
|
||||
def set_options(self, options):
|
||||
|
||||
super(CallbackModule, self).set_options(options)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue