From 3c597d8b045fcfd08704bcaa60ad19b37d301973 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 17 May 2022 13:45:04 +0200 Subject: [PATCH 01/20] Release 5.0.0. --- CHANGELOG.rst | 29 ++++++- changelogs/changelog.yaml | 75 +++++++++++++++++++ .../fragments/4065-onepassword-config.yml | 2 - ...35-pritunl-add-mac_addresses-parameter.yml | 3 - ..._dnsrecord-add_multiple_record_support.yml | 3 - .../fragments/4581-vmadm-improvements.yaml | 2 - .../4590-consul-fix-service-checks.yaml | 2 - .../4595-fix-VirtualMediaInsert-iLO4.yml | 10 --- changelogs/fragments/4600-mh-delegate.yaml | 2 - ...y-install-deprecate-ansible29-and-210.yaml | 2 - .../fragments/4612-time_filter_zero.yml | 2 - changelogs/fragments/4618-dig-dlv.yml | 2 - .../fragments/4621-terraform-py2-compat.yml | 2 - ...23-opentelemetry_bug_fix_include_tasks.yml | 2 - ...-opentelemetry_bug_fix_hardcoded_value.yml | 2 - .../fragments/4625-fix-filter-filenames.yml | 2 - .../4647-gconftool2-command-arg.yaml | 2 - .../fragments/4648-vmadm-improvements-2.yaml | 2 - .../4649-rax-files-objects-improvements.yaml | 2 - .../fragments/4650-zfs-improvements.yaml | 2 - .../fragments/4651-zypper-checkmode-fix.yaml | 2 - .../fragments/4660-mh-added-do-raise.yaml | 2 - changelogs/fragments/4662-yarn-emoji.yml | 2 - ...ab_hook-use-None-for-non-existent-attr.yml | 2 - changelogs/fragments/5.0.0.yml | 1 - 25 files changed, 101 insertions(+), 58 deletions(-) delete mode 100644 changelogs/fragments/4065-onepassword-config.yml delete mode 100644 changelogs/fragments/4535-pritunl-add-mac_addresses-parameter.yml delete mode 100644 changelogs/fragments/4578-ipa_dnsrecord-add_multiple_record_support.yml delete mode 100644 changelogs/fragments/4581-vmadm-improvements.yaml delete mode 100644 changelogs/fragments/4590-consul-fix-service-checks.yaml delete mode 100644 changelogs/fragments/4595-fix-VirtualMediaInsert-iLO4.yml delete mode 100644 changelogs/fragments/4600-mh-delegate.yaml delete mode 100644 changelogs/fragments/4601-ansible-galaxy-install-deprecate-ansible29-and-210.yaml delete mode 100644 changelogs/fragments/4612-time_filter_zero.yml delete mode 100644 changelogs/fragments/4618-dig-dlv.yml delete mode 100644 changelogs/fragments/4621-terraform-py2-compat.yml delete mode 100644 changelogs/fragments/4623-opentelemetry_bug_fix_include_tasks.yml delete mode 100644 changelogs/fragments/4624-opentelemetry_bug_fix_hardcoded_value.yml delete mode 100644 changelogs/fragments/4625-fix-filter-filenames.yml delete mode 100644 changelogs/fragments/4647-gconftool2-command-arg.yaml delete mode 100644 changelogs/fragments/4648-vmadm-improvements-2.yaml delete mode 100644 changelogs/fragments/4649-rax-files-objects-improvements.yaml delete mode 100644 changelogs/fragments/4650-zfs-improvements.yaml delete mode 100644 changelogs/fragments/4651-zypper-checkmode-fix.yaml delete mode 100644 changelogs/fragments/4660-mh-added-do-raise.yaml delete mode 100644 changelogs/fragments/4662-yarn-emoji.yml delete mode 100644 changelogs/fragments/4668-gitlab_hook-use-None-for-non-existent-attr.yml delete mode 100644 changelogs/fragments/5.0.0.yml diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 48944c099e..f8dd2fa678 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,13 +6,13 @@ Community General Release Notes This changelog describes changes after version 4.0.0. -v5.0.0-a1 -========= +v5.0.0 +====== Release Summary --------------- -Alpha release for community.general 5.0.0. +This is release 5.0.0 of ``community.general``, released on 2022-05-17. Major Changes ------------- @@ -23,6 +23,8 @@ Minor Changes ------------- - Avoid internal ansible-core module_utils in favor of equivalent public API available since at least Ansible 2.9. This fixes some instances added since the last time this was fixed (https://github.com/ansible-collections/community.general/pull/4232). +- ModuleHelper module utils - ``ModuleHelperBase` now delegates the attributes ``check_mode``, ``get_bin_path``, ``warn``, and ``deprecate`` to the underlying ``AnsibleModule`` instance (https://github.com/ansible-collections/community.general/pull/4600). +- ModuleHelper module utils - ``ModuleHelperBase`` now has a convenience method ``do_raise`` (https://github.com/ansible-collections/community.general/pull/4660). - Remove vendored copy of ``distutils.version`` in favor of vendored copy included with ansible-core 2.12+. For ansible-core 2.11, uses ``distutils.version`` for Python < 3.12. There is no support for ansible-core 2.11 with Python 3.12+ (https://github.com/ansible-collections/community.general/pull/3988). - aix_filesystem - calling ``run_command`` with arguments as ``list`` instead of ``str`` (https://github.com/ansible-collections/community.general/pull/3833). - aix_lvg - calling ``run_command`` with arguments as ``list`` instead of ``str`` (https://github.com/ansible-collections/community.general/pull/3834). @@ -48,6 +50,7 @@ Minor Changes - icinga2 inventory plugin - implemented constructed interface (https://github.com/ansible-collections/community.general/pull/4088). - icinga2 inventory plugin - inventory object names are changable using ``inventory_attr`` in your config file to the host object name, address, or display_name fields (https://github.com/ansible-collections/community.general/issues/3875, https://github.com/ansible-collections/community.general/pull/3906). - ip_netns - calling ``run_command`` with arguments as ``list`` instead of ``str`` (https://github.com/ansible-collections/community.general/pull/3822). +- ipa_dnsrecord - add new argument ``record_values``, mutually exclusive to ``record_value``, which supports multiple values for one record (https://github.com/ansible-collections/community.general/pull/4578). - ipa_dnszone - ``dynamicupdate`` is now a boolean parameter, instead of a string parameter accepting ``"true"`` and ``"false"``. Also the module is now idempotent with respect to ``dynamicupdate`` (https://github.com/ansible-collections/community.general/pull/3374). - ipa_dnszone - add DNS zone synchronization support (https://github.com/ansible-collections/community.general/pull/3374). - ipa_service - add ``skip_host_check`` parameter. (https://github.com/ansible-collections/community.general/pull/4417). @@ -106,6 +109,7 @@ Minor Changes - pacman - the module has been rewritten and is now much faster when using ``state=latest``. Operations are now done all packages at once instead of package per package and the configured output format of ``pacman`` no longer affect the module's operation. (https://github.com/ansible-collections/community.general/pull/3907, https://github.com/ansible-collections/community.general/issues/3783, https://github.com/ansible-collections/community.general/issues/4079) - passwordstore lookup plugin - add configurable ``lock`` and ``locktimeout`` options to avoid race conditions in itself and in the ``pass`` utility it calls. By default, the plugin now locks on write operations (https://github.com/ansible-collections/community.general/pull/4194). - pipx - added options ``editable`` and ``pip_args`` (https://github.com/ansible-collections/community.general/issues/4300). +- pritunl_user - add ``mac_addresses`` parameter (https://github.com/ansible-collections/community.general/pull/4535). - profitbricks - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567). - proxmox - add ``clone`` parameter (https://github.com/ansible-collections/community.general/pull/3930). - proxmox - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567). @@ -121,6 +125,8 @@ Minor Changes - proxmox_snap - fixed timeout value to correctly reflect time in seconds. The timeout was off by one second (https://github.com/ansible-collections/community.general/pull/4377). - puppet - remove deprecation for ``show_diff`` parameter. Its alias ``show-diff`` is still deprecated and will be removed in community.general 7.0.0 (https://github.com/ansible-collections/community.general/pull/3980). - python_requirements_info - returns python version broken down into its components, and some minor refactoring (https://github.com/ansible-collections/community.general/pull/3797). +- rax_files_objects - minor refactoring improving code quality (https://github.com/ansible-collections/community.general/pull/4649). +- redfish_* modules - the contents of ``@Message.ExtendedInfo`` will be returned as a string in the event that ``@Message.ExtendedInfo.Messages`` does not exist. This is likely more useful than the standard HTTP error (https://github.com/ansible-collections/community.general/pull/4596). - redfish_command - add ``GetHostInterfaces`` command to enable reporting Redfish Host Interface information (https://github.com/ansible-collections/community.general/issues/3693). - redfish_command - add ``IndicatorLedOn``, ``IndicatorLedOff``, and ``IndicatorLedBlink`` commands to the Systems category for controling system LEDs (https://github.com/ansible-collections/community.general/issues/4084). - redfish_command - add ``SetHostInterface`` command to enable configuring the Redfish Host Interface (https://github.com/ansible-collections/community.general/issues/3632). @@ -135,14 +141,18 @@ Minor Changes - svc - calling ``run_command`` with arguments as ``list`` instead of ``str`` (https://github.com/ansible-collections/community.general/pull/3829). - syslog_json - add option to skip logging of ``gather_facts`` playbook tasks; use v2 callback API (https://github.com/ansible-collections/community.general/pull/4223). - terraform - adds ``terraform_upgrade`` parameter which allows ``terraform init`` to satisfy new provider constraints in an existing Terraform project (https://github.com/ansible-collections/community.general/issues/4333). +- to_time_unit filter plugins - the time filters has been extended to also allow ``0`` as input (https://github.com/ansible-collections/community.general/pull/4612). - udm_group - minor refactoring (https://github.com/ansible-collections/community.general/pull/4556). - udm_share - minor refactoring (https://github.com/ansible-collections/community.general/pull/4556). - vmadm - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567). +- vmadm - minor refactoring and improvement on the module (https://github.com/ansible-collections/community.general/pull/4581). +- vmadm - minor refactoring and improvement on the module (https://github.com/ansible-collections/community.general/pull/4648). - webfaction_app - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567). - webfaction_db - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567). - xattr - calling ``run_command`` with arguments as ``list`` instead of ``str`` (https://github.com/ansible-collections/community.general/pull/3806). - xfconf - added missing value types ``char``, ``uchar``, ``int64`` and ``uint64`` (https://github.com/ansible-collections/community.general/pull/4534). - xfconf - minor refactor on the base class for the module (https://github.com/ansible-collections/community.general/pull/3919). +- zfs - minor refactoring in the code (https://github.com/ansible-collections/community.general/pull/4650). - zypper - add support for ``--clean-deps`` option to remove packages that depend on a package being removed (https://github.com/ansible-collections/community.general/pull/4195). Breaking Changes / Porting Guide @@ -154,15 +164,19 @@ Breaking Changes / Porting Guide - archive - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). - git_config - remove Ansible 2.9 and early ansible-base 2.10 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). - java_keystore - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). +- lists_mergeby and groupby_as_dict filter plugins - adjust filter plugin filename. This change is not visible to end-users, it only affects possible other collections importing Python paths (https://github.com/ansible-collections/community.general/pull/4625). - lists_mergeby filter plugin - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). - maven_artifact - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). - memcached cache plugin - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). - path_join filter plugin shim - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). - redis cache plugin - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). +- yarn - remove unsupported and unnecessary ``--no-emoji`` flag (https://github.com/ansible-collections/community.general/pull/4662). Deprecated Features ------------------- +- ansible_galaxy_install - deprecated support for ``ansible`` 2.9 and ``ansible-base`` 2.10 (https://github.com/ansible-collections/community.general/pull/4601). +- dig lookup plugin - the ``DLV`` record type has been decommissioned in 2017 and support for it will be removed from community.general 6.0.0 (https://github.com/ansible-collections/community.general/pull/4618). - gem - the default of the ``norc`` option has been deprecated and will change to ``true`` in community.general 6.0.0. Explicitly specify a value to avoid a deprecation warning (https://github.com/ansible-collections/community.general/pull/4517). - mail callback plugin - not specifying ``sender`` is deprecated and will be disallowed in community.general 6.0.0 (https://github.com/ansible-collections/community.general/pull/4140). - module_helper module utils - deprecated the attribute ``ModuleHelper.VarDict`` (https://github.com/ansible-collections/community.general/pull/3801). @@ -200,11 +214,13 @@ Bugfixes - alternatives - fix output parsing for alternatives groups (https://github.com/ansible-collections/community.general/pull/3976). - cargo - fix detection of outdated packages when ``state=latest`` (https://github.com/ansible-collections/community.general/pull/4052). - cargo - fix incorrectly reported changed status for packages with a name containing a hyphen (https://github.com/ansible-collections/community.general/issues/4044, https://github.com/ansible-collections/community.general/pull/4052). +- consul - fixed bug where class ``ConsulService`` was overwriting the field ``checks``, preventing the addition of checks to a service (https://github.com/ansible-collections/community.general/pull/4590). - counter_enabled callback plugin - fix output to correctly display host and task counters in serial mode (https://github.com/ansible-collections/community.general/pull/3709). - dconf - skip processes that disappeared while we inspected them (https://github.com/ansible-collections/community.general/issues/4151). - dnsmadeeasy - fix failure on deleting DNS entries when API response does not contain monitor value (https://github.com/ansible-collections/community.general/issues/3620). - dsv lookup plugin - raise an Ansible error if the wrong ``python-dsv-sdk`` version is installed (https://github.com/ansible-collections/community.general/pull/4422). - filesize - add support for busybox dd implementation, that is used by default on Alpine linux (https://github.com/ansible-collections/community.general/pull/4288, https://github.com/ansible-collections/community.general/issues/4259). +- gconftool2 - properly escape values when passing them to ``gconftool-2`` (https://github.com/ansible-collections/community.general/pull/4647). - git_branch - remove deprecated and unnecessary branch ``unprotect`` method (https://github.com/ansible-collections/community.general/pull/4496). - github_repo - ``private`` and ``description`` attributes should not be set to default values when the repo already exists (https://github.com/ansible-collections/community.general/pull/2386). - gitlab_group - improve searching for projects inside group on deletion (https://github.com/ansible-collections/community.general/pull/4491). @@ -212,6 +228,7 @@ Bugfixes - gitlab_group_variable - add missing documentation about GitLab versions that support ``environment_scope`` and ``variable_type`` (https://github.com/ansible-collections/community.general/pull/4038). - gitlab_group_variable - allow to set same variable name under different environment scopes. Due this change, the return value ``group_variable`` differs from previous version in check mode. It was counting ``updated`` values, because it was accidentally overwriting environment scopes (https://github.com/ansible-collections/community.general/pull/4038). - gitlab_group_variable - fix idempotent change behaviour for float and integer variables (https://github.com/ansible-collections/community.general/pull/4038). +- gitlab_hook - avoid errors during idempotency check when an attribute does not exist (https://github.com/ansible-collections/community.general/pull/4668). - gitlab_hook - handle more than 20 hooks when finding a hook (https://github.com/ansible-collections/community.general/pull/4491). - gitlab_project - handle more than 20 namespaces when finding a namespace (https://github.com/ansible-collections/community.general/pull/4491). - gitlab_project_members - handle more than 20 projects and users when finding a project resp. user (https://github.com/ansible-collections/community.general/pull/4491). @@ -248,8 +265,11 @@ Bugfixes - nmcli - fixed falsely reported changed status when ``mtu`` is omitted with ``dummy`` connections (https://github.com/ansible-collections/community.general/issues/3612, https://github.com/ansible-collections/community.general/pull/3625). - nmcli - pass ``flags``, ``ingress``, ``egress`` params to ``nmcli`` (https://github.com/ansible-collections/community.general/issues/1086). - nrdp callback plugin - fix error ``string arguments without an encoding`` (https://github.com/ansible-collections/community.general/issues/3903). +- onepassword - search all valid configuration locations and use the first found (https://github.com/ansible-collections/community.general/pull/4640). - opennebula inventory plugin - complete the implementation of ``constructable`` for opennebula inventory plugin. Now ``keyed_groups``, ``compose``, ``groups`` actually work (https://github.com/ansible-collections/community.general/issues/4497). - opentelemetry - fix generating a trace with a task containing ``no_log: true`` (https://github.com/ansible-collections/community.general/pull/4043). +- opentelemetry callback plugin - fix task message attribute that is reported failed regardless of the task result (https://github.com/ansible-collections/community.general/pull/4624). +- opentelemetry callback plugin - fix warning for the include_tasks (https://github.com/ansible-collections/community.general/pull/4623). - opentelemetry_plugin - honour ``ignore_errors`` when a task has failed instead of reporting an error (https://github.com/ansible-collections/community.general/pull/3837). - pacman - Use ``--groups`` instead of ``--group`` (https://github.com/ansible-collections/community.general/pull/4312). - pacman - fix URL based package installation (https://github.com/ansible-collections/community.general/pull/4286, https://github.com/ansible-collections/community.general/issues/4285). @@ -272,10 +292,12 @@ Bugfixes - proxmox_kvm - fix error when checking whether Proxmox VM exists (https://github.com/ansible-collections/community.general/pull/4287). - python_requirements_info - fails if version operator used without version (https://github.com/ansible-collections/community.general/pull/3785). - python_requirements_info - store ``mismatched`` return values per package as documented in the module (https://github.com/ansible-collections/community.general/pull/4078). +- redfish_command - the iLO4 Redfish implementation only supports the ``image_url`` parameter in the underlying API calls to ``VirtualMediaInsert`` and ``VirtualMediaEject``. Any values set (or the defaults) for ``write_protected`` or ``inserted`` will be ignored (https://github.com/ansible-collections/community.general/pull/4596). - say callback plugin - replace deprecated ``distutils.spawn.find_executable`` with Ansible's ``get_bin_path`` to find the ``say`` resp. ``espeak`` executables (https://github.com/ansible-collections/community.general/pull/3934). - scaleway_user_data - fix double-quote added where no double-quote is needed to user data in scaleway's server (``Content-type`` -> ``Content-Type``) (https://github.com/ansible-collections/community.general/pull/3940). - slack - add ``charset`` to HTTP headers to avoid Slack API warning (https://github.com/ansible-collections/community.general/issues/3932). - terraform - fix command options being ignored during planned/plan in function ``build_plan`` such as ``lock`` or ``lock_timeout`` (https://github.com/ansible-collections/community.general/issues/3707, https://github.com/ansible-collections/community.general/pull/3726). +- terraform - fix list initialization to support both Python 2 and Python 3 (https://github.com/ansible-collections/community.general/issues/4531). - vdo - fix options error (https://github.com/ansible-collections/community.general/pull/4163). - xattr - fix exception caused by ``_run_xattr()`` raising a ``ValueError`` due to a mishandling of base64-encoded value (https://github.com/ansible-collections/community.general/issues/3673). - xbps - fix error message that is reported when installing packages fails (https://github.com/ansible-collections/community.general/pull/4438). @@ -284,6 +306,7 @@ Bugfixes - yarn - fix missing ``~`` expansion in yarn global install folder which resulted in incorrect task status (https://github.com/ansible-collections/community.general/issues/4045, https://github.com/ansible-collections/community.general/pull/4048). - yum_versionlock - fix matching of existing entries with names passed to the module. Match yum and dnf lock format (https://github.com/ansible-collections/community.general/pull/4183). - zone connection plugin - replace deprecated ``distutils.spawn.find_executable`` with Ansible's ``get_bin_path`` to find the executable (https://github.com/ansible-collections/community.general/pull/3934). +- zypper - fix undefined variable when running in check mode (https://github.com/ansible-collections/community.general/pull/4667). - zypper - fixed bug that caused zypper to always report [ok] and do nothing on ``state=present`` when all packages in ``name`` had a version specification (https://github.com/ansible-collections/community.general/issues/4371, https://github.com/ansible-collections/community.general/pull/4421). Known Issues diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 4ae5ea7c43..93848ff41e 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -1,5 +1,80 @@ ancestor: 4.0.0 releases: + 5.0.0: + changes: + breaking_changes: + - lists_mergeby and groupby_as_dict filter plugins - adjust filter plugin filename. + This change is not visible to end-users, it only affects possible other collections + importing Python paths (https://github.com/ansible-collections/community.general/pull/4625). + - yarn - remove unsupported and unnecessary ``--no-emoji`` flag (https://github.com/ansible-collections/community.general/pull/4662). + bugfixes: + - consul - fixed bug where class ``ConsulService`` was overwriting the field + ``checks``, preventing the addition of checks to a service (https://github.com/ansible-collections/community.general/pull/4590). + - gconftool2 - properly escape values when passing them to ``gconftool-2`` (https://github.com/ansible-collections/community.general/pull/4647). + - gitlab_hook - avoid errors during idempotency check when an attribute does + not exist (https://github.com/ansible-collections/community.general/pull/4668). + - onepassword - search all valid configuration locations and use the first found + (https://github.com/ansible-collections/community.general/pull/4640). + - opentelemetry callback plugin - fix task message attribute that is reported + failed regardless of the task result (https://github.com/ansible-collections/community.general/pull/4624). + - opentelemetry callback plugin - fix warning for the include_tasks (https://github.com/ansible-collections/community.general/pull/4623). + - redfish_command - the iLO4 Redfish implementation only supports the ``image_url`` + parameter in the underlying API calls to ``VirtualMediaInsert`` and ``VirtualMediaEject``. + Any values set (or the defaults) for ``write_protected`` or ``inserted`` will + be ignored (https://github.com/ansible-collections/community.general/pull/4596). + - terraform - fix list initialization to support both Python 2 and Python 3 + (https://github.com/ansible-collections/community.general/issues/4531). + - zypper - fix undefined variable when running in check mode (https://github.com/ansible-collections/community.general/pull/4667). + deprecated_features: + - ansible_galaxy_install - deprecated support for ``ansible`` 2.9 and ``ansible-base`` + 2.10 (https://github.com/ansible-collections/community.general/pull/4601). + - dig lookup plugin - the ``DLV`` record type has been decommissioned in 2017 + and support for it will be removed from community.general 6.0.0 (https://github.com/ansible-collections/community.general/pull/4618). + minor_changes: + - ModuleHelper module utils - ``ModuleHelperBase` now delegates the attributes + ``check_mode``, ``get_bin_path``, ``warn``, and ``deprecate`` to the underlying + ``AnsibleModule`` instance (https://github.com/ansible-collections/community.general/pull/4600). + - ModuleHelper module utils - ``ModuleHelperBase`` now has a convenience method + ``do_raise`` (https://github.com/ansible-collections/community.general/pull/4660). + - ipa_dnsrecord - add new argument ``record_values``, mutually exclusive to + ``record_value``, which supports multiple values for one record (https://github.com/ansible-collections/community.general/pull/4578). + - pritunl_user - add ``mac_addresses`` parameter (https://github.com/ansible-collections/community.general/pull/4535). + - rax_files_objects - minor refactoring improving code quality (https://github.com/ansible-collections/community.general/pull/4649). + - redfish_* modules - the contents of ``@Message.ExtendedInfo`` will be returned + as a string in the event that ``@Message.ExtendedInfo.Messages`` does not + exist. This is likely more useful than the standard HTTP error (https://github.com/ansible-collections/community.general/pull/4596). + - to_time_unit filter plugins - the time filters has been extended to also allow + ``0`` as input (https://github.com/ansible-collections/community.general/pull/4612). + - vmadm - minor refactoring and improvement on the module (https://github.com/ansible-collections/community.general/pull/4581). + - vmadm - minor refactoring and improvement on the module (https://github.com/ansible-collections/community.general/pull/4648). + - zfs - minor refactoring in the code (https://github.com/ansible-collections/community.general/pull/4650). + release_summary: This is release 5.0.0 of ``community.general``, released on + 2022-05-17. + fragments: + - 4065-onepassword-config.yml + - 4535-pritunl-add-mac_addresses-parameter.yml + - 4578-ipa_dnsrecord-add_multiple_record_support.yml + - 4581-vmadm-improvements.yaml + - 4590-consul-fix-service-checks.yaml + - 4595-fix-VirtualMediaInsert-iLO4.yml + - 4600-mh-delegate.yaml + - 4601-ansible-galaxy-install-deprecate-ansible29-and-210.yaml + - 4612-time_filter_zero.yml + - 4618-dig-dlv.yml + - 4621-terraform-py2-compat.yml + - 4623-opentelemetry_bug_fix_include_tasks.yml + - 4624-opentelemetry_bug_fix_hardcoded_value.yml + - 4625-fix-filter-filenames.yml + - 4647-gconftool2-command-arg.yaml + - 4648-vmadm-improvements-2.yaml + - 4649-rax-files-objects-improvements.yaml + - 4650-zfs-improvements.yaml + - 4651-zypper-checkmode-fix.yaml + - 4660-mh-added-do-raise.yaml + - 4662-yarn-emoji.yml + - 4668-gitlab_hook-use-None-for-non-existent-attr.yml + - 5.0.0.yml + release_date: '2022-05-17' 5.0.0-a1: changes: breaking_changes: diff --git a/changelogs/fragments/4065-onepassword-config.yml b/changelogs/fragments/4065-onepassword-config.yml deleted file mode 100644 index 9d58a0e57f..0000000000 --- a/changelogs/fragments/4065-onepassword-config.yml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - onepassword - search all valid configuration locations and use the first found (https://github.com/ansible-collections/community.general/pull/4640). diff --git a/changelogs/fragments/4535-pritunl-add-mac_addresses-parameter.yml b/changelogs/fragments/4535-pritunl-add-mac_addresses-parameter.yml deleted file mode 100644 index 8a0626865d..0000000000 --- a/changelogs/fragments/4535-pritunl-add-mac_addresses-parameter.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -minor_changes: - - pritunl_user - add ``mac_addresses`` parameter (https://github.com/ansible-collections/community.general/pull/4535). diff --git a/changelogs/fragments/4578-ipa_dnsrecord-add_multiple_record_support.yml b/changelogs/fragments/4578-ipa_dnsrecord-add_multiple_record_support.yml deleted file mode 100644 index aef02c83d3..0000000000 --- a/changelogs/fragments/4578-ipa_dnsrecord-add_multiple_record_support.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -minor_changes: - - ipa_dnsrecord - add new argument ``record_values``, mutually exclusive to ``record_value``, which supports multiple values for one record (https://github.com/ansible-collections/community.general/pull/4578). diff --git a/changelogs/fragments/4581-vmadm-improvements.yaml b/changelogs/fragments/4581-vmadm-improvements.yaml deleted file mode 100644 index e6b1778e0e..0000000000 --- a/changelogs/fragments/4581-vmadm-improvements.yaml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - vmadm - minor refactoring and improvement on the module (https://github.com/ansible-collections/community.general/pull/4581). diff --git a/changelogs/fragments/4590-consul-fix-service-checks.yaml b/changelogs/fragments/4590-consul-fix-service-checks.yaml deleted file mode 100644 index 42a5562a0e..0000000000 --- a/changelogs/fragments/4590-consul-fix-service-checks.yaml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - consul - fixed bug where class ``ConsulService`` was overwriting the field ``checks``, preventing the addition of checks to a service (https://github.com/ansible-collections/community.general/pull/4590). diff --git a/changelogs/fragments/4595-fix-VirtualMediaInsert-iLO4.yml b/changelogs/fragments/4595-fix-VirtualMediaInsert-iLO4.yml deleted file mode 100644 index ae632e08a4..0000000000 --- a/changelogs/fragments/4595-fix-VirtualMediaInsert-iLO4.yml +++ /dev/null @@ -1,10 +0,0 @@ -bugfixes: - - redfish_command - the iLO4 Redfish implementation only supports the ``image_url`` parameter in - the underlying API calls to ``VirtualMediaInsert`` and ``VirtualMediaEject``. Any values set - (or the defaults) for ``write_protected`` or ``inserted`` will be ignored - (https://github.com/ansible-collections/community.general/pull/4596). -minor_changes: - - redfish_* modules - the contents of ``@Message.ExtendedInfo`` will be returned as a string in the event - that ``@Message.ExtendedInfo.Messages`` does not exist. This is likely more useful than the - standard HTTP error - (https://github.com/ansible-collections/community.general/pull/4596). diff --git a/changelogs/fragments/4600-mh-delegate.yaml b/changelogs/fragments/4600-mh-delegate.yaml deleted file mode 100644 index dadaefb0d7..0000000000 --- a/changelogs/fragments/4600-mh-delegate.yaml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - ModuleHelper module utils - ``ModuleHelperBase` now delegates the attributes ``check_mode``, ``get_bin_path``, ``warn``, and ``deprecate`` to the underlying ``AnsibleModule`` instance (https://github.com/ansible-collections/community.general/pull/4600). diff --git a/changelogs/fragments/4601-ansible-galaxy-install-deprecate-ansible29-and-210.yaml b/changelogs/fragments/4601-ansible-galaxy-install-deprecate-ansible29-and-210.yaml deleted file mode 100644 index 40b67375d6..0000000000 --- a/changelogs/fragments/4601-ansible-galaxy-install-deprecate-ansible29-and-210.yaml +++ /dev/null @@ -1,2 +0,0 @@ -deprecated_features: - - ansible_galaxy_install - deprecated support for ``ansible`` 2.9 and ``ansible-base`` 2.10 (https://github.com/ansible-collections/community.general/pull/4601). diff --git a/changelogs/fragments/4612-time_filter_zero.yml b/changelogs/fragments/4612-time_filter_zero.yml deleted file mode 100644 index 8129725055..0000000000 --- a/changelogs/fragments/4612-time_filter_zero.yml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - to_time_unit filter plugins - the time filters has been extended to also allow ``0`` as input (https://github.com/ansible-collections/community.general/pull/4612). diff --git a/changelogs/fragments/4618-dig-dlv.yml b/changelogs/fragments/4618-dig-dlv.yml deleted file mode 100644 index bc082d4093..0000000000 --- a/changelogs/fragments/4618-dig-dlv.yml +++ /dev/null @@ -1,2 +0,0 @@ -deprecated_features: - - "dig lookup plugin - the ``DLV`` record type has been decommissioned in 2017 and support for it will be removed from community.general 6.0.0 (https://github.com/ansible-collections/community.general/pull/4618)." diff --git a/changelogs/fragments/4621-terraform-py2-compat.yml b/changelogs/fragments/4621-terraform-py2-compat.yml deleted file mode 100644 index 4bceafba6c..0000000000 --- a/changelogs/fragments/4621-terraform-py2-compat.yml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - terraform - fix list initialization to support both Python 2 and Python 3 (https://github.com/ansible-collections/community.general/issues/4531). diff --git a/changelogs/fragments/4623-opentelemetry_bug_fix_include_tasks.yml b/changelogs/fragments/4623-opentelemetry_bug_fix_include_tasks.yml deleted file mode 100644 index a18ba62ef5..0000000000 --- a/changelogs/fragments/4623-opentelemetry_bug_fix_include_tasks.yml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - opentelemetry callback plugin - fix warning for the include_tasks (https://github.com/ansible-collections/community.general/pull/4623). diff --git a/changelogs/fragments/4624-opentelemetry_bug_fix_hardcoded_value.yml b/changelogs/fragments/4624-opentelemetry_bug_fix_hardcoded_value.yml deleted file mode 100644 index 53d241eca8..0000000000 --- a/changelogs/fragments/4624-opentelemetry_bug_fix_hardcoded_value.yml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - opentelemetry callback plugin - fix task message attribute that is reported failed regardless of the task result (https://github.com/ansible-collections/community.general/pull/4624). diff --git a/changelogs/fragments/4625-fix-filter-filenames.yml b/changelogs/fragments/4625-fix-filter-filenames.yml deleted file mode 100644 index d3c0eb5f92..0000000000 --- a/changelogs/fragments/4625-fix-filter-filenames.yml +++ /dev/null @@ -1,2 +0,0 @@ -breaking_changes: - - "lists_mergeby and groupby_as_dict filter plugins - adjust filter plugin filename. This change is not visible to end-users, it only affects possible other collections importing Python paths (https://github.com/ansible-collections/community.general/pull/4625)." diff --git a/changelogs/fragments/4647-gconftool2-command-arg.yaml b/changelogs/fragments/4647-gconftool2-command-arg.yaml deleted file mode 100644 index 12913a0b90..0000000000 --- a/changelogs/fragments/4647-gconftool2-command-arg.yaml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - gconftool2 - properly escape values when passing them to ``gconftool-2`` (https://github.com/ansible-collections/community.general/pull/4647). diff --git a/changelogs/fragments/4648-vmadm-improvements-2.yaml b/changelogs/fragments/4648-vmadm-improvements-2.yaml deleted file mode 100644 index 180173e779..0000000000 --- a/changelogs/fragments/4648-vmadm-improvements-2.yaml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - vmadm - minor refactoring and improvement on the module (https://github.com/ansible-collections/community.general/pull/4648). diff --git a/changelogs/fragments/4649-rax-files-objects-improvements.yaml b/changelogs/fragments/4649-rax-files-objects-improvements.yaml deleted file mode 100644 index f32f744620..0000000000 --- a/changelogs/fragments/4649-rax-files-objects-improvements.yaml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - rax_files_objects - minor refactoring improving code quality (https://github.com/ansible-collections/community.general/pull/4649). diff --git a/changelogs/fragments/4650-zfs-improvements.yaml b/changelogs/fragments/4650-zfs-improvements.yaml deleted file mode 100644 index 96df5f5bcd..0000000000 --- a/changelogs/fragments/4650-zfs-improvements.yaml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - zfs - minor refactoring in the code (https://github.com/ansible-collections/community.general/pull/4650). diff --git a/changelogs/fragments/4651-zypper-checkmode-fix.yaml b/changelogs/fragments/4651-zypper-checkmode-fix.yaml deleted file mode 100644 index 403e4eead6..0000000000 --- a/changelogs/fragments/4651-zypper-checkmode-fix.yaml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - zypper - fix undefined variable when running in check mode (https://github.com/ansible-collections/community.general/pull/4667). diff --git a/changelogs/fragments/4660-mh-added-do-raise.yaml b/changelogs/fragments/4660-mh-added-do-raise.yaml deleted file mode 100644 index 01585afb96..0000000000 --- a/changelogs/fragments/4660-mh-added-do-raise.yaml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - ModuleHelper module utils - ``ModuleHelperBase`` now has a convenience method ``do_raise`` (https://github.com/ansible-collections/community.general/pull/4660). diff --git a/changelogs/fragments/4662-yarn-emoji.yml b/changelogs/fragments/4662-yarn-emoji.yml deleted file mode 100644 index 696188dd9b..0000000000 --- a/changelogs/fragments/4662-yarn-emoji.yml +++ /dev/null @@ -1,2 +0,0 @@ -breaking_changes: - - yarn - remove unsupported and unnecessary ``--no-emoji`` flag (https://github.com/ansible-collections/community.general/pull/4662). diff --git a/changelogs/fragments/4668-gitlab_hook-use-None-for-non-existent-attr.yml b/changelogs/fragments/4668-gitlab_hook-use-None-for-non-existent-attr.yml deleted file mode 100644 index 45a3f9f0b9..0000000000 --- a/changelogs/fragments/4668-gitlab_hook-use-None-for-non-existent-attr.yml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - gitlab_hook - avoid errors during idempotency check when an attribute does not exist (https://github.com/ansible-collections/community.general/pull/4668). diff --git a/changelogs/fragments/5.0.0.yml b/changelogs/fragments/5.0.0.yml deleted file mode 100644 index 781eb782c8..0000000000 --- a/changelogs/fragments/5.0.0.yml +++ /dev/null @@ -1 +0,0 @@ -release_summary: This is release 5.0.0 of ``community.general``, released on 2022-05-17. From 8c2b2aeb83aaa590a4b93505143b1da9fc7bb592 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 17 May 2022 13:48:00 +0200 Subject: [PATCH 02/20] Update links. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e064b5f378..325456e994 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Community General Collection -[![Build Status](https://dev.azure.com/ansible/community.general/_apis/build/status/CI?branchName=main)](https://dev.azure.com/ansible/community.general/_build?definitionId=31) +[![Build Status](https://dev.azure.com/ansible/community.general/_apis/build/status/CI?branchName=stable-5)](https://dev.azure.com/ansible/community.general/_build?definitionId=31) [![Codecov](https://img.shields.io/codecov/c/github/ansible-collections/community.general)](https://codecov.io/gh/ansible-collections/community.general) This repository contains the `community.general` Ansible Collection. The collection is a part of the Ansible package and includes many modules and plugins supported by Ansible community which are not part of more specialized community collections. @@ -110,7 +110,7 @@ See the [Releasing guidelines](https://github.com/ansible/community-docs/blob/ma ## Release notes -See the [changelog](https://github.com/ansible-collections/community.general/blob/main/CHANGELOG.rst). +See the [changelog](https://github.com/ansible-collections/community.general/blob/stable-5/CHANGELOG.rst). ## Roadmap From 890cf636a0b066bb114e14a727f2ecf34778d668 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 17 May 2022 16:21:18 +0200 Subject: [PATCH 03/20] Next expected release is 5.1.0. --- galaxy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galaxy.yml b/galaxy.yml index 6dc58b3f0f..66b2fc746a 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,6 +1,6 @@ namespace: community name: general -version: 5.0.0 +version: 5.1.0 readme: README.md authors: - Ansible (https://github.com/ansible) From 056e16baa5a1fdd1263db56e4dae00d933d406c2 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 18 May 2022 07:47:16 +0200 Subject: [PATCH 04/20] Update lenovoxcc module for compatibility with the virtualMedia resource location from Manager to System (#4682) (#4685) * Update lenovoxcc module for compatibility due to redfish spec changes the virtualMedia resource location from Managers to Systems * Add changelogs fragment for PR 4682 * Update changelogs/fragments/4682-compatibility-virtualmedia-resource-location.yaml Co-authored-by: Felix Fontein Co-authored-by: Tami YY3 Pan Co-authored-by: Felix Fontein (cherry picked from commit 8db265f99b4b0d2d4e2b1c339d3a787ed7c9d806) Co-authored-by: jixj5 <66418293+jixj5@users.noreply.github.com> --- ...bility-virtualmedia-resource-location.yaml | 2 + .../lenovoxcc/xcc_redfish_command.py | 122 +++++++++++++++++- .../lenovoxcc/test_xcc_redfish_command.py | 28 ++-- 3 files changed, 133 insertions(+), 19 deletions(-) create mode 100644 changelogs/fragments/4682-compatibility-virtualmedia-resource-location.yaml diff --git a/changelogs/fragments/4682-compatibility-virtualmedia-resource-location.yaml b/changelogs/fragments/4682-compatibility-virtualmedia-resource-location.yaml new file mode 100644 index 0000000000..c15ee4d15c --- /dev/null +++ b/changelogs/fragments/4682-compatibility-virtualmedia-resource-location.yaml @@ -0,0 +1,2 @@ +bugfixes: + - xcc_redfish_command - for compatibility due to Redfish spec changes the virtualMedia resource location changed from Manager to System (https://github.com/ansible-collections/community.general/pull/4682). \ No newline at end of file diff --git a/plugins/modules/remote_management/lenovoxcc/xcc_redfish_command.py b/plugins/modules/remote_management/lenovoxcc/xcc_redfish_command.py index f082f6cd5c..bc54d0c148 100644 --- a/plugins/modules/remote_management/lenovoxcc/xcc_redfish_command.py +++ b/plugins/modules/remote_management/lenovoxcc/xcc_redfish_command.py @@ -305,6 +305,8 @@ class XCCRedfishUtils(RedfishUtils): continue if 'RDOC' in uri: continue + if 'Remote' in uri: + continue # if ejected, 'Inserted' should be False and 'ImageName' cleared if (not data.get('Inserted', False) and not data.get('ImageName')): @@ -312,13 +314,19 @@ class XCCRedfishUtils(RedfishUtils): return None, None def virtual_media_eject_one(self, image_url): - # locate and read the VirtualMedia resources - response = self.get_request(self.root_uri + self.manager_uri) + # read the VirtualMedia resources from systems + response = self.get_request(self.root_uri + self.systems_uri) if response['ret'] is False: return response data = response['data'] if 'VirtualMedia' not in data: - return {'ret': False, 'msg': "VirtualMedia resource not found"} + # read the VirtualMedia resources from manager + response = self.get_request(self.root_uri + self.manager_uri) + if response['ret'] is False: + return response + data = response['data'] + if 'VirtualMedia' not in data: + return {'ret': False, 'msg': "VirtualMedia resource not found"} virt_media_uri = data["VirtualMedia"]["@odata.id"] response = self.get_request(self.root_uri + virt_media_uri) if response['ret'] is False: @@ -379,13 +387,20 @@ class XCCRedfishUtils(RedfishUtils): return self.virtual_media_eject_one(image_url) # eject all inserted media when no image_url specified - # read all the VirtualMedia resources - response = self.get_request(self.root_uri + self.manager_uri) + # read the VirtualMedia resources from systems + response = self.get_request(self.root_uri + self.systems_uri) if response['ret'] is False: return response data = response['data'] if 'VirtualMedia' not in data: - return {'ret': False, 'msg': "VirtualMedia resource not found"} + # read the VirtualMedia resources from manager + response = self.get_request(self.root_uri + self.manager_uri) + if response['ret'] is False: + return response + data = response['data'] + if 'VirtualMedia' not in data: + return {'ret': False, 'msg': "VirtualMedia resource not found"} + # read all the VirtualMedia resources virt_media_uri = data["VirtualMedia"]["@odata.id"] response = self.get_request(self.root_uri + virt_media_uri) if response['ret'] is False: @@ -413,6 +428,95 @@ class XCCRedfishUtils(RedfishUtils): return {'ret': True, 'changed': True, 'msg': "VirtualMedia %s ejected" % str(ejected_media_list)} + def virtual_media_insert(self, options): + param_map = { + 'Inserted': 'inserted', + 'WriteProtected': 'write_protected', + 'UserName': 'username', + 'Password': 'password', + 'TransferProtocolType': 'transfer_protocol_type', + 'TransferMethod': 'transfer_method' + } + image_url = options.get('image_url') + if not image_url: + return {'ret': False, + 'msg': "image_url option required for VirtualMediaInsert"} + media_types = options.get('media_types') + + # read the VirtualMedia resources from systems + response = self.get_request(self.root_uri + self.systems_uri) + if response['ret'] is False: + return response + data = response['data'] + if 'VirtualMedia' not in data: + # read the VirtualMedia resources from manager + response = self.get_request(self.root_uri + self.manager_uri) + if response['ret'] is False: + return response + data = response['data'] + if 'VirtualMedia' not in data: + return {'ret': False, 'msg': "VirtualMedia resource not found"} + virt_media_uri = data["VirtualMedia"]["@odata.id"] + response = self.get_request(self.root_uri + virt_media_uri) + if response['ret'] is False: + return response + data = response['data'] + virt_media_list = [] + for member in data[u'Members']: + virt_media_list.append(member[u'@odata.id']) + resources, headers = self._read_virt_media_resources(virt_media_list) + + # see if image already inserted; if so, nothing to do + if self._virt_media_image_inserted(resources, image_url): + return {'ret': True, 'changed': False, + 'msg': "VirtualMedia '%s' already inserted" % image_url} + + # find an empty slot to insert the media + # try first with strict media_type matching + uri, data = self._find_empty_virt_media_slot( + resources, media_types, media_match_strict=True) + if not uri: + # if not found, try without strict media_type matching + uri, data = self._find_empty_virt_media_slot( + resources, media_types, media_match_strict=False) + if not uri: + return {'ret': False, + 'msg': "Unable to find an available VirtualMedia resource " + "%s" % ('supporting ' + str(media_types) + if media_types else '')} + + # confirm InsertMedia action found + if ('Actions' not in data or + '#VirtualMedia.InsertMedia' not in data['Actions']): + # try to insert via PATCH if no InsertMedia action found + h = headers[uri] + if 'allow' in h: + methods = [m.strip() for m in h.get('allow').split(',')] + if 'PATCH' not in methods: + # if Allow header present and PATCH missing, return error + return {'ret': False, + 'msg': "%s action not found and PATCH not allowed" + % '#VirtualMedia.InsertMedia'} + return self.virtual_media_insert_via_patch(options, param_map, + uri, data) + + # get the action property + action = data['Actions']['#VirtualMedia.InsertMedia'] + if 'target' not in action: + return {'ret': False, + 'msg': "target URI missing from Action " + "#VirtualMedia.InsertMedia"} + action_uri = action['target'] + # get ActionInfo or AllowableValues + ai = self._get_all_action_info_values(action) + # construct payload + payload = self._insert_virt_media_payload(options, param_map, data, ai) + # POST to action + response = self.post_request(self.root_uri + action_uri, payload) + if response['ret'] is False: + return response + return {'ret': True, 'changed': True, 'msg': "VirtualMedia inserted"} + def raw_get_resource(self, resource_uri): if resource_uri is None: return {'ret': False, 'msg': "resource_uri is missing"} @@ -640,7 +744,11 @@ def main(): # Organize by Categories / Commands if category == "Manager": - # execute only if we find a Manager service resource + # For virtual media resource locates on Systems service + result = rf_utils._find_systems_resource() + if result['ret'] is False: + module.fail_json(msg=to_native(result['msg'])) + # For virtual media resource locates on Managers service result = rf_utils._find_managers_resource() if result['ret'] is False: module.fail_json(msg=to_native(result['msg'])) diff --git a/tests/unit/plugins/modules/remote_management/lenovoxcc/test_xcc_redfish_command.py b/tests/unit/plugins/modules/remote_management/lenovoxcc/test_xcc_redfish_command.py index 418474c578..7ee7ee2c18 100644 --- a/tests/unit/plugins/modules/remote_management/lenovoxcc/test_xcc_redfish_command.py +++ b/tests/unit/plugins/modules/remote_management/lenovoxcc/test_xcc_redfish_command.py @@ -72,14 +72,16 @@ class TestXCCRedfishCommand(unittest.TestCase): 'transfer_protocol_type': 'NFS' } }) - with patch.object(module.XCCRedfishUtils, '_find_managers_resource') as mock__find_managers_resource: - mock__find_managers_resource.return_value = {'ret': True, 'changed': True, 'msg': 'success'} + with patch.object(module.XCCRedfishUtils, '_find_systems_resource') as mock__find_systems_resource: + mock__find_systems_resource.return_value = {'ret': True, 'changed': True, 'msg': 'success'} + with patch.object(module.XCCRedfishUtils, '_find_managers_resource') as mock__find_managers_resource: + mock__find_managers_resource.return_value = {'ret': True, 'changed': True, 'msg': 'success'} - with patch.object(module.XCCRedfishUtils, 'virtual_media_insert') as mock_virtual_media_insert: - mock_virtual_media_insert.return_value = {'ret': True, 'changed': True, 'msg': 'success'} + with patch.object(module.XCCRedfishUtils, 'virtual_media_insert') as mock_virtual_media_insert: + mock_virtual_media_insert.return_value = {'ret': True, 'changed': True, 'msg': 'success'} - with self.assertRaises(AnsibleExitJson) as result: - module.main() + with self.assertRaises(AnsibleExitJson) as result: + module.main() def test_module_command_VirtualMediaEject_pass(self): set_module_args({ @@ -93,14 +95,16 @@ class TestXCCRedfishCommand(unittest.TestCase): 'image_url': "nfs://10.245.52.18:/home/nfs/bootable-sr635-20210111-autorun.iso", } }) - with patch.object(module.XCCRedfishUtils, '_find_managers_resource') as mock__find_managers_resource: - mock__find_managers_resource.return_value = {'ret': True, 'changed': True, 'msg': 'success'} + with patch.object(module.XCCRedfishUtils, '_find_systems_resource') as mock__find_systems_resource: + mock__find_systems_resource.return_value = {'ret': True, 'changed': True, 'msg': 'success'} + with patch.object(module.XCCRedfishUtils, '_find_managers_resource') as mock__find_managers_resource: + mock__find_managers_resource.return_value = {'ret': True, 'changed': True, 'msg': 'success'} - with patch.object(module.XCCRedfishUtils, 'virtual_media_eject') as mock_virtual_media_eject: - mock_virtual_media_eject.return_value = {'ret': True, 'changed': True, 'msg': 'success'} + with patch.object(module.XCCRedfishUtils, 'virtual_media_eject') as mock_virtual_media_eject: + mock_virtual_media_eject.return_value = {'ret': True, 'changed': True, 'msg': 'success'} - with self.assertRaises(AnsibleExitJson) as result: - module.main() + with self.assertRaises(AnsibleExitJson) as result: + module.main() def test_module_command_VirtualMediaEject_fail_when_required_args_missing(self): with self.assertRaises(AnsibleFailJson): From 90b815de50b1108a290f2107c20aec402c86534e Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 18 May 2022 22:41:15 +0200 Subject: [PATCH 05/20] Disable the OpenNebula integration tests. (#4692) (#4696) (cherry picked from commit ae7f2f25cbe91a2507d33477cc01d7c91c8e7220) Co-authored-by: Felix Fontein --- tests/integration/targets/one_host/aliases | 1 + tests/integration/targets/one_template/aliases | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/integration/targets/one_host/aliases b/tests/integration/targets/one_host/aliases index 1ff4e0b13e..c3d15acf55 100644 --- a/tests/integration/targets/one_host/aliases +++ b/tests/integration/targets/one_host/aliases @@ -1,2 +1,3 @@ cloud/opennebula shippable/cloud/group1 +disabled # FIXME diff --git a/tests/integration/targets/one_template/aliases b/tests/integration/targets/one_template/aliases index 1ff4e0b13e..c3d15acf55 100644 --- a/tests/integration/targets/one_template/aliases +++ b/tests/integration/targets/one_template/aliases @@ -1,2 +1,3 @@ cloud/opennebula shippable/cloud/group1 +disabled # FIXME From bfd3e150744c7d77f28c51e92c6dbe7d8dd24685 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 18 May 2022 22:52:39 +0200 Subject: [PATCH 06/20] Ignore import sanity errors until the modules can be fixed. (#4689) (#4698) (cherry picked from commit db1010a417518f5b450e2b68bc8f1801318d4465) Co-authored-by: Felix Fontein --- tests/sanity/ignore-2.14.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 164fc7daf5..96aef6cd3a 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -1,4 +1,5 @@ .azure-pipelines/scripts/publish-codecov.py replace-urlopen +plugins/modules/cloud/univention/udm_user.py import-3.11 # Uses deprecated stdlib library 'crypt' plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path plugins/modules/cloud/lxc/lxc_container.py validate-modules:use-run-command-not-popen plugins/modules/cloud/lxd/lxd_project.py use-argspec-type-path # expanduser() applied to constants @@ -26,6 +27,7 @@ plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:undocumented-parameter # missing docs on suboptions plugins/modules/remote_management/manageiq/manageiq_tags.py validate-modules:parameter-state-invalid-choice plugins/modules/system/gconftool2.py validate-modules:parameter-state-invalid-choice +plugins/modules/system/homectl.py import-3.11 # Uses deprecated stdlib library 'crypt' plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter plugins/modules/system/osx_defaults.py validate-modules:parameter-state-invalid-choice plugins/modules/system/parted.py validate-modules:parameter-state-invalid-choice From a71ff614f00f8a19a9886d36a17cc596bd80d1b3 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Thu, 19 May 2022 15:23:47 +0200 Subject: [PATCH 07/20] certifi dropped Python 2 support (#4702) (#4705) * certifi dropped Python 2 support. * Apparently the consul tests didn't use the constraints. (cherry picked from commit 8421af1ea39b650dbd27ea2ddf9b97f865a56fcc) Co-authored-by: Felix Fontein --- tests/integration/targets/consul/meta/main.yml | 1 + tests/integration/targets/consul/tasks/main.yml | 2 ++ tests/utils/constraints.txt | 1 + 3 files changed, 4 insertions(+) diff --git a/tests/integration/targets/consul/meta/main.yml b/tests/integration/targets/consul/meta/main.yml index f9bb8406a4..e54aea9798 100644 --- a/tests/integration/targets/consul/meta/main.yml +++ b/tests/integration/targets/consul/meta/main.yml @@ -3,3 +3,4 @@ dependencies: - setup_pkg_mgr - setup_openssl - setup_remote_tmp_dir + - setup_remote_constraints diff --git a/tests/integration/targets/consul/tasks/main.yml b/tests/integration/targets/consul/tasks/main.yml index 1f7edce304..ab343029fd 100644 --- a/tests/integration/targets/consul/tasks/main.yml +++ b/tests/integration/targets/consul/tasks/main.yml @@ -12,12 +12,14 @@ - name: Install requests<2.20 (CentOS/RHEL 6) pip: name: requests<2.20 + extra_args: "-c {{ remote_constraints }}" register: result until: result is success when: ansible_distribution_file_variety|default() == 'RedHat' and ansible_distribution_major_version is version('6', '<=') - name: Install python-consul pip: name: python-consul + extra_args: "-c {{ remote_constraints }}" register: result until: result is success - name: Generate privatekey diff --git a/tests/utils/constraints.txt b/tests/utils/constraints.txt index 99636b6885..1c04d8152f 100644 --- a/tests/utils/constraints.txt +++ b/tests/utils/constraints.txt @@ -1,3 +1,4 @@ +certifi < 2022.5.18 ; python_version < '3.5' # certifi 2022.5.18 requires Python 3.5 or later coverage >= 4.2, < 5.0.0, != 4.3.2 ; python_version <= '3.7' # features in 4.2+ required, avoid known bug in 4.3.2 on python 2.6, coverage 5.0+ incompatible coverage >= 4.5.4, < 5.0.0 ; python_version > '3.7' # coverage had a bug in < 4.5.4 that would cause unit tests to hang in Python 3.8, coverage 5.0+ incompatible cryptography < 2.2 ; python_version < '2.7' # cryptography 2.2 drops support for python 2.6 From ab5143b15d1c99af3aa9067f30877c3c77862acc Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 22 May 2022 17:48:34 +0200 Subject: [PATCH 08/20] Add RHEL 9.0, FreeBSD 13.1, Ubuntu 22.04 and Fedora 36 to CI, fix bug in filesystem module (#4700) (#4710) * Add RHEL 9.0 and FreeBSD 13.1 to CI. * RHEL 9 has no pyOpenSSL apparently. * Adjust URL for EPEL. * Fix cargo install on FreeBSD 13.1. * Add Ubuntu 22.04 and Fedora 36 to CI. * Fix logic. * filesystem: do not die output line does not contain ':' * Skip django_manage tests on RHEL 9 as well. * homectl tests don't work with RHEL 9.0. * Improve error handling, improve fatresize output handling. * Skip Fedora 36. * Skip filesystem vfat tests on Ubuntu 22.04. There, resizing fails with a bug: Bug: Assertion (disk != NULL) at ../../libparted/disk.c:1620 in function ped_disk_get_partition_by_sector() failed. * 'trusty' is 14.04. Adding 22.04 to skip list. * Skip jail tests for FreeBSD 13.1. * Add config for postgres on Ubuntu 22.04. * Make CentOS 6 happy. * Adjust postgres version. * Try installing EPEL a bit differently. * Skip ufw and iso_extract tests on RHEL 9. * Skip odbc tests on RHEL 9. * Skip RHEL 9.0 for snap tests. * Add changelog fragment for filesystem code changes. (cherry picked from commit 319c29c2a2f0d3a299093e9f00240ca8a119a791) Co-authored-by: Felix Fontein --- .azure-pipelines/azure-pipelines.yml | 16 ++++++++-------- changelogs/fragments/4700-code-changes.yml | 3 +++ plugins/modules/system/filesystem.py | 19 +++++++++++-------- .../integration/targets/cargo/tasks/setup.yml | 12 +++++++++++- .../integration/targets/django_manage/aliases | 1 + .../targets/filesystem/tasks/main.yml | 3 +++ tests/integration/targets/homectl/aliases | 3 ++- .../targets/homectl/tasks/main.yml | 1 + tests/integration/targets/iso_extract/aliases | 2 ++ .../targets/iso_extract/meta/main.yml | 1 - .../targets/iso_extract/tasks/main.yml | 7 +++++++ .../integration/targets/monit/tasks/main.yml | 3 +++ tests/integration/targets/mqtt/tasks/main.yml | 2 +- tests/integration/targets/odbc/aliases | 1 + .../targets/pkgng/tasks/freebsd.yml | 5 ++++- .../targets/setup_epel/tasks/main.yml | 12 +++++++++++- .../targets/setup_openssl/vars/RedHat-9.yml | 4 ++++ .../vars/Ubuntu-22-py3.yml | 8 ++++++++ tests/integration/targets/setup_snap/aliases | 1 + .../targets/setup_snap/meta/main.yml | 1 - .../targets/setup_snap/tasks/D-RedHat-9.0.yml | 1 + .../targets/setup_snap/tasks/main.yml | 7 +++++++ tests/integration/targets/ufw/aliases | 7 +++---- tests/integration/targets/ufw/tasks/main.yml | 4 +++- 24 files changed, 96 insertions(+), 28 deletions(-) create mode 100644 changelogs/fragments/4700-code-changes.yml create mode 100644 tests/integration/targets/setup_openssl/vars/RedHat-9.yml create mode 100644 tests/integration/targets/setup_postgresql_db/vars/Ubuntu-22-py3.yml create mode 100644 tests/integration/targets/setup_snap/aliases create mode 120000 tests/integration/targets/setup_snap/tasks/D-RedHat-9.0.yml diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 7cfa691e4a..551b79cf8e 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -177,12 +177,12 @@ stages: test: macos/12.0 - name: RHEL 7.9 test: rhel/7.9 - - name: RHEL 8.5 - test: rhel/8.5 + - name: RHEL 9.0 + test: rhel/9.0 - name: FreeBSD 12.3 test: freebsd/12.3 - - name: FreeBSD 13.0 - test: freebsd/13.0 + - name: FreeBSD 13.1 + test: freebsd/13.1 groups: - 1 - 2 @@ -253,14 +253,14 @@ stages: test: centos7 - name: Fedora 34 test: fedora34 - - name: Fedora 35 - test: fedora35 + - name: Fedora 36 + test: fedora36 - name: openSUSE 15 test: opensuse15 - name: Ubuntu 18.04 test: ubuntu1804 - - name: Ubuntu 20.04 - test: ubuntu2004 + - name: Ubuntu 22.04 + test: ubuntu2204 - name: Alpine 3 test: alpine3 groups: diff --git a/changelogs/fragments/4700-code-changes.yml b/changelogs/fragments/4700-code-changes.yml new file mode 100644 index 0000000000..d1b281d876 --- /dev/null +++ b/changelogs/fragments/4700-code-changes.yml @@ -0,0 +1,3 @@ +bugfixes: + - "filesystem - improve error messages when output cannot be parsed by including newlines in escaped form (https://github.com/ansible-collections/community.general/pull/4700)." + - "filesystem - handle ``fatresize --info`` output lines without ``:`` (https://github.com/ansible-collections/community.general/pull/4700)." diff --git a/plugins/modules/system/filesystem.py b/plugins/modules/system/filesystem.py index 9fb7810249..6b38c58183 100644 --- a/plugins/modules/system/filesystem.py +++ b/plugins/modules/system/filesystem.py @@ -268,7 +268,7 @@ class Ext(Filesystem): if None not in (block_size, block_count): break else: - raise ValueError(out) + raise ValueError(repr(out)) return block_size * block_count @@ -319,7 +319,7 @@ class XFS(Filesystem): if None not in (block_size, block_count): break else: - raise ValueError(out) + raise ValueError(repr(out)) return block_size * block_count @@ -364,7 +364,7 @@ class Btrfs(Filesystem): for line in stdout.splitlines(): if "Device size" in line: return int(line.split()[-1]) - raise ValueError(stdout) + raise ValueError(repr(stdout)) class Ocfs2(Filesystem): @@ -405,7 +405,7 @@ class F2fs(Filesystem): if None not in (sector_size, sector_count): break else: - raise ValueError(out) + raise ValueError(repr(out)) return sector_size * sector_count @@ -428,12 +428,15 @@ class VFAT(Filesystem): dummy, out, dummy = self.module.run_command([cmd, '--info', str(dev)], check_rc=True, environ_update=self.LANG_ENV) fssize = None for line in out.splitlines()[1:]: - param, value = line.split(':', 1) - if param.strip() == 'Size': + parts = line.split(':', 1) + if len(parts) < 2: + continue + param, value = parts + if param.strip() in ('Size', 'Cur size'): fssize = int(value.strip()) break else: - raise ValueError(out) + raise ValueError(repr(out)) return fssize @@ -477,7 +480,7 @@ class UFS(Filesystem): if None not in (fragmentsize, providersize): break else: - raise ValueError(out) + raise ValueError(repr(out)) return fragmentsize * providersize diff --git a/tests/integration/targets/cargo/tasks/setup.yml b/tests/integration/targets/cargo/tasks/setup.yml index 77104f6dfd..5315349c12 100644 --- a/tests/integration/targets/cargo/tasks/setup.yml +++ b/tests/integration/targets/cargo/tasks/setup.yml @@ -7,8 +7,18 @@ - set_fact: has_cargo: true when: - - ansible_system != 'FreeBSD' or ansible_distribution_version is version('13.0', '>') + - ansible_system != 'FreeBSD' - ansible_distribution != 'MacOSX' - ansible_distribution != 'RedHat' or ansible_distribution_version is version('8.0', '>=') - ansible_distribution != 'CentOS' or ansible_distribution_version is version('7.0', '>=') - ansible_distribution != 'Ubuntu' or ansible_distribution_version is version('18', '>=') + +- block: + - name: Install rust (containing cargo) + package: + name: rust + state: present + - set_fact: + has_cargo: true + when: + - ansible_system == 'FreeBSD' and ansible_distribution_version is version('13.0', '>') diff --git a/tests/integration/targets/django_manage/aliases b/tests/integration/targets/django_manage/aliases index d01e476f95..174bc11337 100644 --- a/tests/integration/targets/django_manage/aliases +++ b/tests/integration/targets/django_manage/aliases @@ -7,3 +7,4 @@ skip/rhel8.2 skip/rhel8.3 skip/rhel8.4 skip/rhel8.5 +skip/rhel9.0 diff --git a/tests/integration/targets/filesystem/tasks/main.yml b/tests/integration/targets/filesystem/tasks/main.yml index 7de9df8e97..70ff890cc7 100644 --- a/tests/integration/targets/filesystem/tasks/main.yml +++ b/tests/integration/targets/filesystem/tasks/main.yml @@ -58,6 +58,9 @@ - 'not (item.0.key == "vfat" and ansible_distribution == "Debian")' # TODO: figure out why it fails, fix it! # vfat resizing fails on ArchLinux - 'not (item.0.key == "vfat" and ansible_distribution == "Archlinux")' # TODO: figure out why it fails, fix it! + # vfat resizing fails on Ubuntu 22.04 + - 'not (item.0.key == "vfat" and ansible_distribution == "Ubuntu" and (ansible_facts.distribution_major_version | int == 22))' + # TODO: figure out why it fails, fix it! # btrfs-progs cannot be installed on ArchLinux - 'not (item.0.key == "btrfs" and ansible_distribution == "Archlinux")' # TODO: figure out why it fails, fix it! diff --git a/tests/integration/targets/homectl/aliases b/tests/integration/targets/homectl/aliases index a2c5a3a804..de4b90786f 100644 --- a/tests/integration/targets/homectl/aliases +++ b/tests/integration/targets/homectl/aliases @@ -2,4 +2,5 @@ shippable/posix/group1 skip/aix skip/freebsd skip/osx -skip/macos \ No newline at end of file +skip/macos +skip/rhel9.0 # See https://www.reddit.com/r/Fedora/comments/si7nzk/homectl/ diff --git a/tests/integration/targets/homectl/tasks/main.yml b/tests/integration/targets/homectl/tasks/main.yml index ded6173759..18943a782d 100644 --- a/tests/integration/targets/homectl/tasks/main.yml +++ b/tests/integration/targets/homectl/tasks/main.yml @@ -174,3 +174,4 @@ when: - systemd_version.rc == 0 and (systemd_version.stdout | regex_search('[0-9][0-9][0-9]') | int >= 245) and homectl_version.rc == 0 - ansible_distribution != 'Archlinux' # TODO! + - ansible_distribution != 'Fedora' or ansible_distribution_major_version|int < 36 # TODO! diff --git a/tests/integration/targets/iso_extract/aliases b/tests/integration/targets/iso_extract/aliases index 5de0229f66..1a89e39873 100644 --- a/tests/integration/targets/iso_extract/aliases +++ b/tests/integration/targets/iso_extract/aliases @@ -1,4 +1,6 @@ shippable/posix/group1 +needs/target/setup_epel destructive skip/aix skip/osx # FIXME +skip/rhel9.0 # FIXME diff --git a/tests/integration/targets/iso_extract/meta/main.yml b/tests/integration/targets/iso_extract/meta/main.yml index 07990bd4ef..56bc554611 100644 --- a/tests/integration/targets/iso_extract/meta/main.yml +++ b/tests/integration/targets/iso_extract/meta/main.yml @@ -1,4 +1,3 @@ dependencies: - setup_pkg_mgr - - setup_epel - setup_remote_tmp_dir diff --git a/tests/integration/targets/iso_extract/tasks/main.yml b/tests/integration/targets/iso_extract/tasks/main.yml index 18fd9b37a9..15f270cb05 100644 --- a/tests/integration/targets/iso_extract/tasks/main.yml +++ b/tests/integration/targets/iso_extract/tasks/main.yml @@ -25,6 +25,13 @@ - set_fact: output_test_dir: '{{ remote_tmp_dir }}/test_iso_extract' +- name: Install EPEL repository (RHEL only) + include_role: + name: setup_epel + when: + - ansible_distribution in ['RedHat', 'CentOS'] + - ansible_distribution_major_version is version('9', '<') + - name: Install 7zip import_tasks: 7zip.yml diff --git a/tests/integration/targets/monit/tasks/main.yml b/tests/integration/targets/monit/tasks/main.yml index 21404fe15a..8f6baeebe8 100644 --- a/tests/integration/targets/monit/tasks/main.yml +++ b/tests/integration/targets/monit/tasks/main.yml @@ -7,6 +7,9 @@ - name: Install EPEL repository (RHEL only) include_role: name: setup_epel + when: + - ansible_distribution in ['RedHat', 'CentOS'] + - ansible_distribution_major_version is version('9', '<') - name: create required directories become: yes diff --git a/tests/integration/targets/mqtt/tasks/main.yml b/tests/integration/targets/mqtt/tasks/main.yml index c5dcf3bec7..ddd37c11e1 100644 --- a/tests/integration/targets/mqtt/tasks/main.yml +++ b/tests/integration/targets/mqtt/tasks/main.yml @@ -6,4 +6,4 @@ - include: ubuntu.yml when: - ansible_distribution == 'Ubuntu' - - ansible_distribution_release not in ['trusty', 'focal'] + - ansible_distribution_release not in ['focal', 'jammy'] diff --git a/tests/integration/targets/odbc/aliases b/tests/integration/targets/odbc/aliases index 4ced527402..6e13799f82 100644 --- a/tests/integration/targets/odbc/aliases +++ b/tests/integration/targets/odbc/aliases @@ -3,4 +3,5 @@ shippable/posix/group1 skip/osx skip/macos skip/rhel8.0 +skip/rhel9.0 skip/freebsd diff --git a/tests/integration/targets/pkgng/tasks/freebsd.yml b/tests/integration/targets/pkgng/tasks/freebsd.yml index f5274d5c5d..b06f5a0333 100644 --- a/tests/integration/targets/pkgng/tasks/freebsd.yml +++ b/tests/integration/targets/pkgng/tasks/freebsd.yml @@ -461,7 +461,10 @@ # NOTE: FreeBSD 12.0 test runner receives a "connection reset by peer" after ~20% downloaded so we are # only running this on 12.1 or higher # - when: ansible_distribution_version is version('12.01', '>=') + # NOTE: FreeBSD 13.1 fails to update the package catalogue for unknown reasons (someone with FreeBSD + # knowledge has to take a look) + # + when: ansible_distribution_version is version('12.01', '>=') and ansible_distribution_version is version('13.1', '<') block: - name: Setup testjail include: setup-testjail.yml diff --git a/tests/integration/targets/setup_epel/tasks/main.yml b/tests/integration/targets/setup_epel/tasks/main.yml index 21627cfa1d..b848ac2144 100644 --- a/tests/integration/targets/setup_epel/tasks/main.yml +++ b/tests/integration/targets/setup_epel/tasks/main.yml @@ -7,4 +7,14 @@ yum: name: https://s3.amazonaws.com/ansible-ci-files/test/integration/targets/setup_epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm disable_gpg_check: true - when: ansible_facts.distribution in ['RedHat', 'CentOS'] + when: + - ansible_facts.distribution in ['RedHat', 'CentOS'] + - ansible_facts.distribution_major_version == '6' + +- name: Install EPEL + yum: + name: https://ci-files.testing.ansible.com/test/integration/targets/setup_epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm + disable_gpg_check: true + when: + - ansible_facts.distribution in ['RedHat', 'CentOS'] + - ansible_facts.distribution_major_version != '6' diff --git a/tests/integration/targets/setup_openssl/vars/RedHat-9.yml b/tests/integration/targets/setup_openssl/vars/RedHat-9.yml new file mode 100644 index 0000000000..587309dc07 --- /dev/null +++ b/tests/integration/targets/setup_openssl/vars/RedHat-9.yml @@ -0,0 +1,4 @@ +cryptography_package_name: python-cryptography +cryptography_package_name_python3: python3-cryptography +openssl_package_name: openssl +cryptography_from_pip: false diff --git a/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-22-py3.yml b/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-22-py3.yml new file mode 100644 index 0000000000..b1521e4bc5 --- /dev/null +++ b/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-22-py3.yml @@ -0,0 +1,8 @@ +postgresql_packages: + - "postgresql" + - "postgresql-common" + - "python3-psycopg2" + +pg_hba_location: "/etc/postgresql/14/main/pg_hba.conf" +pg_dir: "/var/lib/postgresql/14/main" +pg_ver: 14 diff --git a/tests/integration/targets/setup_snap/aliases b/tests/integration/targets/setup_snap/aliases new file mode 100644 index 0000000000..65e831523c --- /dev/null +++ b/tests/integration/targets/setup_snap/aliases @@ -0,0 +1 @@ +needs/target/setup_epel diff --git a/tests/integration/targets/setup_snap/meta/main.yml b/tests/integration/targets/setup_snap/meta/main.yml index 0e51c36ebd..5438ced5c3 100644 --- a/tests/integration/targets/setup_snap/meta/main.yml +++ b/tests/integration/targets/setup_snap/meta/main.yml @@ -1,3 +1,2 @@ dependencies: - setup_pkg_mgr - - setup_epel diff --git a/tests/integration/targets/setup_snap/tasks/D-RedHat-9.0.yml b/tests/integration/targets/setup_snap/tasks/D-RedHat-9.0.yml new file mode 120000 index 0000000000..0b06951496 --- /dev/null +++ b/tests/integration/targets/setup_snap/tasks/D-RedHat-9.0.yml @@ -0,0 +1 @@ +nothing.yml \ No newline at end of file diff --git a/tests/integration/targets/setup_snap/tasks/main.yml b/tests/integration/targets/setup_snap/tasks/main.yml index 26e02ddc56..6851a204f3 100644 --- a/tests/integration/targets/setup_snap/tasks/main.yml +++ b/tests/integration/targets/setup_snap/tasks/main.yml @@ -8,6 +8,13 @@ debug: msg: "Distribution '{{ ansible_facts.distribution }}', version '{{ ansible_facts.distribution_version }}', OS family '{{ ansible_facts.os_family }}'" +- name: Install EPEL repository (RHEL only) + include_role: + name: setup_epel + when: + - ansible_distribution in ['RedHat', 'CentOS'] + - ansible_distribution_major_version is version('9', '<') + - name: Include distribution specific tasks include_tasks: "{{ lookup('first_found', params) }}" vars: diff --git a/tests/integration/targets/ufw/aliases b/tests/integration/targets/ufw/aliases index 7ab34d8e5e..bb5347a578 100644 --- a/tests/integration/targets/ufw/aliases +++ b/tests/integration/targets/ufw/aliases @@ -3,10 +3,9 @@ skip/aix skip/osx skip/macos skip/freebsd -skip/rhel8.0 -skip/rhel8.0b -skip/rhel8.1b +skip/rhel8.0 # FIXME +skip/rhel9.0 # FIXME skip/docker needs/root -destructive needs/target/setup_epel +destructive diff --git a/tests/integration/targets/ufw/tasks/main.yml b/tests/integration/targets/ufw/tasks/main.yml index 3feb480cb0..ab9b109a18 100644 --- a/tests/integration/targets/ufw/tasks/main.yml +++ b/tests/integration/targets/ufw/tasks/main.yml @@ -8,7 +8,9 @@ - name: Install EPEL repository (RHEL only) include_role: name: setup_epel - when: ansible_distribution == 'RedHat' + when: + - ansible_distribution in ['RedHat', 'CentOS'] + - ansible_distribution_major_version is version('9', '<') - name: Install iptables (SuSE only) package: name: iptables From 7569d6315cf705654c27fca0232ed738d77550e3 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 23 May 2022 07:32:54 +0200 Subject: [PATCH 09/20] Multiple modules using ModuleHelper (#4674) (#4713) * Multiple modules using ModuleHelper Replaced raising exception with calling method do_raise() in MH. Removed the importing of the exception class. * added changelog fragment (cherry picked from commit 6052776de138606fb23d7383476a321cb7ff2e00) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- changelogs/fragments/4674-use-mh-raise.yaml | 6 ++++++ plugins/modules/packaging/language/cpanm.py | 17 ++++++++-------- plugins/modules/packaging/language/pipx.py | 16 ++++++--------- plugins/modules/packaging/os/snap.py | 22 ++++++++++----------- plugins/modules/system/mksysb.py | 6 +++--- plugins/modules/system/xfconf.py | 4 ++-- 6 files changed, 36 insertions(+), 35 deletions(-) create mode 100644 changelogs/fragments/4674-use-mh-raise.yaml diff --git a/changelogs/fragments/4674-use-mh-raise.yaml b/changelogs/fragments/4674-use-mh-raise.yaml new file mode 100644 index 0000000000..3e8ad13975 --- /dev/null +++ b/changelogs/fragments/4674-use-mh-raise.yaml @@ -0,0 +1,6 @@ +minor_changes: + - cpanm - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674). + - pipx - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674). + - snap - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674). + - mksysb - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674). + - xfconf - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674). diff --git a/plugins/modules/packaging/language/cpanm.py b/plugins/modules/packaging/language/cpanm.py index 7b209d1fae..8c8f2ea1c3 100644 --- a/plugins/modules/packaging/language/cpanm.py +++ b/plugins/modules/packaging/language/cpanm.py @@ -134,7 +134,7 @@ EXAMPLES = ''' import os from ansible_collections.community.general.plugins.module_utils.module_helper import ( - ModuleHelper, CmdMixin, ArgFormat, ModuleHelperException + ModuleHelper, CmdMixin, ArgFormat ) @@ -171,10 +171,10 @@ class CPANMinus(CmdMixin, ModuleHelper): v = self.vars if v.mode == "compatibility": if v.name_check: - raise ModuleHelperException("Parameter name_check can only be used with mode=new") + self.do_raise("Parameter name_check can only be used with mode=new") else: if v.name and v.from_path: - raise ModuleHelperException("Parameters 'name' and 'from_path' are mutually exclusive when 'mode=new'") + self.do_raise("Parameters 'name' and 'from_path' are mutually exclusive when 'mode=new'") self.command = self.module.get_bin_path(v.executable if v.executable else self.command) self.vars.set("binary", self.command) @@ -190,17 +190,16 @@ class CPANMinus(CmdMixin, ModuleHelper): return rc == 0 - @staticmethod - def sanitize_pkg_spec_version(pkg_spec, version): + def sanitize_pkg_spec_version(self, pkg_spec, version): if version is None: return pkg_spec if pkg_spec.endswith('.tar.gz'): - raise ModuleHelperException(msg="parameter 'version' must not be used when installing from a file") + self.do_raise(msg="parameter 'version' must not be used when installing from a file") if os.path.isdir(pkg_spec): - raise ModuleHelperException(msg="parameter 'version' must not be used when installing from a directory") + self.do_raise(msg="parameter 'version' must not be used when installing from a directory") if pkg_spec.endswith('.git'): if version.startswith('~'): - raise ModuleHelperException(msg="operator '~' not allowed in version parameter when installing from git repository") + self.do_raise(msg="operator '~' not allowed in version parameter when installing from git repository") version = version if version.startswith('@') else '@' + version elif version[0] not in ('@', '~'): version = '~' + version @@ -228,7 +227,7 @@ class CPANMinus(CmdMixin, ModuleHelper): def process_command_output(self, rc, out, err): if self.vars.mode == "compatibility" and rc != 0: - raise ModuleHelperException(msg=err, cmd=self.vars.cmd_args) + self.do_raise(msg=err, cmd=self.vars.cmd_args) return 'is up to date' not in err and 'is up to date' not in out diff --git a/plugins/modules/packaging/language/pipx.py b/plugins/modules/packaging/language/pipx.py index 0b2276c6f8..0d1103000a 100644 --- a/plugins/modules/packaging/language/pipx.py +++ b/plugins/modules/packaging/language/pipx.py @@ -134,7 +134,7 @@ EXAMPLES = ''' import json from ansible_collections.community.general.plugins.module_utils.module_helper import ( - CmdStateModuleHelper, ArgFormat, ModuleHelperException + CmdStateModuleHelper, ArgFormat ) from ansible.module_utils.facts.compat import ansible_facts @@ -153,9 +153,8 @@ class PipX(CmdStateModuleHelper): module = dict( argument_spec=dict( state=dict(type='str', default='install', - choices=[ - 'present', 'absent', 'install', 'uninstall', 'uninstall_all', - 'inject', 'upgrade', 'upgrade_all', 'reinstall', 'reinstall_all']), + choices=['present', 'absent', 'install', 'uninstall', 'uninstall_all', + 'inject', 'upgrade', 'upgrade_all', 'reinstall', 'reinstall_all']), name=dict(type='str'), source=dict(type='str'), install_deps=dict(type='bool', default=False), @@ -247,8 +246,7 @@ class PipX(CmdStateModuleHelper): def state_upgrade(self): if not self.vars.application: - raise ModuleHelperException( - "Trying to upgrade a non-existent application: {0}".format(self.vars.name)) + self.do_raise("Trying to upgrade a non-existent application: {0}".format(self.vars.name)) if self.vars.force: self.changed = True if not self.module.check_mode: @@ -262,16 +260,14 @@ class PipX(CmdStateModuleHelper): def state_reinstall(self): if not self.vars.application: - raise ModuleHelperException( - "Trying to reinstall a non-existent application: {0}".format(self.vars.name)) + self.do_raise("Trying to reinstall a non-existent application: {0}".format(self.vars.name)) self.changed = True if not self.module.check_mode: self.run_command(params=['state', 'name', 'python']) def state_inject(self): if not self.vars.application: - raise ModuleHelperException( - "Trying to inject packages into a non-existent application: {0}".format(self.vars.name)) + self.do_raise("Trying to inject packages into a non-existent application: {0}".format(self.vars.name)) if self.vars.force: self.changed = True if not self.module.check_mode: diff --git a/plugins/modules/packaging/os/snap.py b/plugins/modules/packaging/os/snap.py index f5df9d1a52..9ac56d09bd 100644 --- a/plugins/modules/packaging/os/snap.py +++ b/plugins/modules/packaging/os/snap.py @@ -147,7 +147,7 @@ import numbers from ansible.module_utils.common.text.converters import to_native from ansible_collections.community.general.plugins.module_utils.module_helper import ( - CmdStateModuleHelper, ArgFormat, ModuleHelperException + CmdStateModuleHelper, ArgFormat ) @@ -218,8 +218,8 @@ class Snap(CmdStateModuleHelper): option_map = {} if not isinstance(json_subtree, dict): - raise ModuleHelperException("Non-dict non-leaf element encountered while parsing option map. " - "The output format of 'snap set' may have changed. Aborting!") + self.do_raise("Non-dict non-leaf element encountered while parsing option map. " + "The output format of 'snap set' may have changed. Aborting!") for key, value in json_subtree.items(): full_key = key if prefix is None else prefix + "." + key @@ -252,7 +252,7 @@ class Snap(CmdStateModuleHelper): option_map = self.convert_json_to_map(out) except Exception as e: - raise ModuleHelperException( + self.do_raise( msg="Parsing option map returned by 'snap get {0}' triggers exception '{1}', output:\n'{2}'".format(snap_name, str(e), out)) return option_map @@ -267,7 +267,7 @@ class Snap(CmdStateModuleHelper): result = out.splitlines()[1] match = self.__disable_re.match(result) if not match: - raise ModuleHelperException(msg="Unable to parse 'snap list {0}' output:\n{1}".format(snap_name, out)) + self.do_raise(msg="Unable to parse 'snap list {0}' output:\n{1}".format(snap_name, out)) notes = match.group('notes') return "disabled" not in notes.split(',') @@ -300,7 +300,7 @@ class Snap(CmdStateModuleHelper): else: msg = "Ooops! Snap installation failed while executing '{cmd}', please examine logs and " \ "error output for more details.".format(cmd=self.vars.cmd) - raise ModuleHelperException(msg=msg) + self.do_raise(msg=msg) def state_present(self): @@ -330,14 +330,14 @@ class Snap(CmdStateModuleHelper): if not match: msg = "Cannot parse set option '{option_string}'".format(option_string=option_string) - raise ModuleHelperException(msg) + self.do_raise(msg) snap_prefix = match.group("snap_prefix") selected_snap_name = snap_prefix[:-1] if snap_prefix else None if selected_snap_name is not None and selected_snap_name not in self.vars.name: msg = "Snap option '{option_string}' refers to snap which is not in the list of snap names".format(option_string=option_string) - raise ModuleHelperException(msg) + self.do_raise(msg) if selected_snap_name is None or (snap_name is not None and snap_name == selected_snap_name): key = match.group("key") @@ -360,11 +360,11 @@ class Snap(CmdStateModuleHelper): if rc != 0: if 'has no "configure" hook' in err: msg = "Snap '{snap}' does not have any configurable options".format(snap=snap_name) - raise ModuleHelperException(msg) + self.do_raise(msg) msg = "Cannot set options '{options}' for snap '{snap}': error={error}".format( options=" ".join(options_changed), snap=snap_name, error=err) - raise ModuleHelperException(msg) + self.do_raise(msg) if overall_options_changed: self.vars.options_changed = overall_options_changed @@ -385,7 +385,7 @@ class Snap(CmdStateModuleHelper): return msg = "Ooops! Snap operation failed while executing '{cmd}', please examine logs and " \ "error output for more details.".format(cmd=self.vars.cmd) - raise ModuleHelperException(msg=msg) + self.do_raise(msg=msg) def state_absent(self): self._generic_state_action(self.is_snap_installed, "snaps_removed", ['classic', 'channel', 'state']) diff --git a/plugins/modules/system/mksysb.py b/plugins/modules/system/mksysb.py index ddf9c171f3..8dd1b45cd0 100644 --- a/plugins/modules/system/mksysb.py +++ b/plugins/modules/system/mksysb.py @@ -99,7 +99,7 @@ msg: import os from ansible_collections.community.general.plugins.module_utils.module_helper import ( - CmdModuleHelper, ArgFormat, ModuleHelperException + CmdModuleHelper, ArgFormat ) @@ -136,7 +136,7 @@ class MkSysB(CmdModuleHelper): def __init_module__(self): if not os.path.isdir(self.vars.storage_path): - raise ModuleHelperException("Storage path %s is not valid." % self.vars.storage_path) + self.do_raise("Storage path %s is not valid." % self.vars.storage_path) def __run__(self): if not self.module.check_mode: @@ -149,7 +149,7 @@ class MkSysB(CmdModuleHelper): def process_command_output(self, rc, out, err): if rc != 0: - raise ModuleHelperException("mksysb failed.") + self.do_raise("mksysb failed.") self.vars.msg = out diff --git a/plugins/modules/system/xfconf.py b/plugins/modules/system/xfconf.py index 8becd4a683..942f8f45d2 100644 --- a/plugins/modules/system/xfconf.py +++ b/plugins/modules/system/xfconf.py @@ -146,7 +146,7 @@ RETURN = ''' ''' from ansible_collections.community.general.plugins.module_utils.module_helper import ( - CmdStateModuleHelper, ArgFormat, ModuleHelperException + CmdStateModuleHelper, ArgFormat ) @@ -212,7 +212,7 @@ class XFConfProperty(CmdStateModuleHelper): self.vars.meta('value').set(initial_value=self.vars.previous_value) if self.module.params['disable_facts'] is False: - raise ModuleHelperException('Returning results as facts has been removed. Stop using disable_facts=false.') + self.do_raise('Returning results as facts has been removed. Stop using disable_facts=false.') def process_command_output(self, rc, out, err): if err.rstrip() == self.does_not: From 86175681462a269de9a714e92f03e30550884949 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 23 May 2022 07:37:08 +0200 Subject: [PATCH 10/20] consul: applied bugfix from issue (#4712) (#4716) * applied bugfix from issue * added changelog fragment (cherry picked from commit 4d2bed1dde785239df0817a4a238ea5f3a98c11a) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- changelogs/fragments/4712-consul-bugfix.yaml | 2 ++ plugins/modules/clustering/consul/consul.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/4712-consul-bugfix.yaml diff --git a/changelogs/fragments/4712-consul-bugfix.yaml b/changelogs/fragments/4712-consul-bugfix.yaml new file mode 100644 index 0000000000..bc63999b11 --- /dev/null +++ b/changelogs/fragments/4712-consul-bugfix.yaml @@ -0,0 +1,2 @@ +bugfixes: + - consul - fixed bug introduced in PR 4590 (https://github.com/ansible-collections/community.general/issues/4680). diff --git a/plugins/modules/clustering/consul/consul.py b/plugins/modules/clustering/consul/consul.py index e06432b684..9707d5431a 100644 --- a/plugins/modules/clustering/consul/consul.py +++ b/plugins/modules/clustering/consul/consul.py @@ -333,7 +333,7 @@ def add_service(module, service): service_id=result.id, service_name=result.name, service_port=result.port, - checks=[check.to_dict() for check in service.checks], + checks=[check.to_dict() for check in service.checks()], tags=result.tags) From b2802dc8eb51394dfe0b498bf7ed783be7fcafea Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Tue, 24 May 2022 07:11:53 +0200 Subject: [PATCH 11/20] redfish_command: documentation typo and language (#4718) (#4721) Fix typo "od" to "of" and language (cherry picked from commit d73789ba3a24b5abd6000d8de751454507e276b8) Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com> --- plugins/modules/remote_management/redfish/redfish_command.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/remote_management/redfish/redfish_command.py b/plugins/modules/remote_management/redfish/redfish_command.py index a38e18945e..3ecbb6d560 100644 --- a/plugins/modules/remote_management/redfish/redfish_command.py +++ b/plugins/modules/remote_management/redfish/redfish_command.py @@ -174,7 +174,7 @@ options: image_url: required: false description: - - The URL od the image the insert or eject + - The URL of the image to insert or eject type: str inserted: required: false From 99958cea495d2252ada36cdb03668b77c7f8332a Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Tue, 24 May 2022 20:20:25 +0200 Subject: [PATCH 12/20] redfish modules: documentation language and formatting (#4722) (#4725) * redfish_command: documentation language and formatting Update the documentation block with more English language more consistent with other modules and finish each description with a full stop. * redfish_command: do not end short desc in full stop * redfish_command: remove more "the" on documentation Remove "The" from beginning of descriptions. * redfish_command: start documentation description with capital case * redfish_config: update documentation language and format Add full stops at end of descriptions, small updates to language, ensure descriptions start with a capital case letter. * redfish_config: documentation consistency Use "username" for description similarly to redfish_command. * redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: more doc consistency fixes Call it iDRAC everywhere and not sometimes OOB controller. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_config: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation language Call it "HTTP request" and not "URL request". * idrac_redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * idrac_redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_info: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Boot device should be two words. Co-authored-by: Felix Fontein Co-authored-by: Felix Fontein (cherry picked from commit 88cd35fd45fa5e19b17526b0b9e2bff512b229c6) Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com> --- .../redfish/idrac_redfish_command.py | 18 +++--- .../redfish/idrac_redfish_config.py | 20 +++--- .../redfish/idrac_redfish_info.py | 18 +++--- .../redfish/ilo_redfish_config.py | 8 +-- .../redfish/ilo_redfish_info.py | 8 +-- .../redfish/redfish_command.py | 64 +++++++++---------- .../redfish/redfish_config.py | 26 ++++---- .../remote_management/redfish/redfish_info.py | 14 ++-- 8 files changed, 88 insertions(+), 88 deletions(-) diff --git a/plugins/modules/remote_management/redfish/idrac_redfish_command.py b/plugins/modules/remote_management/redfish/idrac_redfish_command.py index 5e02154ed8..82a0f4b09a 100644 --- a/plugins/modules/remote_management/redfish/idrac_redfish_command.py +++ b/plugins/modules/remote_management/redfish/idrac_redfish_command.py @@ -14,46 +14,46 @@ short_description: Manages Out-Of-Band controllers using iDRAC OEM Redfish APIs description: - Builds Redfish URIs locally and sends them to remote OOB controllers to perform an action. - - For use with Dell iDRAC operations that require Redfish OEM extensions + - For use with Dell iDRAC operations that require Redfish OEM extensions. options: category: required: true description: - - Category to execute on OOB controller + - Category to execute on iDRAC. type: str command: required: true description: - - List of commands to execute on OOB controller + - List of commands to execute on iDRAC. type: list elements: str baseuri: required: true description: - - Base URI of OOB controller + - Base URI of iDRAC. type: str username: description: - - User for authentication with OOB controller + - Username for authenticating to iDRAC. type: str password: description: - - Password for authentication with OOB controller + - Password for authenticating to iDRAC. type: str auth_token: description: - - Security token for authentication with OOB controller + - Security token for authenticating to iDRAC. type: str version_added: 2.3.0 timeout: description: - - Timeout in seconds for URL requests to OOB controller + - Timeout in seconds for HTTP requests to iDRAC. default: 10 type: int resource_id: required: false description: - - The ID of the System, Manager or Chassis to modify + - ID of the System, Manager or Chassis to modify. type: str version_added: '0.2.0' diff --git a/plugins/modules/remote_management/redfish/idrac_redfish_config.py b/plugins/modules/remote_management/redfish/idrac_redfish_config.py index adea4b11a9..683538e4b7 100644 --- a/plugins/modules/remote_management/redfish/idrac_redfish_config.py +++ b/plugins/modules/remote_management/redfish/idrac_redfish_config.py @@ -20,50 +20,50 @@ options: required: true type: str description: - - Category to execute on iDRAC + - Category to execute on iDRAC. command: required: true description: - - List of commands to execute on iDRAC + - List of commands to execute on iDRAC. - I(SetManagerAttributes), I(SetLifecycleControllerAttributes) and I(SetSystemAttributes) are mutually exclusive commands when C(category) - is I(Manager) + is I(Manager). type: list elements: str baseuri: required: true description: - - Base URI of iDRAC + - Base URI of iDRAC. type: str username: description: - - User for authentication with iDRAC + - Username for authenticating to iDRAC. type: str password: description: - - Password for authentication with iDRAC + - Password for authenticating to iDRAC. type: str auth_token: description: - - Security token for authentication with OOB controller + - Security token for authenticating to iDRAC. type: str version_added: 2.3.0 manager_attributes: required: false description: - - dictionary of iDRAC attribute name and value pairs to update + - Dictionary of iDRAC attribute name and value pairs to update. default: {} type: 'dict' version_added: '0.2.0' timeout: description: - - Timeout in seconds for URL requests to iDRAC controller + - Timeout in seconds for HTTP requests to iDRAC. default: 10 type: int resource_id: required: false description: - - The ID of the System, Manager or Chassis to modify + - ID of the System, Manager or Chassis to modify. type: str version_added: '0.2.0' diff --git a/plugins/modules/remote_management/redfish/idrac_redfish_info.py b/plugins/modules/remote_management/redfish/idrac_redfish_info.py index fb137acca3..7bfd81a78e 100644 --- a/plugins/modules/remote_management/redfish/idrac_redfish_info.py +++ b/plugins/modules/remote_management/redfish/idrac_redfish_info.py @@ -14,44 +14,44 @@ short_description: Gather PowerEdge server information through iDRAC using Redfi description: - Builds Redfish URIs locally and sends them to remote iDRAC controllers to get information back. - - For use with Dell EMC iDRAC operations that require Redfish OEM extensions + - For use with Dell EMC iDRAC operations that require Redfish OEM extensions. - This module was called C(idrac_redfish_facts) before Ansible 2.9, returning C(ansible_facts). Note that the M(community.general.idrac_redfish_info) module no longer returns C(ansible_facts)! options: category: required: true description: - - Category to execute on iDRAC controller + - Category to execute on iDRAC. type: str command: required: true description: - - List of commands to execute on iDRAC controller + - List of commands to execute on iDRAC. - C(GetManagerAttributes) returns the list of dicts containing iDRAC, - LifecycleController and System attributes + LifecycleController and System attributes. type: list elements: str baseuri: required: true description: - - Base URI of iDRAC controller + - Base URI of iDRAC. type: str username: description: - - User for authentication with iDRAC controller + - Username for authenticating to iDRAC. type: str password: description: - - Password for authentication with iDRAC controller + - Password for authenticating to iDRAC. type: str auth_token: description: - - Security token for authentication with OOB controller + - Security token for authenticating to iDRAC. type: str version_added: 2.3.0 timeout: description: - - Timeout in seconds for URL requests to OOB controller + - Timeout in seconds for HTTP requests to iDRAC. default: 10 type: int diff --git a/plugins/modules/remote_management/redfish/ilo_redfish_config.py b/plugins/modules/remote_management/redfish/ilo_redfish_config.py index 4640688407..3f9da0a4d8 100644 --- a/plugins/modules/remote_management/redfish/ilo_redfish_config.py +++ b/plugins/modules/remote_management/redfish/ilo_redfish_config.py @@ -34,19 +34,19 @@ options: type: str username: description: - - User for authentication with iLO. + - Username for authenticating to iLO. type: str password: description: - - Password for authentication with iLO. + - Password for authenticating to iLO. type: str auth_token: description: - - Security token for authentication with OOB controller. + - Security token for authenticating to iLO. type: str timeout: description: - - Timeout in seconds for URL requests to iLO controller. + - Timeout in seconds for HTTP requests to iLO. default: 10 type: int attribute_name: diff --git a/plugins/modules/remote_management/redfish/ilo_redfish_info.py b/plugins/modules/remote_management/redfish/ilo_redfish_info.py index 6773c4ae95..5f5be4f835 100644 --- a/plugins/modules/remote_management/redfish/ilo_redfish_info.py +++ b/plugins/modules/remote_management/redfish/ilo_redfish_info.py @@ -34,19 +34,19 @@ options: type: str username: description: - - User for authentication with iLO. + - Username for authenticating to iLO. type: str password: description: - - Password for authentication with iLO. + - Password for authenticating to iLO. type: str auth_token: description: - - Security token for authentication with iLO. + - Security token for authenticating to iLO. type: str timeout: description: - - Timeout in seconds for URL requests to iLO. + - Timeout in seconds for HTTP requests to iLO. default: 10 type: int author: diff --git a/plugins/modules/remote_management/redfish/redfish_command.py b/plugins/modules/remote_management/redfish/redfish_command.py index 3ecbb6d560..66609f97fb 100644 --- a/plugins/modules/remote_management/redfish/redfish_command.py +++ b/plugins/modules/remote_management/redfish/redfish_command.py @@ -21,35 +21,35 @@ options: category: required: true description: - - Category to execute on OOB controller + - Category to execute on OOB controller. type: str command: required: true description: - - List of commands to execute on OOB controller + - List of commands to execute on OOB controller. type: list elements: str baseuri: required: true description: - - Base URI of OOB controller + - Base URI of OOB controller. type: str username: description: - - Username for authentication with OOB controller + - Username for authenticating to OOB controller. type: str password: description: - - Password for authentication with OOB controller + - Password for authenticating to OOB controller. type: str auth_token: description: - - Security token for authentication with OOB controller + - Security token for authenticating to OOB controller. type: str version_added: 2.3.0 session_uri: description: - - URI of the session resource + - URI of the session resource. type: str version_added: 2.3.0 id: @@ -63,28 +63,28 @@ options: required: false aliases: [ account_username ] description: - - Username of account to add/delete/modify + - Username of account to add/delete/modify. type: str new_password: required: false aliases: [ account_password ] description: - - New password of account to add/modify + - New password of account to add/modify. type: str roleid: required: false aliases: [ account_roleid ] description: - - Role of account to add/modify + - Role of account to add/modify. type: str bootdevice: required: false description: - - bootdevice when setting boot configuration + - Boot device when setting boot configuration. type: str timeout: description: - - Timeout in seconds for URL requests to OOB controller + - Timeout in seconds for HTTP requests to OOB controller. default: 10 type: int boot_override_mode: @@ -96,117 +96,117 @@ options: uefi_target: required: false description: - - UEFI target when bootdevice is "UefiTarget" + - UEFI boot target when bootdevice is "UefiTarget". type: str boot_next: required: false description: - - BootNext target when bootdevice is "UefiBootNext" + - BootNext target when bootdevice is "UefiBootNext". type: str update_username: required: false aliases: [ account_updatename ] description: - - new update user name for account_username + - New user name for updating account_username. type: str version_added: '0.2.0' account_properties: required: false description: - - properties of account service to update + - Properties of account service to update. type: dict version_added: '0.2.0' resource_id: required: false description: - - The ID of the System, Manager or Chassis to modify + - ID of the System, Manager or Chassis to modify. type: str version_added: '0.2.0' update_image_uri: required: false description: - - The URI of the image for the update + - URI of the image for the update. type: str version_added: '0.2.0' update_protocol: required: false description: - - The protocol for the update + - Protocol for the update. type: str version_added: '0.2.0' update_targets: required: false description: - - The list of target resource URIs to apply the update to + - List of target resource URIs to apply the update to. type: list elements: str version_added: '0.2.0' update_creds: required: false description: - - The credentials for retrieving the update image + - Credentials for retrieving the update image. type: dict version_added: '0.2.0' suboptions: username: required: false description: - - The username for retrieving the update image + - Username for retrieving the update image. type: str password: required: false description: - - The password for retrieving the update image + - Password for retrieving the update image. type: str virtual_media: required: false description: - - The options for VirtualMedia commands + - Options for VirtualMedia commands. type: dict version_added: '0.2.0' suboptions: media_types: required: false description: - - The list of media types appropriate for the image + - List of media types appropriate for the image. type: list elements: str image_url: required: false description: - - The URL of the image to insert or eject + - URL of the image to insert or eject. type: str inserted: required: false description: - - Indicates if the image is treated as inserted on command completion + - Indicates that the image is treated as inserted on command completion. type: bool default: True write_protected: required: false description: - - Indicates if the media is treated as write-protected + - Indicates that the media is treated as write-protected. type: bool default: True username: required: false description: - - The username for accessing the image URL + - Username for accessing the image URL. type: str password: required: false description: - - The password for accessing the image URL + - Password for accessing the image URL. type: str transfer_protocol_type: required: false description: - - The network protocol to use with the image + - Network protocol to use with the image. type: str transfer_method: required: false description: - - The transfer method to use with the image + - Transfer method to use with the image. type: str strip_etag_quotes: description: diff --git a/plugins/modules/remote_management/redfish/redfish_config.py b/plugins/modules/remote_management/redfish/redfish_config.py index b903ceed77..39df23ab71 100644 --- a/plugins/modules/remote_management/redfish/redfish_config.py +++ b/plugins/modules/remote_management/redfish/redfish_config.py @@ -20,48 +20,48 @@ options: category: required: true description: - - Category to execute on OOB controller + - Category to execute on OOB controller. type: str command: required: true description: - - List of commands to execute on OOB controller + - List of commands to execute on OOB controller. type: list elements: str baseuri: required: true description: - - Base URI of OOB controller + - Base URI of OOB controller. type: str username: description: - - User for authentication with OOB controller + - Username for authenticating to OOB controller. type: str password: description: - - Password for authentication with OOB controller + - Password for authenticating to OOB controller. type: str auth_token: description: - - Security token for authentication with OOB controller + - Security token for authenticating to OOB controller. type: str version_added: 2.3.0 bios_attributes: required: false description: - - dictionary of BIOS attributes to update + - Dictionary of BIOS attributes to update. default: {} type: dict version_added: '0.2.0' timeout: description: - - Timeout in seconds for URL requests to OOB controller + - Timeout in seconds for HTTP requests to OOB controller. default: 10 type: int boot_order: required: false description: - - list of BootOptionReference strings specifying the BootOrder + - List of BootOptionReference strings specifying the BootOrder. default: [] type: list elements: str @@ -69,26 +69,26 @@ options: network_protocols: required: false description: - - setting dict of manager services to update + - Setting dict of manager services to update. type: dict version_added: '0.2.0' resource_id: required: false description: - - The ID of the System, Manager or Chassis to modify + - ID of the System, Manager or Chassis to modify. type: str version_added: '0.2.0' nic_addr: required: false description: - - EthernetInterface Address string on OOB controller + - EthernetInterface Address string on OOB controller. default: 'null' type: str version_added: '0.2.0' nic_config: required: false description: - - setting dict of EthernetInterface on OOB controller + - Setting dict of EthernetInterface on OOB controller. type: dict version_added: '0.2.0' strip_etag_quotes: diff --git a/plugins/modules/remote_management/redfish/redfish_info.py b/plugins/modules/remote_management/redfish/redfish_info.py index c0576ff4c8..886b3f7da1 100644 --- a/plugins/modules/remote_management/redfish/redfish_info.py +++ b/plugins/modules/remote_management/redfish/redfish_info.py @@ -21,37 +21,37 @@ options: category: required: false description: - - List of categories to execute on OOB controller + - List of categories to execute on OOB controller. default: ['Systems'] type: list elements: str command: required: false description: - - List of commands to execute on OOB controller + - List of commands to execute on OOB controller. type: list elements: str baseuri: required: true description: - - Base URI of OOB controller + - Base URI of OOB controller. type: str username: description: - - User for authentication with OOB controller + - Username for authenticating to OOB controller. type: str password: description: - - Password for authentication with OOB controller + - Password for authenticating to OOB controller. type: str auth_token: description: - - Security token for authentication with OOB controller + - Security token for authenticating to OOB controller. type: str version_added: 2.3.0 timeout: description: - - Timeout in seconds for URL requests to OOB controller + - Timeout in seconds for HTTP requests to OOB controller. default: 10 type: int From a77bb090b3bdee176588af73bde1876e9ec1ec21 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 27 May 2022 11:23:20 +0200 Subject: [PATCH 13/20] Remove no longer needed files. (cherry picked from commit 1e646aad2d8e9d3136cbb92bf4a2dfe4bc60cb84) --- tests/sanity/ignore-2.10.txt | 44 ------------------------------------ tests/sanity/ignore-2.9.txt | 33 --------------------------- 2 files changed, 77 deletions(-) delete mode 100644 tests/sanity/ignore-2.10.txt delete mode 100644 tests/sanity/ignore-2.9.txt diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt deleted file mode 100644 index 83bf11e304..0000000000 --- a/tests/sanity/ignore-2.10.txt +++ /dev/null @@ -1,44 +0,0 @@ -.azure-pipelines/scripts/publish-codecov.py replace-urlopen -.azure-pipelines/scripts/publish-codecov.py compile-2.6!skip # Uses Python 3.6+ syntax -.azure-pipelines/scripts/publish-codecov.py compile-2.7!skip # Uses Python 3.6+ syntax -.azure-pipelines/scripts/publish-codecov.py compile-3.5!skip # Uses Python 3.6+ syntax -.azure-pipelines/scripts/publish-codecov.py future-import-boilerplate -.azure-pipelines/scripts/publish-codecov.py metaclass-boilerplate -plugins/module_utils/cloud.py pylint:bad-option-value # a pylint test that is disabled was modified over time -plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path -plugins/modules/cloud/lxc/lxc_container.py validate-modules:use-run-command-not-popen -plugins/modules/cloud/lxd/lxd_project.py use-argspec-type-path # expanduser() applied to constants -plugins/modules/cloud/misc/rhevm.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloud/rackspace/rax.py use-argspec-type-path # fix needed -plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path -plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values -plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc -plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements -plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter -plugins/modules/cloud/univention/udm_share.py validate-modules:parameter-list-no-elements -plugins/modules/cloud/univention/udm_user.py validate-modules:parameter-list-no-elements -plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type -plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter -plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice -plugins/modules/packaging/language/yarn.py use-argspec-type-path -plugins/modules/packaging/os/redhat_subscription.py validate-modules:return-syntax-error -plugins/modules/remote_management/manageiq/manageiq_policies.py validate-modules:parameter-state-invalid-choice -plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:doc-choices-do-not-match-spec # missing docs on suboptions -plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:doc-missing-type # missing docs on suboptions -plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:parameter-type-not-in-doc # missing docs on suboptions -plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:undocumented-parameter # missing docs on suboptions -plugins/modules/remote_management/manageiq/manageiq_tags.py validate-modules:parameter-state-invalid-choice -plugins/modules/system/gconftool2.py validate-modules:parameter-state-invalid-choice -plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter -plugins/modules/system/osx_defaults.py validate-modules:parameter-state-invalid-choice -plugins/modules/system/parted.py validate-modules:parameter-state-invalid-choice -plugins/modules/system/puppet.py use-argspec-type-path -plugins/modules/system/puppet.py validate-modules:parameter-invalid # invalid alias - removed in 7.0.0 -plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path -plugins/modules/system/xfconf.py validate-modules:return-syntax-error -plugins/modules/web_infrastructure/jenkins_plugin.py use-argspec-type-path -tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py compile-2.6 # django generated code -tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py compile-2.7 # django generated code diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt deleted file mode 100644 index ffc4917389..0000000000 --- a/tests/sanity/ignore-2.9.txt +++ /dev/null @@ -1,33 +0,0 @@ -.azure-pipelines/scripts/publish-codecov.py replace-urlopen -.azure-pipelines/scripts/publish-codecov.py compile-2.6!skip # Uses Python 3.6+ syntax -.azure-pipelines/scripts/publish-codecov.py compile-2.7!skip # Uses Python 3.6+ syntax -.azure-pipelines/scripts/publish-codecov.py compile-3.5!skip # Uses Python 3.6+ syntax -.azure-pipelines/scripts/publish-codecov.py future-import-boilerplate -.azure-pipelines/scripts/publish-codecov.py metaclass-boilerplate -plugins/module_utils/cloud.py pylint:bad-option-value # a pylint test that is disabled was modified over time -plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path -plugins/modules/cloud/lxc/lxc_container.py validate-modules:use-run-command-not-popen -plugins/modules/cloud/lxd/lxd_project.py use-argspec-type-path # expanduser() applied to constants -plugins/modules/cloud/rackspace/rax.py use-argspec-type-path -plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path -plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values -plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc -plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter -plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type -plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter -plugins/modules/packaging/language/yarn.py use-argspec-type-path -plugins/modules/packaging/os/redhat_subscription.py validate-modules:return-syntax-error -plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:doc-choices-do-not-match-spec # missing docs on suboptions -plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:doc-missing-type # missing docs on suboptions -plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:parameter-type-not-in-doc # missing docs on suboptions -plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:undocumented-parameter # missing docs on suboptions -plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter -plugins/modules/system/puppet.py use-argspec-type-path -plugins/modules/system/puppet.py validate-modules:parameter-invalid # invalid alias - removed in 7.0.0 -plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path -plugins/modules/system/xfconf.py validate-modules:return-syntax-error -plugins/modules/web_infrastructure/jenkins_plugin.py use-argspec-type-path -tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py compile-2.6 # django generated code -tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py compile-2.7 # django generated code From 15c4e08295ce3ed6e3c2ba288aabe0ef83b36454 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Fri, 27 May 2022 14:21:03 +0200 Subject: [PATCH 14/20] Update CI matrix. (#4737) (#4739) (cherry picked from commit dcb2e09b4af3795268154df9a41b2c17d323e6f2) Co-authored-by: Felix Fontein --- .azure-pipelines/azure-pipelines.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 551b79cf8e..289108c04d 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -251,14 +251,14 @@ stages: targets: - name: CentOS 7 test: centos7 - - name: Fedora 34 - test: fedora34 + - name: Fedora 35 + test: fedora35 - name: Fedora 36 test: fedora36 - name: openSUSE 15 test: opensuse15 - - name: Ubuntu 18.04 - test: ubuntu1804 + - name: Ubuntu 20.04 + test: ubuntu2004 - name: Ubuntu 22.04 test: ubuntu2204 - name: Alpine 3 @@ -297,8 +297,8 @@ stages: test: centos6 - name: Fedora 34 test: fedora34 - - name: Ubuntu 20.04 - test: ubuntu2004 + - name: Ubuntu 18.04 + test: ubuntu1804 groups: - 1 - 2 From 6252f3bded14e25c16d19c191e7f33366a241d80 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 29 May 2022 07:59:03 +0200 Subject: [PATCH 15/20] Fix quoting bug in zfs. (#4726) (#4744) (cherry picked from commit 01b32fec14316dd1785938796d04df6ac75570eb) Co-authored-by: Felix Fontein --- changelogs/fragments/4726-zfs.yml | 2 ++ plugins/modules/storage/zfs/zfs.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/4726-zfs.yml diff --git a/changelogs/fragments/4726-zfs.yml b/changelogs/fragments/4726-zfs.yml new file mode 100644 index 0000000000..c785e2ba11 --- /dev/null +++ b/changelogs/fragments/4726-zfs.yml @@ -0,0 +1,2 @@ +bugfixes: + - "zfs - fix wrong quoting of properties (https://github.com/ansible-collections/community.general/issues/4707, https://github.com/ansible-collections/community.general/pull/4726)." diff --git a/plugins/modules/storage/zfs/zfs.py b/plugins/modules/storage/zfs/zfs.py index e206a8f7ba..ca15893f19 100644 --- a/plugins/modules/storage/zfs/zfs.py +++ b/plugins/modules/storage/zfs/zfs.py @@ -160,7 +160,7 @@ class Zfs(object): elif prop == 'volblocksize': cmd += ['-b', value] else: - cmd += ['-o', '%s="%s"' % (prop, value)] + cmd += ['-o', '%s=%s' % (prop, value)] if origin and action == 'clone': cmd.append(origin) cmd.append(self.name) From 22b4fc8d8b1694de000e11fcb77c44ddcf243a5e Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 30 May 2022 07:04:59 +0200 Subject: [PATCH 16/20] DOC: Documment setting of NTP server in examples. (#4655) (#4748) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tested on iLO 5 (HP Gen 10). Command checked from iLO5 REST API reference at https://hewlettpackard.github.io/ilo-rest-api-docs/ilo5/#configuring-network-time-protocol-ntp (cherry picked from commit 3b48bde84f2375a85bb8e2f04aa58e7bb170ee12) Co-authored-by: Ondrej Faměra --- .../remote_management/redfish/ilo_redfish_config.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/modules/remote_management/redfish/ilo_redfish_config.py b/plugins/modules/remote_management/redfish/ilo_redfish_config.py index 3f9da0a4d8..837b2103b8 100644 --- a/plugins/modules/remote_management/redfish/ilo_redfish_config.py +++ b/plugins/modules/remote_management/redfish/ilo_redfish_config.py @@ -82,6 +82,17 @@ EXAMPLES = ''' password: Testpass123 attribute_name: TimeZone attribute_value: Chennai + + - name: Set NTP Servers + community.general.ilo_redfish_config: + category: Manager + command: SetNTPServers + baseuri: 15.X.X.X + username: Admin + password: Testpass123 + attribute_name: StaticNTPServers + attribute_value: X.X.X.X + ''' RETURN = ''' From 05ac79cee6f840b028f0c14d15518c54fc0e5346 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 30 May 2022 07:14:47 +0200 Subject: [PATCH 17/20] Prepare 5.0.1 release. --- changelogs/fragments/5.0.1.yml | 1 + galaxy.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/5.0.1.yml diff --git a/changelogs/fragments/5.0.1.yml b/changelogs/fragments/5.0.1.yml new file mode 100644 index 0000000000..88759d331d --- /dev/null +++ b/changelogs/fragments/5.0.1.yml @@ -0,0 +1 @@ +release_summary: Regular bugfix release for inclusion in Ansible 6.0.0. diff --git a/galaxy.yml b/galaxy.yml index 66b2fc746a..8f637b27c2 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,6 +1,6 @@ namespace: community name: general -version: 5.1.0 +version: 5.0.1 readme: README.md authors: - Ansible (https://github.com/ansible) From 77e25a7503e7a93d2c97050fdf2cdbeccfc5e4dc Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 30 May 2022 08:12:53 +0200 Subject: [PATCH 18/20] fix invalid fail_json call (#4733) (#4750) * fix invalid fail_json call Currently causes this error: ``` TypeError: AnsibleModule.fail_json() missing 1 required positional argument: 'msg' gitlab | FAILED! => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python3.10" }, "changed": false, "module_stderr": "Shared connection to 10.0.3.100 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/root/.ansible/tmp/ansible-tmp-1653579059.8318024-147674-84188943153768/AnsiballZ_redis.py\", line 107, in \r\n _ansiballz_main()\r\n File \"/root/.ansible/tmp/ansible-tmp-1653579059.8318024-147674-84188943153768/AnsiballZ_redis.py\", line 99, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/root/.ansible/tmp/ansible-tmp-1653579059.8318024-147674-84188943153768/AnsiballZ_redis.py\", line 47, in invoke_module\r\n runpy.run_module(mod_name='ansible_collections.community.general.plugins.modules.redis', init_globals=dict(_module_fqn='ansible_collections.community.general.plugins.modules.redis', _modlib_path=modlib_path),\r\n File \"/usr/lib/python3.10/runpy.py\", line 209, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\r\n _run_code(code, mod_globals, init_globals,\r\n File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\r\n exec(code, run_globals)\r\n File \"/tmp/ansible_community.general.redis_payload_di15cy0s/ansible_community.general.redis_payload.zip/ansible_collections/community/general/plugins/modules/redis.py\", line 328, in \r\n File \"/tmp/ansible_community.general.redis_payload_di15cy0s/ansible_community.general.redis_payload.zip/ansible_collections/community/general/plugins/modules/redis.py\", line 195, in main\r\n File \"/tmp/ansible_community.general.redis_payload_di15cy0s/ansible_community.general.redis_payload.zip/ansible_collections/community/general/plugins/module_utils/redis.py\", line 40, in fail_imports\r\nTypeError: AnsibleModule.fail_json() missing 1 required positional argument: 'msg'\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 } ``` * Add changelog. Co-authored-by: Felix Fontein (cherry picked from commit e55875107b1ca63451789536e3ae56be7892fab5) Co-authored-by: Brian Coca --- changelogs/fragments/4733-redis-fail.yml | 2 ++ plugins/module_utils/redis.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/4733-redis-fail.yml diff --git a/changelogs/fragments/4733-redis-fail.yml b/changelogs/fragments/4733-redis-fail.yml new file mode 100644 index 0000000000..f8a6e14d9a --- /dev/null +++ b/changelogs/fragments/4733-redis-fail.yml @@ -0,0 +1,2 @@ +bugfixes: + - "redis* modules - fix call to ``module.fail_json`` when failing because of missing Python libraries (https://github.com/ansible-collections/community.general/pull/4733)." diff --git a/plugins/module_utils/redis.py b/plugins/module_utils/redis.py index de5c8c7fc3..8f035614f0 100644 --- a/plugins/module_utils/redis.py +++ b/plugins/module_utils/redis.py @@ -37,7 +37,7 @@ def fail_imports(module, needs_certifi=True): errors.append(missing_required_lib('certifi')) traceback.append(CERTIFI_IMPORT_ERROR) if errors: - module.fail_json(errors=errors, traceback='\n'.join(traceback)) + module.fail_json(msg='\n'.join(errors), traceback='\n'.join(traceback)) def redis_auth_argument_spec(tls_default=True): From 66a7fdfebad7aef37b4d4b76ed3c418b62bbde00 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 30 May 2022 12:55:41 +0200 Subject: [PATCH 19/20] keycloak_realm: fix default groups and roles (#4241) (#4719) (#4754) * keycloak_realm: fix default groups and roles (#4241) * add changelog fragment (cherry picked from commit 7ee15f95f75ae9e9c0b592800cc2bdd299d84747) Co-authored-by: adam-cleo <90759784+adam-cleo@users.noreply.github.com> --- changelogs/fragments/4719-fix-keycloak-realm.yaml | 2 ++ plugins/modules/identity/keycloak/keycloak_realm.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 changelogs/fragments/4719-fix-keycloak-realm.yaml diff --git a/changelogs/fragments/4719-fix-keycloak-realm.yaml b/changelogs/fragments/4719-fix-keycloak-realm.yaml new file mode 100644 index 0000000000..3071756ec5 --- /dev/null +++ b/changelogs/fragments/4719-fix-keycloak-realm.yaml @@ -0,0 +1,2 @@ +bugfixes: + - "keycloak_realm - fix default groups and roles (https://github.com/ansible-collections/community.general/issues/4241)." \ No newline at end of file diff --git a/plugins/modules/identity/keycloak/keycloak_realm.py b/plugins/modules/identity/keycloak/keycloak_realm.py index 90b8d62a56..fd9f17ebf8 100644 --- a/plugins/modules/identity/keycloak/keycloak_realm.py +++ b/plugins/modules/identity/keycloak/keycloak_realm.py @@ -163,7 +163,7 @@ options: aliases: - defaultGroups type: list - elements: dict + elements: str default_locale: description: - The realm default locale. @@ -183,7 +183,7 @@ options: aliases: - defaultRoles type: list - elements: dict + elements: str default_signature_algorithm: description: - The realm default signature algorithm. @@ -622,10 +622,10 @@ def main(): client_authentication_flow=dict(type='str', aliases=['clientAuthenticationFlow']), client_scope_mappings=dict(type='dict', aliases=['clientScopeMappings']), default_default_client_scopes=dict(type='list', elements='str', aliases=['defaultDefaultClientScopes']), - default_groups=dict(type='list', elements='dict', aliases=['defaultGroups']), + default_groups=dict(type='list', elements='str', aliases=['defaultGroups']), default_locale=dict(type='str', aliases=['defaultLocale']), default_optional_client_scopes=dict(type='list', elements='str', aliases=['defaultOptionalClientScopes']), - default_roles=dict(type='list', elements='dict', aliases=['defaultRoles']), + default_roles=dict(type='list', elements='str', aliases=['defaultRoles']), default_signature_algorithm=dict(type='str', aliases=['defaultSignatureAlgorithm']), direct_grant_flow=dict(type='str', aliases=['directGrantFlow']), display_name=dict(type='str', aliases=['displayName']), From ad3e7bc21d34b4aa749ccc4d3ec76b87eed70be3 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 30 May 2022 13:00:22 +0200 Subject: [PATCH 20/20] Release 5.0.1. --- CHANGELOG.rst | 28 +++++++++++++++ changelogs/changelog.yaml | 36 +++++++++++++++++++ changelogs/fragments/4674-use-mh-raise.yaml | 6 ---- ...bility-virtualmedia-resource-location.yaml | 2 -- changelogs/fragments/4700-code-changes.yml | 3 -- changelogs/fragments/4712-consul-bugfix.yaml | 2 -- .../fragments/4719-fix-keycloak-realm.yaml | 2 -- changelogs/fragments/4726-zfs.yml | 2 -- changelogs/fragments/4733-redis-fail.yml | 2 -- changelogs/fragments/5.0.1.yml | 1 - 10 files changed, 64 insertions(+), 20 deletions(-) delete mode 100644 changelogs/fragments/4674-use-mh-raise.yaml delete mode 100644 changelogs/fragments/4682-compatibility-virtualmedia-resource-location.yaml delete mode 100644 changelogs/fragments/4700-code-changes.yml delete mode 100644 changelogs/fragments/4712-consul-bugfix.yaml delete mode 100644 changelogs/fragments/4719-fix-keycloak-realm.yaml delete mode 100644 changelogs/fragments/4726-zfs.yml delete mode 100644 changelogs/fragments/4733-redis-fail.yml delete mode 100644 changelogs/fragments/5.0.1.yml diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f8dd2fa678..f9538c247a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,34 @@ Community General Release Notes This changelog describes changes after version 4.0.0. +v5.0.1 +====== + +Release Summary +--------------- + +Regular bugfix release for inclusion in Ansible 6.0.0. + +Minor Changes +------------- + +- cpanm - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674). +- mksysb - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674). +- pipx - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674). +- snap - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674). +- xfconf - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674). + +Bugfixes +-------- + +- consul - fixed bug introduced in PR 4590 (https://github.com/ansible-collections/community.general/issues/4680). +- filesystem - handle ``fatresize --info`` output lines without ``:`` (https://github.com/ansible-collections/community.general/pull/4700). +- filesystem - improve error messages when output cannot be parsed by including newlines in escaped form (https://github.com/ansible-collections/community.general/pull/4700). +- keycloak_realm - fix default groups and roles (https://github.com/ansible-collections/community.general/issues/4241). +- redis* modules - fix call to ``module.fail_json`` when failing because of missing Python libraries (https://github.com/ansible-collections/community.general/pull/4733). +- xcc_redfish_command - for compatibility due to Redfish spec changes the virtualMedia resource location changed from Manager to System (https://github.com/ansible-collections/community.general/pull/4682). +- zfs - fix wrong quoting of properties (https://github.com/ansible-collections/community.general/issues/4707, https://github.com/ansible-collections/community.general/pull/4726). + v5.0.0 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 93848ff41e..5cef13733e 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -755,3 +755,39 @@ releases: name: counter namespace: null release_date: '2022-04-29' + 5.0.1: + changes: + bugfixes: + - consul - fixed bug introduced in PR 4590 (https://github.com/ansible-collections/community.general/issues/4680). + - filesystem - handle ``fatresize --info`` output lines without ``:`` (https://github.com/ansible-collections/community.general/pull/4700). + - filesystem - improve error messages when output cannot be parsed by including + newlines in escaped form (https://github.com/ansible-collections/community.general/pull/4700). + - keycloak_realm - fix default groups and roles (https://github.com/ansible-collections/community.general/issues/4241). + - redis* modules - fix call to ``module.fail_json`` when failing because of + missing Python libraries (https://github.com/ansible-collections/community.general/pull/4733). + - xcc_redfish_command - for compatibility due to Redfish spec changes the virtualMedia + resource location changed from Manager to System (https://github.com/ansible-collections/community.general/pull/4682). + - zfs - fix wrong quoting of properties (https://github.com/ansible-collections/community.general/issues/4707, + https://github.com/ansible-collections/community.general/pull/4726). + minor_changes: + - cpanm - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived + modules (https://github.com/ansible-collections/community.general/pull/4674). + - mksysb - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived + modules (https://github.com/ansible-collections/community.general/pull/4674). + - pipx - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived + modules (https://github.com/ansible-collections/community.general/pull/4674). + - snap - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived + modules (https://github.com/ansible-collections/community.general/pull/4674). + - xfconf - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived + modules (https://github.com/ansible-collections/community.general/pull/4674). + release_summary: Regular bugfix release for inclusion in Ansible 6.0.0. + fragments: + - 4674-use-mh-raise.yaml + - 4682-compatibility-virtualmedia-resource-location.yaml + - 4700-code-changes.yml + - 4712-consul-bugfix.yaml + - 4719-fix-keycloak-realm.yaml + - 4726-zfs.yml + - 4733-redis-fail.yml + - 5.0.1.yml + release_date: '2022-05-30' diff --git a/changelogs/fragments/4674-use-mh-raise.yaml b/changelogs/fragments/4674-use-mh-raise.yaml deleted file mode 100644 index 3e8ad13975..0000000000 --- a/changelogs/fragments/4674-use-mh-raise.yaml +++ /dev/null @@ -1,6 +0,0 @@ -minor_changes: - - cpanm - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674). - - pipx - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674). - - snap - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674). - - mksysb - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674). - - xfconf - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674). diff --git a/changelogs/fragments/4682-compatibility-virtualmedia-resource-location.yaml b/changelogs/fragments/4682-compatibility-virtualmedia-resource-location.yaml deleted file mode 100644 index c15ee4d15c..0000000000 --- a/changelogs/fragments/4682-compatibility-virtualmedia-resource-location.yaml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - xcc_redfish_command - for compatibility due to Redfish spec changes the virtualMedia resource location changed from Manager to System (https://github.com/ansible-collections/community.general/pull/4682). \ No newline at end of file diff --git a/changelogs/fragments/4700-code-changes.yml b/changelogs/fragments/4700-code-changes.yml deleted file mode 100644 index d1b281d876..0000000000 --- a/changelogs/fragments/4700-code-changes.yml +++ /dev/null @@ -1,3 +0,0 @@ -bugfixes: - - "filesystem - improve error messages when output cannot be parsed by including newlines in escaped form (https://github.com/ansible-collections/community.general/pull/4700)." - - "filesystem - handle ``fatresize --info`` output lines without ``:`` (https://github.com/ansible-collections/community.general/pull/4700)." diff --git a/changelogs/fragments/4712-consul-bugfix.yaml b/changelogs/fragments/4712-consul-bugfix.yaml deleted file mode 100644 index bc63999b11..0000000000 --- a/changelogs/fragments/4712-consul-bugfix.yaml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - consul - fixed bug introduced in PR 4590 (https://github.com/ansible-collections/community.general/issues/4680). diff --git a/changelogs/fragments/4719-fix-keycloak-realm.yaml b/changelogs/fragments/4719-fix-keycloak-realm.yaml deleted file mode 100644 index 3071756ec5..0000000000 --- a/changelogs/fragments/4719-fix-keycloak-realm.yaml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - "keycloak_realm - fix default groups and roles (https://github.com/ansible-collections/community.general/issues/4241)." \ No newline at end of file diff --git a/changelogs/fragments/4726-zfs.yml b/changelogs/fragments/4726-zfs.yml deleted file mode 100644 index c785e2ba11..0000000000 --- a/changelogs/fragments/4726-zfs.yml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - "zfs - fix wrong quoting of properties (https://github.com/ansible-collections/community.general/issues/4707, https://github.com/ansible-collections/community.general/pull/4726)." diff --git a/changelogs/fragments/4733-redis-fail.yml b/changelogs/fragments/4733-redis-fail.yml deleted file mode 100644 index f8a6e14d9a..0000000000 --- a/changelogs/fragments/4733-redis-fail.yml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - "redis* modules - fix call to ``module.fail_json`` when failing because of missing Python libraries (https://github.com/ansible-collections/community.general/pull/4733)." diff --git a/changelogs/fragments/5.0.1.yml b/changelogs/fragments/5.0.1.yml deleted file mode 100644 index 88759d331d..0000000000 --- a/changelogs/fragments/5.0.1.yml +++ /dev/null @@ -1 +0,0 @@ -release_summary: Regular bugfix release for inclusion in Ansible 6.0.0.