From 3cda7ad4dd15b514ff660905294b5b6330ecfb6f Mon Sep 17 00:00:00 2001 From: Lee Garrett Date: Wed, 1 Mar 2023 21:04:53 +0100 Subject: New upstream version 2.14.3 --- lib/ansible/executor/task_executor.py | 4 ++++ lib/ansible/galaxy/collection/__init__.py | 1 + lib/ansible/module_utils/ansible_release.py | 2 +- lib/ansible/module_utils/csharp/Ansible.Basic.cs | 4 ++++ lib/ansible/modules/dnf.py | 8 ++++++++ lib/ansible/modules/uri.py | 14 +++++++------- lib/ansible/modules/user.py | 11 ++++++----- lib/ansible/playbook/helpers.py | 2 ++ lib/ansible/plugins/doc_fragments/files.py | 2 ++ lib/ansible/plugins/filter/combine.yml | 1 - lib/ansible/plugins/strategy/__init__.py | 6 +++++- lib/ansible/plugins/strategy/linear.py | 6 +----- lib/ansible/release.py | 2 +- lib/ansible_core.egg-info/PKG-INFO | 2 +- lib/ansible_core.egg-info/SOURCES.txt | 21 ++++++++++++++------- 15 files changed, 57 insertions(+), 29 deletions(-) (limited to 'lib') diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index 1f35031f..02ace8f5 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -515,6 +515,10 @@ class TaskExecutor: "(see https://docs.ansible.com/ansible/devel/reference_appendices/faq.html#argsplat-unsafe)") variable_params.update(self._task.args) self._task.args = variable_params + else: + # if we didn't get a dict, it means there's garbage remaining after k=v parsing, just give up + # see https://github.com/ansible/ansible/issues/79862 + raise AnsibleError(f"invalid or malformed argument: '{variable_params}'") # update no_log to task value, now that we have it templated no_log = self._task.no_log diff --git a/lib/ansible/galaxy/collection/__init__.py b/lib/ansible/galaxy/collection/__init__.py index 7f04052e..7a144c0d 100644 --- a/lib/ansible/galaxy/collection/__init__.py +++ b/lib/ansible/galaxy/collection/__init__.py @@ -1570,6 +1570,7 @@ def install_src(collection, b_collection_path, b_collection_output_path, artifac if 'build_ignore' not in collection_meta: # installed collection, not src # FIXME: optimize this? use a different process? copy instead of build? collection_meta['build_ignore'] = [] + collection_meta['manifest'] = Sentinel collection_manifest = _build_manifest(**collection_meta) file_manifest = _build_files_manifest( b_collection_path, diff --git a/lib/ansible/module_utils/ansible_release.py b/lib/ansible/module_utils/ansible_release.py index 7a2e435b..66a04b98 100644 --- a/lib/ansible/module_utils/ansible_release.py +++ b/lib/ansible/module_utils/ansible_release.py @@ -19,6 +19,6 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -__version__ = '2.14.2' +__version__ = '2.14.3' __author__ = 'Ansible, Inc.' __codename__ = "C'mon Everybody" diff --git a/lib/ansible/module_utils/csharp/Ansible.Basic.cs b/lib/ansible/module_utils/csharp/Ansible.Basic.cs index 2db9728d..c68281ef 100644 --- a/lib/ansible/module_utils/csharp/Ansible.Basic.cs +++ b/lib/ansible/module_utils/csharp/Ansible.Basic.cs @@ -16,6 +16,10 @@ using Newtonsoft.Json; using System.Web.Script.Serialization; #endif +// Newtonsoft.Json may reference a different System.Runtime version (6.x) than loaded by PowerShell 7.3 (7.x). +// Ignore CS1701 so the code can be compiled when warnings are reported as errors. +//NoWarn -Name CS1701 -CLR Core + // System.Diagnostics.EventLog.dll reference different versioned dlls that are // loaded in PSCore, ignore CS1702 so the code will ignore this warning //NoWarn -Name CS1702 -CLR Core diff --git a/lib/ansible/modules/dnf.py b/lib/ansible/modules/dnf.py index a3b09908..8131833e 100644 --- a/lib/ansible/modules/dnf.py +++ b/lib/ansible/modules/dnf.py @@ -313,6 +313,14 @@ EXAMPLES = ''' name: "*" state: latest +- name: Update the webserver, depending on which is installed on the system. Do not install the other one + ansible.builtin.dnf: + name: + - httpd + - nginx + state: latest + update_only: yes + - name: Install the nginx rpm from a remote repo ansible.builtin.dnf: name: 'http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm' diff --git a/lib/ansible/modules/uri.py b/lib/ansible/modules/uri.py index c0021364..f68b86a5 100644 --- a/lib/ansible/modules/uri.py +++ b/lib/ansible/modules/uri.py @@ -142,7 +142,7 @@ options: - This should only set to C(false) used on personally controlled sites using self-signed certificates. - Prior to 1.9.2 the code defaulted to C(false). type: bool - default: yes + default: true version_added: '1.9.2' client_cert: description: @@ -184,7 +184,7 @@ options: description: - If C(false), it will not use a proxy, even if one is defined in an environment variable on the target hosts. type: bool - default: yes + default: true unix_socket: description: - Path to Unix domain socket to use for connection @@ -252,7 +252,7 @@ EXAMPLES = r''' - name: Check that a page returns a status 200 and fail if the word AWESOME is not in the page contents ansible.builtin.uri: url: http://www.example.com - return_content: yes + return_content: true register: this failed_when: "'AWESOME' not in this.content" @@ -263,7 +263,7 @@ EXAMPLES = r''' password: your_pass method: POST body: "{{ lookup('ansible.builtin.file','issue.json') }}" - force_basic_auth: yes + force_basic_auth: true status_code: 201 body_format: json @@ -310,7 +310,7 @@ EXAMPLES = r''' ansible.builtin.uri: url: https://your.form.based.auth.example.com/dashboard.php method: GET - return_content: yes + return_content: true headers: Cookie: "{{ login.cookies_string }}" @@ -320,7 +320,7 @@ EXAMPLES = r''' user: "{{ jenkins.user }}" password: "{{ jenkins.password }}" method: GET - force_basic_auth: yes + force_basic_auth: true status_code: 201 - name: POST from contents of local file @@ -334,7 +334,7 @@ EXAMPLES = r''' url: https://httpbin.org/post method: POST src: /path/to/my/file.json - remote_src: yes + remote_src: true - name: Create workspaces in Log analytics Azure ansible.builtin.uri: diff --git a/lib/ansible/modules/user.py b/lib/ansible/modules/user.py index cb35e950..2fc4e473 100644 --- a/lib/ansible/modules/user.py +++ b/lib/ansible/modules/user.py @@ -86,12 +86,13 @@ options: version_added: "2.0" password: description: - - Optionally set the user's password to this crypted value. - - On macOS systems, this value has to be cleartext. Beware of security issues. - - To create a an account with a locked/disabled password on Linux systems, set this to C('!') or C('*'). - - To create a an account with a locked/disabled password on OpenBSD, set this to C('*************'). + - If provided, set the user's password to the provided encrypted hash (Linux) or plain text password (macOS). + - B(Linux/Unix/POSIX:) Enter the hashed password as the value. - See L(FAQ entry,https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-generate-encrypted-passwords-for-the-user-module) - for details on various ways to generate these password values. + for details on various ways to generate the hash of a password. + - To create an account with a locked/disabled password on Linux systems, set this to C('!') or C('*'). + - To create an account with a locked/disabled password on OpenBSD, set this to C('*************'). + - B(OS X/macOS:) Enter the cleartext password as the value. Be sure to take relevant security precautions. type: str state: description: diff --git a/lib/ansible/playbook/helpers.py b/lib/ansible/playbook/helpers.py index 444f571e..38e32ef9 100644 --- a/lib/ansible/playbook/helpers.py +++ b/lib/ansible/playbook/helpers.py @@ -106,6 +106,8 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h raise AnsibleAssertionError('The ds (%s) should be a dict but was a %s' % (ds, type(ds))) if 'block' in task_ds: + if use_handlers: + raise AnsibleParserError("Using a block as a handler is not supported.", obj=task_ds) t = Block.load( task_ds, play=play, diff --git a/lib/ansible/plugins/doc_fragments/files.py b/lib/ansible/plugins/doc_fragments/files.py index 2356bd72..b87fd11d 100644 --- a/lib/ansible/plugins/doc_fragments/files.py +++ b/lib/ansible/plugins/doc_fragments/files.py @@ -36,6 +36,8 @@ options: - Name of the user that should own the filesystem object, as would be fed to I(chown). - When left unspecified, it uses the current user unless you are root, in which case it can preserve the previous ownership. + - Specifying a numeric username will be assumed to be a user ID and not a username. Avoid numeric usernames to avoid this confusion. + type: str group: description: diff --git a/lib/ansible/plugins/filter/combine.yml b/lib/ansible/plugins/filter/combine.yml index f2f43718..86788f31 100644 --- a/lib/ansible/plugins/filter/combine.yml +++ b/lib/ansible/plugins/filter/combine.yml @@ -36,7 +36,6 @@ EXAMPLES: | # ab => {'a':1, 'b':3, 'c': 4} ab: {{ {'a':1, 'b':2} | combine({'b':3, 'c':4}) }} - # ab => {'a':1, 'b':3, 'c': 4} many: "{{ dict1 | combine(dict2, dict3, dict4) }}" RETURN: diff --git a/lib/ansible/plugins/strategy/__init__.py b/lib/ansible/plugins/strategy/__init__.py index e3c4b02d..5cc05ee3 100644 --- a/lib/ansible/plugins/strategy/__init__.py +++ b/lib/ansible/plugins/strategy/__init__.py @@ -54,7 +54,7 @@ from ansible.template import Templar from ansible.utils.display import Display from ansible.utils.fqcn import add_internal_fqcns from ansible.utils.unsafe_proxy import wrap_var -from ansible.utils.vars import combine_vars +from ansible.utils.vars import combine_vars, isidentifier from ansible.vars.clean import strip_internal_keys, module_response_deepcopy display = Display() @@ -750,6 +750,10 @@ class StrategyBase: # register final results if original_task.register: + + if not isidentifier(original_task.register): + raise AnsibleError("Invalid variable name in 'register' specified: '%s'" % original_task.register) + host_list = self.get_task_hosts(iterator, original_host, original_task) clean_copy = strip_internal_keys(module_response_deepcopy(task_result._result)) diff --git a/lib/ansible/plugins/strategy/linear.py b/lib/ansible/plugins/strategy/linear.py index dc34e097..a3c91c29 100644 --- a/lib/ansible/plugins/strategy/linear.py +++ b/lib/ansible/plugins/strategy/linear.py @@ -314,11 +314,7 @@ class StrategyModule(StrategyBase): included_tasks.extend(final_block.get_tasks()) for host in hosts_left: - # handlers are included regardless of _hosts so noop - # tasks do not have to be created for lockstep, - # not notified handlers are then simply skipped - # in the PlayIterator - if host in included_file._hosts or is_handler: + if host in included_file._hosts: all_blocks[host].append(final_block) display.debug("done iterating over new_blocks loaded from include file") diff --git a/lib/ansible/release.py b/lib/ansible/release.py index 7a2e435b..66a04b98 100644 --- a/lib/ansible/release.py +++ b/lib/ansible/release.py @@ -19,6 +19,6 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -__version__ = '2.14.2' +__version__ = '2.14.3' __author__ = 'Ansible, Inc.' __codename__ = "C'mon Everybody" diff --git a/lib/ansible_core.egg-info/PKG-INFO b/lib/ansible_core.egg-info/PKG-INFO index b3beba17..0c7edcf5 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.14.2 +Version: 2.14.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 54f63989..9444d2ff 100644 --- a/lib/ansible_core.egg-info/SOURCES.txt +++ b/lib/ansible_core.egg-info/SOURCES.txt @@ -123,7 +123,6 @@ docs/docsite/rst/dev_guide/developing_modules_best_practices.rst docs/docsite/rst/dev_guide/developing_modules_checklist.rst docs/docsite/rst/dev_guide/developing_modules_documenting.rst docs/docsite/rst/dev_guide/developing_modules_general.rst -docs/docsite/rst/dev_guide/developing_modules_general_aci.rst docs/docsite/rst/dev_guide/developing_modules_general_windows.rst docs/docsite/rst/dev_guide/developing_modules_in_groups.rst docs/docsite/rst/dev_guide/developing_plugins.rst @@ -145,11 +144,6 @@ docs/docsite/rst/dev_guide/testing_sanity.rst docs/docsite/rst/dev_guide/testing_units.rst docs/docsite/rst/dev_guide/testing_units_modules.rst docs/docsite/rst/dev_guide/testing_validate-modules.rst -docs/docsite/rst/dev_guide/platforms/aws_guidelines.rst -docs/docsite/rst/dev_guide/platforms/openstack_guidelines.rst -docs/docsite/rst/dev_guide/platforms/ovirt_dev_guide.rst -docs/docsite/rst/dev_guide/platforms/vmware_guidelines.rst -docs/docsite/rst/dev_guide/platforms/vmware_rest_guidelines.rst docs/docsite/rst/dev_guide/shared_snippets/licensing.txt docs/docsite/rst/dev_guide/style_guide/basic_rules.rst docs/docsite/rst/dev_guide/style_guide/grammar_punctuation.rst @@ -1496,6 +1490,7 @@ test/integration/targets/ansible-galaxy-collection-scm/tasks/setup_collection_ba test/integration/targets/ansible-galaxy-collection-scm/tasks/setup_multi_collection_repo.yml test/integration/targets/ansible-galaxy-collection-scm/tasks/setup_recursive_scm_dependency.yml test/integration/targets/ansible-galaxy-collection-scm/tasks/test_invalid_version.yml +test/integration/targets/ansible-galaxy-collection-scm/tasks/test_manifest_metadata.yml test/integration/targets/ansible-galaxy-collection-scm/tasks/test_supported_resolvelib_versions.yml test/integration/targets/ansible-galaxy-collection-scm/templates/git_prefix_name.yml test/integration/targets/ansible-galaxy-collection-scm/templates/name_and_type.yml @@ -2574,6 +2569,8 @@ test/integration/targets/handlers/46447.yml test/integration/targets/handlers/52561.yml test/integration/targets/handlers/54991.yml test/integration/targets/handlers/58841.yml +test/integration/targets/handlers/79776-handlers.yml +test/integration/targets/handlers/79776.yml test/integration/targets/handlers/aliases test/integration/targets/handlers/from_handlers.yml test/integration/targets/handlers/handlers.yml @@ -2582,6 +2579,10 @@ test/integration/targets/handlers/include_handlers_fail_force.yml test/integration/targets/handlers/inventory.handlers test/integration/targets/handlers/order.yml test/integration/targets/handlers/runme.sh +test/integration/targets/handlers/test_block_as_handler-import.yml +test/integration/targets/handlers/test_block_as_handler-include.yml +test/integration/targets/handlers/test_block_as_handler-include_import-handlers.yml +test/integration/targets/handlers/test_block_as_handler.yml test/integration/targets/handlers/test_flush_handlers_as_handler.yml test/integration/targets/handlers/test_flush_handlers_rescue_always.yml test/integration/targets/handlers/test_flush_in_rescue_always.yml @@ -3660,6 +3661,11 @@ test/integration/targets/reboot/tasks/test_molly_guard.yml test/integration/targets/reboot/tasks/test_reboot_command.yml test/integration/targets/reboot/tasks/test_standard_scenarios.yml test/integration/targets/reboot/vars/main.yml +test/integration/targets/register/aliases +test/integration/targets/register/can_register.yml +test/integration/targets/register/invalid.yml +test/integration/targets/register/invalid_skipped.yml +test/integration/targets/register/runme.sh test/integration/targets/rel_plugin_loading/aliases test/integration/targets/rel_plugin_loading/notyaml.yml test/integration/targets/rel_plugin_loading/runme.sh @@ -3956,7 +3962,8 @@ test/integration/targets/task_ordering/meta/main.yml test/integration/targets/task_ordering/tasks/main.yml test/integration/targets/task_ordering/tasks/taskorder-include.yml test/integration/targets/tasks/aliases -test/integration/targets/tasks/tasks/main.yml +test/integration/targets/tasks/playbook.yml +test/integration/targets/tasks/runme.sh test/integration/targets/tempfile/aliases test/integration/targets/tempfile/meta/main.yml test/integration/targets/tempfile/tasks/main.yml -- cgit v1.2.3