1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
Commit graph

977 commits

Author SHA1 Message Date
patchback[bot]
a163ec3afa
Command Runner (#4476) (#4572)
* initial commit, passing unit tests

* passing one very silly integration test

* multiple changes:

- updated copyright year
- cmd_runner
  - added fmt_optval
  - created specific exceptions
  - fixed bug in context class where values from module params were not
    being used for resolving cmd arguments
  - changed order of class declaration for readability purpose
- tests
  - minor improvements in integration test code
  - removed some extraneous code in msimple.yml
  - minor improvements in unit tests
  - added few missing cases to unit test

* multiple changes

cmd_runner.py

- renamed InvalidParameterName to MissingArgumentFormat
  - improved exception parameters
- added repr and str to all exceptions
- added unpacking decorator for fmt functions
- CmdRunner
  - improved parameter validation
- _CmdRunnerContext
  - Context runs must now pass named arguments
  - Simplified passing of additional arguments to module.run_command()
  - Provided multiple context variables with info about the run

Integration tests

- rename msimple.py to cmd_echo.py for clarity
- added more test cases

* cmd_runner: env update can be passed to runner

* adding runner context info to output

* added comment on OrderedDict

* wrong variable

* refactored all fmt functions into static methods of a class

Imports should be simpler now, only one object fmt, with attr access to all callables

* added unit tests for CmdRunner

* fixed sanity checks

* fixed mock imports

* added more unit tests for CmdRunner

* terminology consistency

* multiple adjustments:

- remove extraneous imports
- renamed some variables
- added wrapper around arg formatters to handle individual arg ignore_none behaviour

* removed old code commented out in test

* multiple changes:

- ensure fmt functions return list of strings
- renamed fmt parameter from `option` to `args`
- renamed fmt.mapped to fmt.as_map
- simplified fmt.as_map
- added tests for fmt.as_fixed

* more improvements in formats

* fixed sanity

* args_order can be a string (to be split())

and improved integration test

* simplified integration test

* removed overkill str() on values - run_command does that for us

* as_list makes more sense than as_str in that context

* added changelog fragment

* Update plugins/module_utils/cmd_runner.py

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

* adjusted __repr__ output for the exceptions

* added superclass object to classes

* added additional comment on the testcase sample/example

* suggestion from PR

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit f5b1b3c6f0)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-04-25 22:26:36 +02:00
patchback[bot]
868a6303be
Allow Proxmox Snapshot Restoring (#4377) (#4571)
* Allow restoring of snapshots

* Fix formatting

* Add documentation for new feature

* Revert unrelated reformatting

* Add documentation for snapshot change

* Remove redundant multiple call to status API

* Remove unneccesary indent

* Add documentation for timeout fix

* Update changelog fragment to reflect real changes

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

* Update changelog fragment to reflect real changes

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

* Add Tests for Snapshot rollback

* Update tests/unit/plugins/modules/cloud/misc/test_proxmox_snap.py

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

* Update changelogs/fragments/4377-allow-proxmox-snapshot-restoring.yml

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

* Update plugins/modules/cloud/misc/proxmox_snap.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit dbad1e0f11)

Co-authored-by: Timon Michel <ich.bin@ein.dev>
2022-04-25 06:54:22 +02:00
patchback[bot]
759e82d403
Proxmox inventory: implement API token auth (#4540) (#4570)
* Proxmox inventory: implement api token auth

* Apply suggestions from code review

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

* fix linter errors

* add changelog fragment

* add examples

* fix a typo and break long lines

* Update changelogs/fragments/4540-proxmox-inventory-token-auth.yml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit c8c2636676)

Co-authored-by: Daniel <mail@h3po.de>
2022-04-24 16:06:19 +02:00
patchback[bot]
ed0c768aaf
Removed 'default=None' in a batch of modules (#4556) (#4568)
* removed default=None

* removed default=None

* removed default=None

* removed default=None

* added changelog fragment

(cherry picked from commit b916cb369b)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-04-24 10:49:45 +02:00
patchback[bot]
e933ed782f
Removed 'default=None' in a batch of modules 2 (#4567) (#4569)
* removed default=None

* added changelog fragment

(cherry picked from commit 3b103f905e)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-04-24 10:49:29 +02:00
patchback[bot]
69e5a0dbf1
Fix keycloak realm parameters types (#4526) (#4560)
* Fix keycloack realm parameters types

* Add changelog fragment

* Update changelog fragment

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 0620cd2e74)

Co-authored-by: Alexandr <36310479+Vespand@users.noreply.github.com>
2022-04-23 08:49:44 +02:00
patchback[bot]
c4d166d3bc
nmcli: Change hairpin default mode (#4334) (#4558)
* nmcli: Deprecate default hairpin mode

Deprecate the default hairpin mode for a bridge.
Plain nmcli/bridge tools defaults to no, but for some reason ansible
defaults to yes.

We deprecate the default value so we can switch to default 'no' in
ansible 6.0.0

* Code review fixes

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

* Fix comments

* Update changelogs/fragments/4320-nmcli-hairpin.yml

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

* Update changelogs/fragments/4320-nmcli-hairpin.yml

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
(cherry picked from commit 53f6c68026)

Co-authored-by: dupondje <jean-louis@dupond.be>
2022-04-23 08:49:33 +02:00
Felix Fontein
9ae8e544cb Prepare 4.8.0 release. 2022-04-22 23:31:28 +02:00
Felix Fontein
94aef4526d Fix filename. 2022-04-22 23:29:56 +02:00
patchback[bot]
aeece5a107
Add project support for lxd_container and lxd_profile module (#4479) (#4561)
* add project support for lxd modules

* fix lxd_container yaml format error

* add changelog fragement add version_add entry

* fix LXD spelling

* complete lxd_profile example

(cherry picked from commit 552db0d353)

Co-authored-by: Raymond Chang <xrayjemmy@gmail.com>
2022-04-22 22:49:29 +02:00
patchback[bot]
5f59ec2d01
Implement contructable support for opennebula inventory plugin: keyed… (#4524) (#4549)
* Implement contructable support for opennebula inventory plugin: keyed_groups, compose, groups

* Fixed templating mock issues in unit tests, corrected some linting errors

* trying to make the linter happy

* Now trying to make python2.7 happy

* Added changelog fragment

* changelog fragment needs pluralization

* Update changelogs/fragments/4524-update-opennebula-inventory-plugin-to-match-documentation.yaml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 8e72e98adb)

Co-authored-by: Bill Sanders <billysanders@gmail.com>
2022-04-21 14:03:37 +02:00
patchback[bot]
3876df9052
nmap inventory plugin: Add sudo nmap (#4506) (#4544)
* nmap.py: Add sudo nmap

* Update plugins/inventory/nmap.py

Change description of new plugin option adding version_added

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

* Update plugins/inventory/nmap.py

Change boolean values of sudo option in example

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

* Create 4506-sudo-in-nmap-inv-plugin.yaml

* Fix typo in yaml format

* Update changelogs/fragments/4506-sudo-in-nmap-inv-plugin.yaml

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

* Update changelogs/fragments/4506-sudo-in-nmap-inv-plugin.yaml

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

* Document default as false.

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
(cherry picked from commit 3cce1217db)

Co-authored-by: ottobits <vindemaio@gmail.com>
2022-04-21 10:10:56 +02:00
patchback[bot]
e43a9b6974
xfconf: added missing value types (#4534) (#4541)
* xfconf: added missing value types

* added changelog fragment

* Update plugins/modules/system/xfconf.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit a2bfb96213)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-04-20 21:33:05 +02:00
patchback[bot]
9e2cb4363c
[pritunl] removed unnecessary data from auth string (#4530) (#4538)
* removed unnecessary data from auth string

* add changelog

Co-authored-by: vadim <vadim>
(cherry picked from commit 51a68517ce)

Co-authored-by: vvatlin <vvvvatlin@gmail.com>
2022-04-20 09:33:57 +02:00
patchback[bot]
90d31b9403
remove deprecated branch.unprotect() method in community.general.gitlab_branch (#4496) (#4528)
* remove deprecated branch.protect method

* add changelog fragment

* Update changelogs/fragments/4496-remove-deprecated-method-in-gitlab-branch-module.yml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit a8abb1a5bf)

Co-authored-by: York Wong <eth2net@gmail.com>
2022-04-19 20:04:51 +02:00
patchback[bot]
4d22d0790d
Correctly handle exception when no VM name returned by proxmox (#4508) (#4529)
(cherry picked from commit 8076f16aa9)

Co-authored-by: Marcin <stolarek.marcin@gmail.com>
2022-04-19 20:04:43 +02:00
patchback[bot]
5b029c66c5
Terraform init -upgrade flag (#4455) (#4502)
* Adds optional `-upgrade` flag to terraform init.

This allows Terraform to install provider dependencies into an existing project when the provider constraints change.

* fix transposed documentation keys

* Add integration tests for terraform init

* Revert to validate_certs: yes for general public testing

* skip integration tests on irrelevant platforms

* skip legacy Python versions from CI tests

* add changelog fragment

* Update plugins/modules/cloud/misc/terraform.py

Adds version_added metadata to the new module option.

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

* Change terraform_arch constant to Ansible fact mapping

* correct var typo, clarify task purpose

* Squashed some logic bugs, added override for local Terraform

If `existing_terraform_path` is provided, the playbook will not download Terraform or check its version.

I also tested this on a local system with Terraform installed, and squashed some bugs related to using of an
existing binary.

* revert to previous test behavior for TF install

* readability cleanup

* Update plugins/modules/cloud/misc/terraform.py

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit e4a25beedc)

Co-authored-by: Kamil Markowicz <geekifier@users.noreply.github.com>
2022-04-13 19:22:08 +02:00
patchback[bot]
760843b9e5
pacman: Fix removing locally installed packages (#4464) (#4504)
* pacman: Fix removing locally installed packages

Without this, using `absent` state for a locally installed package (for example from AUR, or from a package that was dropped from repositories) would return that package is already removed, despite remaining installed

* Undo unwanted whitespace removal

* Add changelog fragment

* Update changelogs/fragments/4464-pacman-fix-local-remove.yaml

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

* Add test.

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 3c515dd221)

Co-authored-by: Martin <spleefer90@gmail.com>
2022-04-13 19:21:46 +02:00
patchback[bot]
19ba15a783
gitlab: Use all=True in most list() calls (#4491) (#4503)
If `all=True` is not set then by default only 20 records will be
returned when calling `list()`. Use `all=True` so that all records
will be returned.

For the `list()` use where do not desire to retrieve all entries then
use`all=False` to show explicityly that we don't want to get all of
the entries.

Fixes: #3729
Fixes: #4460
(cherry picked from commit fe4bbc5de3)

Co-authored-by: John Villalovos <john@sodarock.com>
2022-04-13 13:43:21 +02:00
patchback[bot]
70a3dae965
dnsmadeeasy: only get monitor if it is not null api response (#4459) (#4500)
* Only get monitor if it is not null api response

* Add changelog fragment

* Update changelogs/fragments/4459-only-get-monitor-if-it-is-not-null-api-response.yaml

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

* Update plugins/modules/net_tools/dnsmadeeasy.py

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

Co-authored-by: drevai <revai.dominik@gravityrd.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 06675034fe)

Co-authored-by: drevai753 <86595897+drevai753@users.noreply.github.com>
2022-04-13 11:16:39 +00:00
patchback[bot]
26d5409a87
Implement btrfs resize support (#4465) (#4498)
* Implement btrfs resize support

* Add changelog fragment for btrfs resize support

Co-authored-by: Fabian Klemp <fabian.klemp@frequentis.com>
(cherry picked from commit 8ccc4d1fbb)

Co-authored-by: elara-leitstellentechnik <elara-leitstellentechnik@users.noreply.github.com>
2022-04-13 11:16:27 +00:00
patchback[bot]
6a74c46e1c
Redfish: Added IndicatorLED commands to the Systems category (#4458) (#4494)
* Redfish: Added IndicatorLED commands to the Systems category

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Method call typo fix

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Update 4084-add-redfish-system-indicator-led.yml

* Backwards compatibility suggestion

Signed-off-by: Mike Raineri <michael.raineri@dell.com>
(cherry picked from commit a9125c02e7)

Co-authored-by: Mike Raineri <michael.raineri@dell.com>
2022-04-11 20:22:58 +02:00
patchback[bot]
bec382df87
add support for datadog monitors of type event-v2 (#4457) (#4490)
* add support for datadog monitors of type event-v2

See https://docs.datadoghq.com/events/guides/migrating_to_new_events_features/

* add changelog fragement for PR

* typos

* add link to PR

* minor_fetaure, not bugfix

* add to description when we added event-v2 type

* Update changelogs/fragments/4457-support-datadog-monitors-type event-v2.yaml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 6edc176143)

Co-authored-by: ermeaney <ermeaney@gmail.com>
2022-04-11 08:01:41 +02:00
patchback[bot]
78f69224be
modules/xbps: fix error message (#4438) (#4489)
The previous error message was not giving the full or even correct
information to the user.

(cherry picked from commit d3adde4739)

Co-authored-by: Cameron Nemo <CameronNemo@users.noreply.github.com>
2022-04-11 08:01:32 +02:00
patchback[bot]
34682addb8
seport: minor refactor (#4471) (#4485)
* seport: minor refactor

* added changelog fragment

* Update plugins/modules/system/seport.py

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

* Update plugins/modules/system/seport.py

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 7e6a2453d0)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-04-10 18:48:44 +02:00
patchback[bot]
9c4fd63a4d
Deprecate want_proxmox_nodes_ansible_host option's default value. (#4466) (#4478)
(cherry picked from commit 865d7ac698)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-04-10 08:59:25 +02:00
Felix Fontein
22b72e6684 Release 4.7.0. 2022-04-05 14:02:29 +02:00
patchback[bot]
cef6b81e5b
Bug fix: Warns user if incorrect SDK version is installed (#4422) (#4450)
* Add error handling to check correct SDK version installed

* Fix CI errors

* Added changelog fragment

* Changed exeption type

* Update changelogs fragment

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit e7ffa76db6)

Co-authored-by: Ricky White <rickywhite@outlook.com>
2022-04-05 07:49:30 +02:00
patchback[bot]
182c365d87
nmcli: suggest new routes4 and routes6 format (#4328) (#4447)
* suggest new routes4 and routes6 format

* make new options instead of modifying exiting one

* fix docs and some small errors

* fixing docs

(cherry picked from commit feb0fffd58)

Co-authored-by: Alex Groshev <38885591+haddystuff@users.noreply.github.com>
2022-04-05 07:12:38 +02:00
patchback[bot]
587cdc82e7
Keycloak client, Add always_display_in_console option (#4429) (#4448)
* Keycloak client, Add always_display_in_console option

* Add 4429-keycloak-client-add-always-display-in-console.yml fragment.

* Update changelogs/fragments/4429-keycloak-client-add-always-display-in-console.yml

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

* Update plugins/modules/identity/keycloak/keycloak_client.py

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

* Update plugins/modules/identity/keycloak/keycloak_client.py

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

Co-authored-by: Michal Vasko <mvasko@cloudwerkstatt.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 79256b2bd2)

Co-authored-by: whoamiUNIX <40315055+whoamiUNIX@users.noreply.github.com>
2022-04-05 07:09:20 +02:00
Felix Fontein
cb1a50a273 Prepare 4.7.0 release. 2022-04-05 07:05:07 +02:00
patchback[bot]
f0df50e665
Bugfix: zypper issue with specified package versions (#4421) (#4446)
* fixed issue with specified package versions

zypper.py was doing nothing on state=present, when ALL requestet/checked packages had a specific version stated. This was caused by get_installed_state() being called with an empty package list, which in this case returns information about all ALL installed packages. This lead to an exessive filter list prerun_state, essentially removing all packages that are installed in ANY version on the target system from the request list.

* Create 4421-zypper_package_version_handling_fix

added changelog fragment for https://github.com/ansible-collections/community.general/pull/4421

* Delete 4421-zypper_package_version_handling_fix

* Create 4421-zypper_package_version_handling_fix.yml

(cherry picked from commit bbe231e261)

Co-authored-by: tover99 <101673769+tover99@users.noreply.github.com>
2022-04-05 06:28:15 +02:00
patchback[bot]
3376442aa2
Proxmox Inventory: Add support for templating in inventory file (#4418) (#4435)
* added templating to the url, user, and password

* added changelog fragment

* typo in description for url, and password

* clarify in the changelog what can you change

* update documentation and added an example

* missing quote from examples

* Apply suggestions from code review

Changed to I for option names

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

* Update plugins/inventory/proxmox.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 13d18c9aa8)

Co-authored-by: Ilija Matoski <ilijamt@gmail.com>
2022-04-01 23:07:42 +02:00
patchback[bot]
868edfa664
ipa_service: Add skip_host_check option (#4417) (#4436)
* ipa_service: Add `skip_host_check` option

* Update plugins/modules/identity/ipa/ipa_service.py

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

* Update plugins/modules/identity/ipa/ipa_service.py

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

* Update plugins/modules/identity/ipa/ipa_service.py

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

* changelogs/fragments: Add 4417-ipa_service-add-skip_host_check.yml

Co-authored-by: sodd <4178855+sodd@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 1b357bade7)

Co-authored-by: sodd <sodd@users.noreply.github.com>
2022-04-01 23:07:23 +02:00
patchback[bot]
7516018cfb
keycloak: add missing validate_certs parameters for open_url calls (#4382) (#4410)
* fix: missing `validate_certs` parameters for `open_url` calls

As stated in the documentation, the `validate_certs` parameter can be
used to verify (or not) the TLS certificates. But, for some modules (at
least for the `keycloak_authentication` module), this parameter is not
used with the `open_url` function.

* add changelog fragment

* Update changelogs/fragments/4382-keycloak-add-missing-validate_certs-parameters.yml

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

Co-authored-by: Laurent Meunier <lme@atolcd.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 34420e143e)

Co-authored-by: Laurent Meunier <laurent@deltalima.net>
2022-03-28 22:25:14 +02:00
patchback[bot]
58df1df107
keycloak_client: add default_client_scopes and optional_client_scopes (#4385) (#4409)
* keycloak_client: add default_client_scopes and optional_client_scopes

* Changelog fragment for #4385

* Update changelogs/fragments/4385-keycloak-client-default-optional-scopes.yml

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

* Update plugins/modules/identity/keycloak/keycloak_client.py

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

* Update plugins/modules/identity/keycloak/keycloak_client.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 30c65cd84c)

Co-authored-by: Alex Lubbock <alex@lubbock.uk>
2022-03-28 22:25:00 +02:00
patchback[bot]
e9b3705809
feat: sudoers module supports runas parameter with default of root (#4380) (#4399)
* feat: sudoers module supports runas parameter with default of root

* fix: sudoers tests now pass

* chore: add changelog fragment for 4380

* fix: runas feature now a non-breaking change wh no def with no default

* fix: no trailing space in sudoers.py

* Update plugins/modules/system/sudoers.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 17fe813c18)

Co-authored-by: doubletwist13 <doubletwist@fearthepenguin.net>
2022-03-24 06:44:48 +00:00
patchback[bot]
518af70b77
Proxmox inventory plugin - Fix tags parsing (#4378) (#4402)
* Proxmox inventory plugin - Fix tags parsing

  * In some cases the Proxmox API returns a tags string that consists in
    a single space. The Proxmox inventory plugin parsed that into a
    single, empty tag. Stripping the initial string then checking
    whether it actually contains something fixes that.
  * Do not call `_to_safe` on the concatenation of a known safe string
    and a string that was already made safe.

* Changelog fragment for Proxmox inventory plugin tags fix

* Proxmox inventory plugin - Include link to PR in fragment

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 622895fb55)

Co-authored-by: Emmanuel Benoît <tseeker@nocternity.net>
2022-03-24 06:44:02 +00:00
Felix Fontein
c45c38f04b Release 4.6.1. 2022-03-16 18:20:34 +01:00
patchback[bot]
f7efb2e394
plugins/inventory/lxd.py: fix listing of containers without os / release (#4351) (#4372)
* plugins/inventory/lxd.py: fix listing of containers without os / release

In some cases, a container might be present, that was initialized empty, therefore lacking meta information about the os or the release.
Test if the data entry is None to avoid calling lower on it.

* Update plugins/inventory/lxd.py

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

* Update plugins/inventory/lxd.py

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

* Create 4351-inventory-lxd-handling_metadata_wo_os_and_release.yml

* fix yaml readability of changelog fragment

* Update changelogs/fragments/4351-inventory-lxd-handling_metadata_wo_os_and_release.yml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Malte Kuhn <mkuhn@maxcluster.de>
(cherry picked from commit 421ccd5dc9)

Co-authored-by: monkz <git@monkz.de>
2022-03-16 18:19:44 +01:00
Felix Fontein
093b83c34f
[stable-4] Revert "Allow complex values in variables parameter of terraform module (#4281)" (#4370)
* Revert "Allow complex values in variables parameter of terraform module (#4281)" (#4368)

This reverts commit 4cc7f41395.

(cherry picked from commit 9618fb9786)

* Add changelog fragment.
2022-03-16 07:24:38 +01:00
Felix Fontein
579fdbbc1c Prepare 4.6.1 release. 2022-03-16 07:24:24 +01:00
Felix Fontein
24f6493cd4 Release 4.6.0. 2022-03-15 12:36:20 +01:00
patchback[bot]
68364df409
Proxmox inventory plugin - Fix string to dict conversion (#4349) (#4366)
* Proxmox inventory plugin - Fix string to dict conversion (#4348)

  * Re-use the (defined but unused) `plaintext_configs` variable to list
    configuration entries that should be ignored by the string to
    dictionary conversion code. At this point, it only contains the
    `description` string.
  * Convert to a dictionary if the all substrings obtained by splitting
    off the initial value with commas contain a `=` character
  * Limit substring splitting to a single split, so that a substring
    containing `a=b=c` will generate an `a` entry with value `b=c`.

* Added changelog fragment for PR #4349

* Fix changelog fragment for #4349

(cherry picked from commit 3eec63421a)

Co-authored-by: Emmanuel Benoît <tseeker@nocternity.net>
2022-03-15 12:34:44 +01:00
patchback[bot]
fb61da5246
Proxmox inventory filters (#4352) (#4364)
* Proxmox inventory plugin - Initial implementation of filters

  * This is an attempt at implementing something that would satisfy
    issue #3553
  * A rather massive code rewrite was needed as adding the host to the
    inventory, setting its variables and adding it to various groups
    used to be done as soon as the information became available. This is
    not possible when it is not known whether the host should be added
    to the inventory before all data has been gathered.
  * The code for both LXC containers and Qemu VMs was refactored into a
    single loop.
  * Helper functions to generate group and fact names were added.

* Proxmox inventory plugin - Warnings for filter errors

  * When an error occurs while compositing a filter's value and strict
    mode is disabled, display a warning.

* Proxmox inventory plugin - Fixed pool groups building

  * Hosts that were excluded by the host filters were still being added
    to pool groups, causing errors.

* Proxmox inventory plugin - Refactoring

  * Split off the VM/container handling code from the
    `_populate()` method
  * Split off pool group attribution from the `_populate()` method

* Proxmox inventory filters - Changelog fragment

* proxmox inventory - Simplify _can_add_host() method

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 761171b532)

Co-authored-by: Emmanuel Benoît <tseeker@nocternity.net>
2022-03-15 12:34:24 +01:00
patchback[bot]
89663a0688
ldap_entry - Recursive deletion (#4355) (#4360)
* ldap_entry - Recursive deletion

  * Recursive deletion can be enabled with the `recursive` option. It is
    disabled by default.
  * When enabled, deletion is attempted by sending a single delete
    request with the Subtree Delete control. If that request fails with
    the `NOT_ALLOWED_ON_NONLEAF` error, try deleting the whole branch in
    reverse order using individual delete requests.

* ldap_entry recursive deletion - Changelog fragment

* ldap_entry - Refactored to avoid lint message

* Update changelogs/fragments/4355-ldap-recursive-delete.yml

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

* ldap_entry - Add version_added to the recursive flag

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

* ldap_entry - Moved member assignment to a more suitable location

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 0b71d123d2)

Co-authored-by: Emmanuel Benoît <tseeker@nocternity.net>
2022-03-15 06:05:07 +01:00
patchback[bot]
7fcb21e044
pacman: implement change detection for update_cache=true; add cache_updated return value (#4337) (#4359)
* Implement change detection for update_cache=true. Add cache_updated return value.

* ...

* Make sure pacman --sync --list is called only as often as necessary.

(cherry picked from commit cf4d68ac50)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-03-15 06:04:58 +01:00
Felix Fontein
c6ecc0f3f8 Prepare 4.6.0 release. 2022-03-14 21:19:53 +01:00
patchback[bot]
4d74aa05a8
Fix linode inventory filtering (#4336) (#4356)
* Fix linode inventory filtering

There was a regression introduced in the addition of caching. The
`_consume_options` method was added and provided the `config_data`
dictionary. This `pop`s every entry, resulting in an empty `config_data`
dict, which was then reused and expected to be populated.

After reviewing, `_consume_data` doesn't need to be called. Also, once
the ``_read_config_data` method has been called, we no longer need the
config_data dict, and can instead use the `get_option` method throughout.

Once those were removed, the filtering function seemed a bit odd, since
we were no longer using the file. I used that opportunity to move the
filter calls into the populate function directly.

* Remove tests that target removed methods

This removes tests that targeted some custom methods on configuration
file handling. These are no longer necessary since they are now handled
by the BaseInventoryPlugin `_read_config_data` method.

* Add changelog entry for linode inventory bugfix

* Revert filters back to their own method

This moves filters back into their own method, but now uses the
get_option calls to pull filter configuration items.

(cherry picked from commit 386bb4bdd5)

Co-authored-by: steven jacobs <stjacobs@fastmail.fm>
2022-03-14 20:56:13 +01:00
patchback[bot]
7ddb2eb438
mksysb - revamped module + fix bug in backup_dmapi_fs option (#3295) (#4353)
* Revamped module + fix bug in backup_dmapi_fs option

* added changelog fragment

* added copyright line

(cherry picked from commit 4af7f49ac0)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-03-14 07:29:08 +01:00