diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 10:25:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 10:25:14 +0000 |
commit | 96cd7fb2ad41201fb0fde67c72d9d1a7b2d7314c (patch) | |
tree | 0dd89714f15a9ca8956957cfd991a9b6765044dc /lib | |
parent | Adding upstream version 2.17.2. (diff) | |
download | ansible-core-96cd7fb2ad41201fb0fde67c72d9d1a7b2d7314c.tar.xz ansible-core-96cd7fb2ad41201fb0fde67c72d9d1a7b2d7314c.zip |
Adding upstream version 2.17.3.upstream/2.17.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ansible/config/base.yml | 4 | ||||
-rw-r--r-- | lib/ansible/module_utils/ansible_release.py | 2 | ||||
-rw-r--r-- | lib/ansible/modules/debconf.py | 8 | ||||
-rw-r--r-- | lib/ansible/playbook/base.py | 3 | ||||
-rw-r--r-- | lib/ansible/plugins/strategy/linear.py | 66 | ||||
-rw-r--r-- | lib/ansible/plugins/test/any.yml | 4 | ||||
-rw-r--r-- | lib/ansible/release.py | 2 | ||||
-rw-r--r-- | lib/ansible_core.egg-info/PKG-INFO | 2 | ||||
-rw-r--r-- | lib/ansible_core.egg-info/SOURCES.txt | 67 |
9 files changed, 37 insertions, 121 deletions
diff --git a/lib/ansible/config/base.yml b/lib/ansible/config/base.yml index b4c2ae5..c6f6dee 100644 --- a/lib/ansible/config/base.yml +++ b/lib/ansible/config/base.yml @@ -855,8 +855,8 @@ DEFAULT_MODULE_COMPRESSION: env: [] ini: - {key: module_compression, section: defaults} -# vars: -# - name: ansible_module_compression + vars: + - name: ansible_module_compression DEFAULT_MODULE_NAME: name: Default adhoc module default: command diff --git a/lib/ansible/module_utils/ansible_release.py b/lib/ansible/module_utils/ansible_release.py index 8d3f49b..b264d43 100644 --- a/lib/ansible/module_utils/ansible_release.py +++ b/lib/ansible/module_utils/ansible_release.py @@ -17,6 +17,6 @@ from __future__ import annotations -__version__ = '2.17.2' +__version__ = '2.17.3' __author__ = 'Ansible, Inc.' __codename__ = "Gallows Pole" diff --git a/lib/ansible/modules/debconf.py b/lib/ansible/modules/debconf.py index 779952e..259d92b 100644 --- a/lib/ansible/modules/debconf.py +++ b/lib/ansible/modules/debconf.py @@ -173,8 +173,6 @@ def set_selection(module, pkg, question, vtype, value, unseen): if unseen: cmd.append('-u') - if vtype == 'boolean': - value = value.lower() data = ' '.join([pkg, question, vtype, value]) return module.run_command(cmd, data=data) @@ -209,15 +207,17 @@ def main(): if vtype is None or value is None: module.fail_json(msg="when supplying a question you must supply a valid vtype and value") + # ensure we compare booleans supplied to the way debconf sees them (true/false strings) + if vtype == 'boolean': + value = to_text(value).lower() + # if question doesn't exist, value cannot match if question not in prev: changed = True else: existing = prev[question] - # ensure we compare booleans supplied to the way debconf sees them (true/false strings) if vtype == 'boolean': - value = to_text(value).lower() existing = to_text(prev[question]).lower() elif vtype == 'password': existing = get_password_value(module, pkg, question, vtype) diff --git a/lib/ansible/playbook/base.py b/lib/ansible/playbook/base.py index 96c3b98..df18ecb 100644 --- a/lib/ansible/playbook/base.py +++ b/lib/ansible/playbook/base.py @@ -589,10 +589,11 @@ class FieldAttributeBase: _validate_variable_keys(ds) return combine_vars(self.vars, ds) elif isinstance(ds, list): + line_file = getattr(ds, 'ansible_pos', ("unknown", 0)) display.deprecated( ( 'Specifying a list of dictionaries for vars is deprecated in favor of ' - 'specifying a dictionary.' + 'specifying a dictionary. Error occurred in the file: %s, line: %d' % (line_file[0], line_file[1]) ), version='2.18' ) diff --git a/lib/ansible/plugins/strategy/linear.py b/lib/ansible/plugins/strategy/linear.py index d9e5d42..3c974e9 100644 --- a/lib/ansible/plugins/strategy/linear.py +++ b/lib/ansible/plugins/strategy/linear.py @@ -31,7 +31,6 @@ DOCUMENTATION = ''' from ansible import constants as C from ansible.errors import AnsibleError, AnsibleAssertionError, AnsibleParserError -from ansible.executor.play_iterator import IteratingStates from ansible.module_utils.common.text.converters import to_text from ansible.playbook.handler import Handler from ansible.playbook.included_file import IncludedFile @@ -46,12 +45,6 @@ display = Display() class StrategyModule(StrategyBase): - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - - # used for the lockstep to indicate to run handlers - self._in_handlers = False - def _get_next_task_lockstep(self, hosts, iterator): ''' Returns a list of (host, task) tuples, where the task may @@ -73,52 +66,35 @@ class StrategyModule(StrategyBase): if not state_task_per_host: return [(h, None) for h in hosts] - if self._in_handlers and not any(filter( - lambda rs: rs == IteratingStates.HANDLERS, - (s.run_state for s, dummy in state_task_per_host.values())) - ): - self._in_handlers = False - - if self._in_handlers: - lowest_cur_handler = min( - s.cur_handlers_task for s, t in state_task_per_host.values() - if s.run_state == IteratingStates.HANDLERS - ) - else: - task_uuids = [t._uuid for s, t in state_task_per_host.values()] - _loop_cnt = 0 - while _loop_cnt <= 1: - try: - cur_task = iterator.all_tasks[iterator.cur_task] - except IndexError: - # pick up any tasks left after clear_host_errors - iterator.cur_task = 0 - _loop_cnt += 1 - else: - iterator.cur_task += 1 - if cur_task._uuid in task_uuids: - break + task_uuids = {t._uuid for s, t in state_task_per_host.values()} + _loop_cnt = 0 + while _loop_cnt <= 1: + try: + cur_task = iterator.all_tasks[iterator.cur_task] + except IndexError: + # pick up any tasks left after clear_host_errors + iterator.cur_task = 0 + _loop_cnt += 1 else: - # prevent infinite loop - raise AnsibleAssertionError( - 'BUG: There seems to be a mismatch between tasks in PlayIterator and HostStates.' - ) + iterator.cur_task += 1 + if cur_task._uuid in task_uuids: + break + else: + # prevent infinite loop + raise AnsibleAssertionError( + 'BUG: There seems to be a mismatch between tasks in PlayIterator and HostStates.' + ) host_tasks = [] for host, (state, task) in state_task_per_host.items(): - if ((self._in_handlers and lowest_cur_handler == state.cur_handlers_task) or - (not self._in_handlers and cur_task._uuid == task._uuid)): + if cur_task._uuid == task._uuid: iterator.set_state_for_host(host.name, state) host_tasks.append((host, task)) else: host_tasks.append((host, noop_task)) - # once hosts synchronize on 'flush_handlers' lockstep enters - # '_in_handlers' phase where handlers are run instead of tasks - # until at least one host is in IteratingStates.HANDLERS - if (not self._in_handlers and cur_task.action in C._ACTION_META and - cur_task.args.get('_raw_params') == 'flush_handlers'): - self._in_handlers = True + if cur_task.action in C._ACTION_META and cur_task.args.get('_raw_params') == 'flush_handlers': + iterator.all_tasks[iterator.cur_task:iterator.cur_task] = [h for b in iterator._play.handlers for h in b.block] return host_tasks @@ -310,7 +286,7 @@ class StrategyModule(StrategyBase): final_block = new_block.filter_tagged_tasks(task_vars) display.debug("done filtering new block on tags") - included_tasks.extend(final_block.get_tasks()) + included_tasks.extend(final_block.get_tasks()) for host in hosts_left: if host in included_file._hosts: diff --git a/lib/ansible/plugins/test/any.yml b/lib/ansible/plugins/test/any.yml index 42b9182..e30ff22 100644 --- a/lib/ansible/plugins/test/any.yml +++ b/lib/ansible/plugins/test/any.yml @@ -2,7 +2,7 @@ DOCUMENTATION: name: any author: Ansible Core version_added: "2.4" - short_description: is any conditions in a list true + short_description: is any condition in a list true description: - This test checks each condition in a list for truthiness. - Same as the C(any) Python function. @@ -14,7 +14,7 @@ DOCUMENTATION: required: True EXAMPLES: | varexpression: "{{ 3 == 3 }}" - # are all statements true? + # is any statement true? {{ [false, booleanvar, varexpression] is any}} RETURN: diff --git a/lib/ansible/release.py b/lib/ansible/release.py index 8d3f49b..b264d43 100644 --- a/lib/ansible/release.py +++ b/lib/ansible/release.py @@ -17,6 +17,6 @@ from __future__ import annotations -__version__ = '2.17.2' +__version__ = '2.17.3' __author__ = 'Ansible, Inc.' __codename__ = "Gallows Pole" diff --git a/lib/ansible_core.egg-info/PKG-INFO b/lib/ansible_core.egg-info/PKG-INFO index b62b8dd..ff50c3a 100644 --- a/lib/ansible_core.egg-info/PKG-INFO +++ b/lib/ansible_core.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: ansible-core -Version: 2.17.2 +Version: 2.17.3 Summary: Radically simple IT automation Home-page: https://ansible.com/ Author: Ansible, Inc. diff --git a/lib/ansible_core.egg-info/SOURCES.txt b/lib/ansible_core.egg-info/SOURCES.txt index 6aa9d9d..97e8061 100644 --- a/lib/ansible_core.egg-info/SOURCES.txt +++ b/lib/ansible_core.egg-info/SOURCES.txt @@ -2051,6 +2051,9 @@ test/integration/targets/handlers/force_handlers_blocks_81533-2.yml test/integration/targets/handlers/from_handlers.yml test/integration/targets/handlers/handlers.yml test/integration/targets/handlers/handlers_lockstep_82307.yml +test/integration/targets/handlers/handlers_lockstep_83019-include-nested.yml +test/integration/targets/handlers/handlers_lockstep_83019-include.yml +test/integration/targets/handlers/handlers_lockstep_83019.yml test/integration/targets/handlers/include_handlers_fail_force-handlers.yml test/integration/targets/handlers/include_handlers_fail_force.yml test/integration/targets/handlers/inventory.handlers @@ -2189,37 +2192,6 @@ test/integration/targets/incidental_ios_file/tasks/cli.yaml test/integration/targets/incidental_ios_file/tasks/main.yaml test/integration/targets/incidental_ios_file/tests/cli/net_get.yaml test/integration/targets/incidental_ios_file/tests/cli/net_put.yaml -test/integration/targets/incidental_vyos_config/aliases -test/integration/targets/incidental_vyos_config/defaults/main.yaml -test/integration/targets/incidental_vyos_config/tasks/cli.yaml -test/integration/targets/incidental_vyos_config/tasks/cli_config.yaml -test/integration/targets/incidental_vyos_config/tasks/main.yaml -test/integration/targets/incidental_vyos_config/tests/cli/backup.yaml -test/integration/targets/incidental_vyos_config/tests/cli/check_config.yaml -test/integration/targets/incidental_vyos_config/tests/cli/comment.yaml -test/integration/targets/incidental_vyos_config/tests/cli/config.cfg -test/integration/targets/incidental_vyos_config/tests/cli/save.yaml -test/integration/targets/incidental_vyos_config/tests/cli/simple.yaml -test/integration/targets/incidental_vyos_config/tests/cli_config/cli_backup.yaml -test/integration/targets/incidental_vyos_config/tests/cli_config/cli_basic.yaml -test/integration/targets/incidental_vyos_config/tests/cli_config/cli_comment.yaml -test/integration/targets/incidental_vyos_lldp_interfaces/aliases -test/integration/targets/incidental_vyos_lldp_interfaces/defaults/main.yaml -test/integration/targets/incidental_vyos_lldp_interfaces/meta/main.yaml -test/integration/targets/incidental_vyos_lldp_interfaces/tasks/cli.yaml -test/integration/targets/incidental_vyos_lldp_interfaces/tasks/main.yaml -test/integration/targets/incidental_vyos_lldp_interfaces/tests/cli/_populate.yaml -test/integration/targets/incidental_vyos_lldp_interfaces/tests/cli/_populate_intf.yaml -test/integration/targets/incidental_vyos_lldp_interfaces/tests/cli/_remove_config.yaml -test/integration/targets/incidental_vyos_lldp_interfaces/tests/cli/deleted.yaml -test/integration/targets/incidental_vyos_lldp_interfaces/tests/cli/empty_config.yaml -test/integration/targets/incidental_vyos_lldp_interfaces/tests/cli/merged.yaml -test/integration/targets/incidental_vyos_lldp_interfaces/tests/cli/overridden.yaml -test/integration/targets/incidental_vyos_lldp_interfaces/tests/cli/replaced.yaml -test/integration/targets/incidental_vyos_lldp_interfaces/tests/cli/rtt.yaml -test/integration/targets/incidental_vyos_lldp_interfaces/vars/main.yaml -test/integration/targets/incidental_vyos_prepare_tests/aliases -test/integration/targets/incidental_vyos_prepare_tests/tasks/main.yaml test/integration/targets/incidental_win_reboot/aliases test/integration/targets/incidental_win_reboot/tasks/main.yml test/integration/targets/incidental_win_reboot/templates/post_reboot.ps1 @@ -2979,11 +2951,6 @@ test/integration/targets/module_utils_urls/aliases test/integration/targets/module_utils_urls/library/test_peercert.py test/integration/targets/module_utils_urls/meta/main.yml test/integration/targets/module_utils_urls/tasks/main.yml -test/integration/targets/network_cli/aliases -test/integration/targets/network_cli/passworded_user.yml -test/integration/targets/network_cli/runme.sh -test/integration/targets/network_cli/setup.yml -test/integration/targets/network_cli/teardown.yml test/integration/targets/no_log/aliases test/integration/targets/no_log/dynamic.yml test/integration/targets/no_log/no_log_config.yml @@ -4319,34 +4286,6 @@ test/support/network-integration/collections/ansible_collections/cisco/ios/plugi test/support/network-integration/collections/ansible_collections/cisco/ios/plugins/modules/ios_command.py test/support/network-integration/collections/ansible_collections/cisco/ios/plugins/modules/ios_config.py test/support/network-integration/collections/ansible_collections/cisco/ios/plugins/terminal/ios.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/action/vyos.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/cliconf/vyos.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/doc_fragments/vyos.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/vyos.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/argspec/facts/facts.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/argspec/firewall_rules/firewall_rules.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/argspec/interfaces/interfaces.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/argspec/l3_interfaces/l3_interfaces.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/argspec/lag_interfaces/lag_interfaces.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/argspec/lldp_global/lldp_global.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/argspec/lldp_interfaces/lldp_interfaces.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/argspec/static_routes/static_routes.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/config/lldp_interfaces/lldp_interfaces.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/facts/facts.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/facts/firewall_rules/firewall_rules.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/facts/interfaces/interfaces.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/facts/lag_interfaces/lag_interfaces.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/facts/legacy/base.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/facts/lldp_global/lldp_global.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/facts/lldp_interfaces/lldp_interfaces.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/facts/static_routes/static_routes.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/utils/utils.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/modules/vyos_command.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/modules/vyos_config.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/modules/vyos_facts.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/modules/vyos_lldp_interfaces.py -test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/terminal/vyos.py test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/action/win_copy.py test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/action/win_reboot.py test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/module_utils/WebRequest.psm1 |