mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
make default strategy configurable (#18394)
This commit is contained in:
parent
bd70397e24
commit
f94100aa87
4 changed files with 17 additions and 1 deletions
|
@ -780,6 +780,15 @@ different locations::
|
||||||
|
|
||||||
Most users will not need to use this feature. See :doc:`developing_plugins` for more details
|
Most users will not need to use this feature. See :doc:`developing_plugins` for more details
|
||||||
|
|
||||||
|
.. _cfg_strategy:
|
||||||
|
|
||||||
|
strategy
|
||||||
|
========
|
||||||
|
|
||||||
|
Strategy allow to change the default strategy used by Ansible::
|
||||||
|
|
||||||
|
strategy = free
|
||||||
|
|
||||||
.. _sudo_exe:
|
.. _sudo_exe:
|
||||||
|
|
||||||
sudo_exe
|
sudo_exe
|
||||||
|
|
|
@ -182,6 +182,11 @@
|
||||||
#test_plugins = /usr/share/ansible/plugins/test
|
#test_plugins = /usr/share/ansible/plugins/test
|
||||||
#strategy_plugins = /usr/share/ansible/plugins/strategy
|
#strategy_plugins = /usr/share/ansible/plugins/strategy
|
||||||
|
|
||||||
|
|
||||||
|
# by default, ansible will use the 'linear' strategy but you may want to try
|
||||||
|
# another one
|
||||||
|
#strategy = free
|
||||||
|
|
||||||
# by default callbacks are not loaded for /bin/ansible, enable this if you
|
# by default callbacks are not loaded for /bin/ansible, enable this if you
|
||||||
# want, for example, a notification or logging callback to also apply to
|
# want, for example, a notification or logging callback to also apply to
|
||||||
# /bin/ansible runs
|
# /bin/ansible runs
|
||||||
|
|
|
@ -268,6 +268,7 @@ DEFAULT_VARS_PLUGIN_PATH = get_config(p, DEFAULTS, 'vars_plugins', '
|
||||||
DEFAULT_FILTER_PLUGIN_PATH = get_config(p, DEFAULTS, 'filter_plugins', 'ANSIBLE_FILTER_PLUGINS', '~/.ansible/plugins/filter:/usr/share/ansible/plugins/filter', value_type='pathlist')
|
DEFAULT_FILTER_PLUGIN_PATH = get_config(p, DEFAULTS, 'filter_plugins', 'ANSIBLE_FILTER_PLUGINS', '~/.ansible/plugins/filter:/usr/share/ansible/plugins/filter', value_type='pathlist')
|
||||||
DEFAULT_TEST_PLUGIN_PATH = get_config(p, DEFAULTS, 'test_plugins', 'ANSIBLE_TEST_PLUGINS', '~/.ansible/plugins/test:/usr/share/ansible/plugins/test', value_type='pathlist')
|
DEFAULT_TEST_PLUGIN_PATH = get_config(p, DEFAULTS, 'test_plugins', 'ANSIBLE_TEST_PLUGINS', '~/.ansible/plugins/test:/usr/share/ansible/plugins/test', value_type='pathlist')
|
||||||
DEFAULT_STRATEGY_PLUGIN_PATH = get_config(p, DEFAULTS, 'strategy_plugins', 'ANSIBLE_STRATEGY_PLUGINS', '~/.ansible/plugins/strategy:/usr/share/ansible/plugins/strategy', value_type='pathlist')
|
DEFAULT_STRATEGY_PLUGIN_PATH = get_config(p, DEFAULTS, 'strategy_plugins', 'ANSIBLE_STRATEGY_PLUGINS', '~/.ansible/plugins/strategy:/usr/share/ansible/plugins/strategy', value_type='pathlist')
|
||||||
|
DEFAULT_STRATEGY = get_config(p, DEFAULTS, 'strategy', 'ANSIBLE_STRATEGY', 'linear')
|
||||||
DEFAULT_STDOUT_CALLBACK = get_config(p, DEFAULTS, 'stdout_callback', 'ANSIBLE_STDOUT_CALLBACK', 'default')
|
DEFAULT_STDOUT_CALLBACK = get_config(p, DEFAULTS, 'stdout_callback', 'ANSIBLE_STDOUT_CALLBACK', 'default')
|
||||||
# cache
|
# cache
|
||||||
CACHE_PLUGIN = get_config(p, DEFAULTS, 'fact_caching', 'ANSIBLE_CACHE_PLUGIN', 'memory')
|
CACHE_PLUGIN = get_config(p, DEFAULTS, 'fact_caching', 'ANSIBLE_CACHE_PLUGIN', 'memory')
|
||||||
|
|
|
@ -20,6 +20,7 @@ from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
from ansible.compat.six import string_types
|
from ansible.compat.six import string_types
|
||||||
|
from ansible import constants as C
|
||||||
|
|
||||||
from ansible.errors import AnsibleParserError
|
from ansible.errors import AnsibleParserError
|
||||||
|
|
||||||
|
@ -88,7 +89,7 @@ class Play(Base, Taggable, Become):
|
||||||
_force_handlers = FieldAttribute(isa='bool', always_post_validate=True)
|
_force_handlers = FieldAttribute(isa='bool', always_post_validate=True)
|
||||||
_max_fail_percentage = FieldAttribute(isa='percent', always_post_validate=True)
|
_max_fail_percentage = FieldAttribute(isa='percent', always_post_validate=True)
|
||||||
_serial = FieldAttribute(isa='list', default=[], always_post_validate=True)
|
_serial = FieldAttribute(isa='list', default=[], always_post_validate=True)
|
||||||
_strategy = FieldAttribute(isa='string', default='linear', always_post_validate=True)
|
_strategy = FieldAttribute(isa='string', default=C.DEFAULT_STRATEGY, always_post_validate=True)
|
||||||
|
|
||||||
# =================================================================================
|
# =================================================================================
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue