1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/changelogs/fragments
Jean Raby 1580f3c2b4
request for comments - pacman: speed up most operations when working with a package list (#3907)
* pacman: rewrite with a cache to speed up execution

- Use a cache (or inventory) to speed up lookups of:
  - installed packages and groups
  - available packages and groups
  - upgradable packages
- Call pacman with the list of pkgs instead of one call per package (for
  installations, upgrades and removals)
- Use pacman [--sync|--upgrade] --print-format [...] to gather list of
  changes. Parsing that instead of the regular output of pacman, which
  is error prone and can be changed by user configuration.
  This can introduce a TOCTOU problem but unless something else calls
  pacman between the invocations, it shouldn't be a concern.
- Given the above, "check mode" code is within the function that would
  carry out the actual operation. This should make it harder for the
  check code and the "real code" to diverge.
- Support for specifying alternate package name formats is a bit more
  robust. pacman is used to extract the name of the package when the
  specified package is a file or a URL.
  The "<repo>/<pkgname>" format is also supported.

For "state: latest" with a list of ~35 pkgs, this module is about 5
times faster than the original.

* Let fail() actually work

* all unhappy paths now end up calling fail()

* Update copyright

* Argument changes

update_cache_extra_args handled as a list like the others
moved the module setup to its own function for easier testing
update and upgrade have no defaults (None) to let required_one_of() do
its job properly

* update_cache exit path

Shift successful exit without name or upgrade under "update_cache".

It is an error if name or upgrade isn't specified and update_cache wasn't specified
either. (Caught by ansiblemodule required_one_of but still)

* Add pkgs to output on success only

Also align both format, only pkg name for now

* Multiple fixes

Move VersionTuple to top level for import from tests
Add removed pkgs to the exit json when removing packages
fixup list of upgraded pkgs reported on upgrades (was tuple of list for
no reason)
use list idiom for upgrades, like the rest
drop unused expand_package_groups function
skip empty lines when building inventory

* pacman: add tests

* python 2.x compat + pep8

* python 2.x some more

* Fix failure when pacman emits warnings

Add tests covering that failure case

* typo

* Whitespace

black failed me...

* Adjust documentation to fit implicit defaults

* fix test failures on older pythons

* remove file not intended for commit

* Test exception str with e.match

* Build inventory after cache update + adjust tests

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/packaging/os/pacman.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* changelog

* bump copyright year and add my name to authors

* Update changelogs/fragments/3907-pacman-speedup.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* maintainer entry

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-02-08 22:46:00 +01:00
..
.keep Rename changelogs/fragments/.empty -> changelogs/fragments/.keep 2020-08-07 08:17:57 +02:00
705-gitlab-auth-support.yml Add additional auth support to Gitlab (#705) (#3918) 2021-12-20 21:59:12 +01:00
1088-add_multiple_ipv6_address_support.yml nmcli: adding ipv6 address list support (#3776) 2021-12-09 21:17:32 +01:00
1088-nmcli_add_multiple_addresses_support.yml nmcli: adding ipv6 address list support (#3776) 2021-12-09 21:17:32 +01:00
2386-github_repo-fix-idempotency-issues.yml Bugfix: github_repo does not apply defaults on existing repos (#2386) 2021-11-22 07:11:26 +01:00
3357-nmcli-eui64-and-ipv6privacy.yml nmcli - add support for addr-gen-mode and ip6-privacy options (#3802) 2021-12-04 18:41:14 +01:00
3374-add-ipa-ptr-sync-support.yml ipa_dnszone: add PTR synchronization support for dnszones (#3374) 2021-12-27 09:35:24 +01:00
3519-inventory-support-lxd-4.yml LXD inventory: Support virtual machines (#3519) 2021-12-13 22:01:52 +01:00
3625-nmcli_false_changed_mtu_fix.yml Fix dummy interface returning changed (#3625) 2021-11-10 07:04:24 +01:00
3632-add-redfish-host-interface-config-support.yml redfish_config: Add support to configure Redfish Host Interface (#3632) 2021-11-13 13:59:29 +01:00
3660-a_module-tombstone.yml a_module test: fix crash in case of tombstoning (#3660) 2021-11-04 08:29:17 +01:00
3661-lxd_container-add-vm-support.yml lxd_container: support lxd instance types (#3661) 2021-11-20 08:20:24 +01:00
3667-ldap_search.yml Allow LDAP search to run in check mode (#3667) 2021-11-13 15:00:05 +01:00
3675-xattr-handle-base64-values.yml Better handling of base64-encoded values in xattr module (#3675) 2021-11-09 06:08:15 +01:00
3681-lvol-fix-create.yml Rework safety check on size arguments for when LV doesn't exist (#3681) 2021-11-13 14:00:32 +01:00
3693-add-redfish-host-interface-info-support.yml Add GetHostInterfaces command to redfish_info (#3693) 2021-11-16 19:46:28 +01:00
3694-gitlab-cleanup.yml gitlab: clean up modules and utils (#3694) 2021-11-16 13:01:32 +01:00
3702-ipmi-encryption-key.yml Support IPMI encryption key parameter in ipmi_boot (#3702) 2021-11-22 07:18:13 +01:00
3703-force-install-homebrew-cask.yml homebrew_cask: reinstall when force is install option (#4090) 2022-02-02 21:31:05 +01:00
3708-listen_ports_facts-add-ss-support.yml listen_ports_facts: Added support for ss (#3708) 2021-11-16 19:50:29 +01:00
3709-support-batch-mode.yml Enable counter_enabled.py to support batch mode (#3709) 2021-11-15 21:39:51 +01:00
3726-terraform-missing-parameters-planned-fix.yml terraform: ensuring command options are applied during build_plan (#3726) 2021-11-23 05:31:35 +01:00
3758-pacman-add-stdout-stderr.yml pacman: add stdout and stderr as return parameters (#3758) 2021-11-22 19:50:09 +01:00
3765-extend-open_iscsi-with-rescan.yml extend open_iscsi to allow rescanning a session to discover new mapped LUN's #3763 (#3765) 2021-11-22 19:28:08 +01:00
3768-nmcli_fix_changed_when_no_mask_set.yml Fixing ip address without mask bug (#3784) 2021-11-28 21:09:49 +01:00
3780-add-keycloak-sssd-user-federation.yml Keycloak: add sssd provider for user federation (#3780) 2021-11-25 13:02:29 +01:00
3785-python_requirements_info-versionless-op.yaml python_requirements_info - fail when version operator used without version (#3785) 2021-11-26 07:09:46 +01:00
3792-improve_gitlab_group_and_project.yml Moved changelog fragment file to the right directory (#3853) 2021-12-05 17:06:09 +01:00
3797-python_requirements_info-improvements.yaml python_requirements_info - improvements (#3797) 2021-11-30 06:08:45 +00:00
3798-fix-lxd-connection-option-vars-support.yml Update lxd connection to use all documented vars for options (#3798) 2021-12-09 21:18:39 +01:00
3800-pipx-include-apps.yaml pipx - fixed --include-apps bug (#3800) 2021-11-30 07:10:20 +01:00
3801-mh-deprecate-vardict-attr.yaml ModuleHelper - deprecate attribute VarDict (#3801) 2021-11-30 07:10:48 +01:00
3805-iso_extract-run_command-list.yaml iso_extract - invoke run_command passing list (#3805) 2021-11-30 06:04:55 +01:00
3806-xattr-run_command-list.yaml xattr - invoke run_command passing list (#3806) 2021-11-30 08:33:11 +01:00
3807-logentries-run_command-list.yaml logentries - invoke run_command passing list (#3807) 2021-11-30 06:02:38 +01:00
3808-logstash_plugin-run_command-list.yaml logstash_plugin - invoke run_command passing list (#3808) 2021-12-01 06:58:45 +01:00
3821-monit-run-list.yaml monit - invoke run_command passing list (#3821) 2021-12-02 07:50:02 +01:00
3822-ip_netns-run-list.yaml ip_netns - invoke run_command passing list (#3822) 2021-12-01 07:10:46 +01:00
3829-svc-run-list.yaml svc - invoke run_command passing list (#3829) 2021-12-01 13:18:38 +01:00
3833-aix_filesystem-run-list.yaml aix_filesystems - invoke run_command passing list (#3833) 2021-12-09 21:19:44 +01:00
3834-aix-lvg-run-list.yaml aix_lvg - invoke run_command passing list (#3834) 2021-12-09 21:20:12 +01:00
3835-java-cert-run-list.yaml java_cert - invoke run_command passing list (#3835) 2021-12-03 07:27:03 +01:00
3837-opentelemetry_plugin-honour_ignore_errors.yaml opentelemetry: honour ignore errors (#3837) 2021-12-04 19:00:07 +01:00
3838-jira-token.yaml jira - Add support for Bearer token auth (#3838) 2021-12-09 21:24:24 +01:00
3840-hponcfg-mh-revamp.yaml hponcfg - revamped the module using ModuleHelper (#3840) 2021-12-11 21:15:33 +01:00
3849-mh-check-mode-decos.yaml MH decorators - added decorators for check_mode (#3849) 2021-12-05 21:47:51 +01:00
3851-lxc-container-run-list.yaml lxc_container - invoke run_command passing list (#3851) 2021-12-09 22:02:43 +01:00
3862-interfaces-file-fix-dup-option.yaml interfaces_file - fixed dup options bug (#3862) 2021-12-07 21:54:54 +01:00
3867-jira-fix-body.yaml jira - fixed 'body' dict key error (#3867) 2021-12-17 21:47:10 +01:00
3874-proxmox-fix-onboot-param.yml proxmox - fixing onboot parameter causing module failure when not defined (#3874) 2021-12-14 06:46:49 +01:00
3875-icinga2-inv-fix.yml Icinga2 Inventory Plugin - Error handling and inventory name changer (#3906) 2021-12-18 20:06:30 +01:00
3896-nmcli_vlan_missing_options.yaml Pass missing vlan-related options (flags, ingress, egress) to nmcli (#3896) 2021-12-13 21:43:54 +01:00
3907-pacman-speedup.yml request for comments - pacman: speed up most operations when working with a package list (#3907) 2022-02-08 22:46:00 +01:00
3909-nrdp_fix_string_args_without_encoding.yaml Fix nrdp string arguments without an encoding (#3909) 2021-12-17 17:06:20 +01:00
3916-fix-vdo-options-type.yml vdo: Remove unused variable (#4163) 2022-02-07 20:12:44 +01:00
3919-xfconf-baseclass.yaml xfconf - using aggregated base class (#3919) 2021-12-19 14:17:17 +01:00
3921-add-counter-filter-plugin.yml Add counter filter (#3921) 2021-12-26 14:56:21 +01:00
3930-proxmox-add-clone.yaml proxmox: Add clone parameter (#3930) 2022-01-06 07:01:25 +01:00
3933-slack-charset-header.yaml slack - use UTF-8 charset in content-type header (#3933) 2022-01-03 19:23:27 +01:00
3934-distutils.yml Get rid of distutils.spawn and distutils.util (#3934) 2022-01-04 06:56:28 +01:00
3935-use-gitlab-instance-runner-to-create-runner.yml gitlab: use gitlab instance runner to create runner (#3965) 2022-01-31 05:58:00 +01:00
3936-distutils.version.yml Use vendored copy of distutils.version. (#3984) 2022-01-05 21:19:49 +01:00
3940_fix_contenttype_scaleway_user_data.yml fix scaleway_user_data (#3940) 2021-12-27 19:40:55 +01:00
3943-add-option-options-to-snap-module.yml Add option "options" to snap module (#3943) 2022-01-24 06:39:37 +01:00
3946-mattermost_attachments.yml Mattermost: Add sending of attachments (#3946) 2022-01-03 19:24:12 +01:00
3951-scaleway_compute_add_project_id.yml Add support of project id for scawelay_compute (#3951) 2021-12-28 15:03:14 +01:00
3964-scaleway_volume_add_region.yml [Bug] Scaleway The volume is created systematically on par1 (#3964) 2022-01-05 17:53:00 +01:00
3968-ipmi_power-add-machine-option.yaml ipmi_power: Add machine option to ensure the power state via the remote target address (#3968) 2022-01-08 16:03:51 +01:00
3976-fix-alternatives-parsing.yml fix alternatives parsing when they are part of a group (#3976) 2022-01-10 07:10:22 +01:00
3980-puppet-show_diff.yml puppet: Add documentation and remove deprecation for show_diff, keep deprecation for alias show-diff (#3980) 2022-01-10 07:08:17 +01:00
3985-nmcli-add-wireguard-connection-type.yml nmcli: Add wireguard connection type support (#3985) 2022-01-08 14:13:50 +01:00
3988-distutils-vendor-removed.yml Unvendor distutils.version (#3988) 2022-01-08 21:45:02 +01:00
4026-fix-mail-callback.yml Fix exception in the mail callback plugin (#4026) 2022-01-20 08:31:09 +01:00
4029-proxmox-refactor.yml Refactor all Proxmox modules to use shared module_utils. (#4029) 2022-02-07 06:21:24 +01:00
4030-proxmox-has-proxmoxer.yml Move Proxmox HAS_PROXMOXER check into module_utils. (#4030) 2022-01-16 20:13:47 +01:00
4036-onevm-add-release-action.yaml one_vm: add release action (#4036) 2022-01-24 19:52:32 +01:00
4038-fix-and-rework-gitlb-project-variable.yml Fix and rework gitlab_project_variable (#4038) 2022-01-31 20:00:37 +01:00
4039-cluster-container-wait.yml Adding while loop to wait for cluster container creation (#4039) 2022-01-28 07:08:52 +01:00
4040-linode-token-templating.yaml linode: Allow templating token for dynamic inventory (#4040) 2022-01-30 22:16:59 +01:00
4043-fix-no-log-opentelemetry.yml opentelemetry: no_log:true causes exception when generating trace (#4043) 2022-01-17 18:50:19 +01:00
4048-expand-tilde-in-yarn-global-install-folder.yaml Actually expand ~ in yarn global install folder (#4048) 2022-01-28 07:17:06 +01:00
4049-profile-for-scaleway-inventory.yml Add profile parameter for scaleway inventory (#4049) 2022-01-31 19:33:35 +01:00
4050-properly-parse-json-lines-output-from-yarn.yaml Properly parse JSON Lines output from yarn (#4050) 2022-01-28 07:13:08 +01:00
4052-fix-detection-of-installed-cargo-packages-with-hyphens.yaml Fix detection of installed cargo packages with hyphens in name (#4052) 2022-01-18 12:12:48 +01:00
4056-add-missing-mail-headers.yml mail: add Date and Message-ID headers (#4056) 2022-01-21 07:27:20 +01:00
4058-lists_mergeby-add-parameters.yml Add options to filter lists_mergeby (#4058) 2022-01-28 08:19:19 +01:00
4062-nmcli-ipv6-routes-support.yml Add nmcli support for IPv6 routes (#4062) 2022-01-23 13:02:03 +01:00
4068-add-include_file-option.yml [inventory/cobbler] Add include_profiles option (#4068) 2022-01-31 05:57:09 +01:00
4078-python_requirements_info.yaml python_requirements_info: don't overwrite results in 'mismatched' dict key (#4078) 2022-01-29 15:30:07 +01:00
4088-add-constructed-interface-for-icinga2-inventory.yml Added new feature for ansible_user and ansible_port in Icinga2 inventory source (#4088) 2022-01-31 19:50:08 +01:00
4092-fix_local_ports_regex_listen_ports_facts.yaml Fix local port regex in listen_ports_facts (#4092) 2022-01-31 19:33:11 +01:00
4104-opentelemetry_plugin-enrich_docker_login.yaml opentelemetry: enrich service for community.docker.docker_login (#4104) 2022-01-29 15:13:36 +01:00
4140-mail-callback-options.yml mail callback: fully use Ansible's option handling; deprecate not specifying sender (#4140) 2022-02-01 10:12:03 +01:00
4150-gitlab-project-variable-absent-fix.yml gitlab_project_variable: Allow delete without value (#4150) 2022-02-05 21:02:04 +01:00