xfconf*: using yaml-specified unit tests (#7170)
(cherry picked from commit 6303096648)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
CI: make sure EXTERNALLY-MANAGED is absent on Arch Linux (#7172)
Make sure EXTERNALLY-MANAGED is absent on Arch.
(cherry picked from commit f3a02b3efb)
Co-authored-by: Felix Fontein <felix@fontein.de>
Refactored unit tests for modules based on CmdRunner (#7154)
* refactored unit tests for modules based on CmdRunner
* improved/fixed test helper
* fixed sanity
* refactored yaml spec out of the python file
* small adjustments
(cherry picked from commit 8652fd9528)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
snap: fix case when snap list is empty (#7124)
* fix case when snap list is empty
* add changelog frag
(cherry picked from commit 33998a5b70)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
freebsd: shutdown -p ... on freebsd to power off machine (#7102)
* freebsd: shutdown -p ... on freebsd to power off machine
* Use shutdown -p ... on FreeBSD such that the machine is halted and
powered off (-p) otherwise the machine is halted (-h) but remains on.
* Update changelogs/fragments/7102-freebsd-shutdown-p.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 55cfd27be9)
Co-authored-by: Derek Schrock <dereks@lifeofadishwasher.com>
lvol: Fix pct of origin (#7053)
* add support for percentage of origin size for creating snapshot volumes
* add changelog fragment
* add pull request link
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix what's not idempotent
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit a0c67a8894)
Co-authored-by: Bob Mader <bmader@redhat.com>
Avoid direct type comparisons (#7085)
Avoid direct type comparisons.
(cherry picked from commit a8809401ee)
Co-authored-by: Felix Fontein <felix@fontein.de>
[proxmox_vm_info] Return empty list when requested VM doesn't exist (#7049)
* [proxmox_vm_info] Return empty list when requested VM doesn't exist
* Update documentation
* Add changelog fragment
* Address review comments
* Allow to filter by empty name
* Update plugins/modules/proxmox_vm_info.py
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 2089769ccc)
Co-authored-by: Sergei Antipov <greendayonfire@gmail.com>
ejabberd_user: bug fixes + tests (#7033)
* ejabberd_user: bug fixes + tests
* fix changed property
* add license to handler file
* adjustments to test
* add needs/target/setup_epel to aliases
* further adjustments to integration tests
* add target to integration tests
* add some skips to test
* skip centos as it has no ejabberd
* skip fedora as it has no ejabberd
* discard unused epel setup
* add changelog frag
* remove ejabberd before tests
* fix typo
(cherry picked from commit c1f2f126cf)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Snap add test (#7064)
* add test for 3 dashes in description
* remove extraneous comment
(cherry picked from commit 4b17fd4265)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
* Revert "[PR #7020/b46d5d81 backport][stable-7] redfish_utils: Add support for "nextLink" property tag pagination (#7026)"
This reverts commit 1dad95370e.
* Revert "[PR #6914/17b4219b backport][stable-7] proxmox_kvm: enable 'force' restart of vm (as documented) (#6997)"
This reverts commit 7d68af57af.
* Revert "[PR #6976/d7c1a814 backport][stable-7] [proxmox_vm_info] Re-use cluster resources API to use module without requiring node param (#6993)"
This reverts commit fb3768aada.
setup_docker: handlers to stop service and remove requests (#7022)
(cherry picked from commit 5d7899b341)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Skip java_cert and java_keystore tests on RHEL (#6995)
Skip java_cert and java_keystore tests on RHEL.
(cherry picked from commit cc5e1b6fe7)
Co-authored-by: Felix Fontein <felix@fontein.de>
crypt is still deprecated in Python 3.12 (#6994)
crypt is still deprecated in Python 3.12.
(cherry picked from commit e815040877)
Co-authored-by: Felix Fontein <felix@fontein.de>
[proxmox_vm_info] Re-use cluster resources API to use module without requiring node param (#6976)
* [proxmox_vm_info] Re-use cluster resources API to use module without requiring node param
* More consife if
* Fix use case when requesting all vms from specific node
* Add changelog fragment
(cherry picked from commit d7c1a814ea)
Co-authored-by: Sergei Antipov <greendayonfire@gmail.com>
[proxmox_kvm] Don't create VM if name is used without vmid (#6981)
* [proxmox_kvm] Don't create VM if name is used without vmid
* Add changelog and unit tests
(cherry picked from commit f9448574bd)
Co-authored-by: Sergei Antipov <greendayonfire@gmail.com>
Added support in nmcli for ipv4.dns-options (#6902)
* Added support for ipv4.dns_options in nmcli module
* added support for dns6-options
* Added version added
Co-authored-by: Felix Fontein <felix@fontein.de>
* added version_added: 4.6.0 for dns6 options
* added changelog fragment
* Rename 4308-added-support-in-nmcli-for-ipvx-dns-options to 4308-added-support-in-nmcli-for-ipvx-dns-options.yml
* Update changelogs/fragments/4308-added-support-in-nmcli-for-ipvx-dns-options.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Fix and add tests
* Update PR number and version_added
---------
Co-authored-by: Matteo Caruso <m.caruso425@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit cc8e2d676a)
Co-authored-by: Chih-Hsuan Yen <1937689+yan12125@users.noreply.github.com>
pacman: support yay as root (#6713)
* pacman: support yay as root
* make pylint happy
* minor adjustments
* rollback some test actions
* removal of user and pkgs in handlers
* add comment to note
* add changelog frag
* fix doc
* Update tests/integration/targets/pacman/tasks/yay-become.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/pacman/tasks/yay-become.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* simplify pkg install in int. tests
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit f6ee2177a2)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
New lookup plug-in: Bitwarden Secrets Manager (#6389)
* add Bitwarden Secrets Manager lookup
* fix pep8 and yamllint complaints
* fix version_added, add maintainer and copyright notice
* document BWS_ACCESS_TOKEN env var and declare as required
* avoid returning nested list
* update 'value of a secret' example after f6c4492c
* update copyright notice in bitwarden_secrets_manager plugin
thx felixfontein
Co-authored-by: Felix Fontein <felix@fontein.de>
* rename classes to distinguish from existing bw plugin
* use AnsibleLookupError, formatting
* bump version_added to 7.0.0
Co-authored-by: Felix Fontein <felix@fontein.de>
* ci fix: python style guide calls for excessive blank lines
https://peps.python.org/pep-0008/#blank-lines
* first attempt at unit tests for bws lookup
* ci fix: remove trailing newline
* attempt to fix tests object not callable error
* address formatting, tests and pyright suggestions
* reduce scope of mocked code for more real test coverage
only the actual bws CLI call is mocked now, this should enable the
exception thrown test to succeed if I didn't add new problems
* fix undefined variable 'expected_rc'
* fix mocked _run method to return correct data types
* keep list of one element for test case comparison
* bump version_added to 7.2.0
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: jantari <jantari@github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 5365647ee7)
Co-authored-by: jantari <jantari@outlook.de>
snap: add track 'latest' if no track is specified (#6835)
* snap: add track 'latest' if no track is specified
See https://snapcraft.io/docs/channels for more details.
* snap: assume track latest if channel does not specify it
(cherry picked from commit dc0d00452f)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
[proxmox_vm_info] New module to retrieve virtual machines information from Proxmox VE API (#6852)
* [proxmox_vm_info] New module to retrieve virtual machines information from Proxmox VE API
* Address review comments
* Fix seealso fragment
* Update plugins/modules/proxmox_vm_info.py
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 7adb99855a)
Co-authored-by: Sergei Antipov <greendayonfire@gmail.com>
Refactor consul_session to support authentication with tokens (#6755)
* Split into separate PR
* Refactor test, add author to inactive maintainers
* Add changelog fragment and correct requirements section on module documentation
* Add changelog fragment and correct requirements section on module documentation
* Update changelogs/fragments/6755-refactor-consul-session-to-use-requests-lib-instead-of-consul.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Valerio Poggi <vrpoggigmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 242258eb53)
Co-authored-by: Valerio Poggi <106782233+valeriopoggi@users.noreply.github.com>
npm: replace test with required_if (#6848)
* npm: replace test with required_if
* add changelog frag
(cherry picked from commit 11406715f5)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
[proxmox_template] Fix error while uploading big ISO to Proxmox VE cluster (#6757)
* [proxmox_template] Fix error while uploading big ISO to Proxmox VE cluster
* Fix pep8 test
* Add changelog fragment
* Add notes about requests_toolbelt
* Check versions and file size
* Fix typo in notes
* Add unit test. Move try inside of each function.
* Fix sanity tests
* Add proxmoxer in requirements file
* Update integration tests
* Add proxmoxer into constraints.txt
* Address review comments
* Don't run tests on 2.6 python
* Disable Python 2.6 tests for other proxmox modules
(cherry picked from commit 2d6e369d81)
Co-authored-by: Sergei Antipov <greendayonfire@gmail.com>
rhsm_repository: refactor handling of subscription-manager (#6783)
Create a small helper class Rhsm, so all the logic related to the
interaction with subscription-manager is grouped there:
- create the Rhsm object in main(), once the initial checks are done
- search subscription-manager as required (so there is no need to
manually check it), and store its path for reuse
- store the common arguments for running subscription-manager
- move run_subscription_manager() to Rhsm as run_repos()
- get rid of the different list parameters: we list only all the
repositories, so the other cases are not needed (and can be added
easily, if needed)
- move get_repository_list() to Rhsm as list_repositories()
The execution of subscription-manager is improved as well:
- pass the arguments to run_command() directly as list, rather than
joining the arguments to string, which run_command() will need to
split again
- move the "repos" parameter directly in run_repos()
- explicitly disable the shell, already off by default
- disable the expansions of variables, as there are none
Adapt the unit test to the different way run_command() is called.
There should be no behaviour changes.
(cherry picked from commit 867704dd75)
Co-authored-by: Pino Toscano <ptoscano@redhat.com>
locale_gen: works with C.UTF-8 (#6774)
* locale_gen: fix
* test working with C.UTF-8
* working with locale eo
* handle C.UTF-8 edge cases
* grammatic pedantism
* add changelog frag
* add doc about specific OS support
* update changelog frag
(cherry picked from commit 3fd4cdb119)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Add Debian Bookworm to CI (#6779)
* Add Debian Bookworm to CI.
* The package has been netcat-openbsd for some time now. The transitional package was removed in Debian 12.
(cherry picked from commit 8b5dc27d23)
Co-authored-by: Felix Fontein <felix@fontein.de>
rhsm_repository: add an initial unit test (#6758)
So far there are no tests for the rhsm_repository module, which makes it
difficult to do even basic changes. Hence, add an initial version of
unit tests, heavily based on the approach of the redhat_subscription
unit tests.
(cherry picked from commit 08fa05f05f)
Co-authored-by: Pino Toscano <ptoscano@redhat.com>
ipify_facts: skip tests on Python 2.6 (#6759)
Needs some special requirements on Python 2.6 so that it can contact the server.
These seem to be installed when running all tests. I don't want to figure out what exactly
is missing, so let's just skip the tests on Python 2.6 for now.
(cherry picked from commit f88f40086d)
Co-authored-by: Felix Fontein <felix@fontein.de>
Add RHEL 8.7, 8.8, and 9.2 to CI (#6739)
* Add RHEL 8.7, 8.8, and 9.2 to CI.
* Add more ignores.
* Disable another test.
(cherry picked from commit 068a799bba)
Co-authored-by: Felix Fontein <felix@fontein.de>
lvg_rename: New module to support VG renaming (#6721)
* lvg_rename: New module to support VG renaming
* Remove vg option aliases
Fix YAML boolean case-formatting
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 4871140696)
Co-authored-by: Laszlo Szomor <laszomor@gmail.com>
filesystem: add UUID change feature (#6680)
* filesystem: add UUID change feature
* Add changelog fragment for 6680
* Do not test XFS filesystem UUID reset on FreeBSD
FreeBSD error: xfs_admin: only 'rewrite' supported on V5 fs
* Apply suggestions from code review #1
Co-authored-by: Felix Fontein <felix@fontein.de>
* Set filesystem UUID on FS creation
* Fix tests - switch to ansible.builtion.to_uuid
* Fix tests - Refactor to avoid FS remove tasks
* Fail if uuid option not yet supported for fstype
* Set resizefs and uuid options mutually exclusive
* Apply suggestions from code review no 2.
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 5d9eb8be95)
Co-authored-by: Laszlo Szomor <laszomor@gmail.com>
lvg: add UUID reset and active state management feature (#6682)
* lvg: add UUID reset, rename, active switch feature
* Add changelog fragment for 6682
* Fix Sanity 2.15,devel tests
* Fix issue with LVM autoactivation
* Remove rename implementation
Add active/inactive states
Fix errors when a PV is missing
Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/lvg.py
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 24aeedbc15)
Co-authored-by: Laszlo Szomor <laszomor@gmail.com>
proxmox_kvm - Allow creation of VM with existing name but new vmid (#6709)
* proxmox_kvm - Allow creation of VM with existing name but new vmid
* Fix pylint and pep8 errors
* Add changelog fragment
* Move status variable outside of try block
* Add assertion for calling get_vm_node function
* Use try/catch for module_utils functions
* Update changelogs/fragments/6709-proxmox-create-vm-with-existing-name.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit fb04dc3db2)
Co-authored-by: Sergei Antipov <greendayonfire@gmail.com>
ini_file: try using inactive option before creating a new one (#6575)
* ini_file: make inactive options as active if they exist, instead of creating a new option entry
Add changelog fragment
* Update changelogs/fragments/ini_file-use-inactive-options-when-possible.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Fix test
* Update tests
* Fix spelling
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit f710a10f25)
Co-authored-by: njutn95 <njutn95@yahoo.com>
keycloak_client_rolemapping.py: add support for subgroups (#6687)
* keycloak_client_rolemapping.py: add support for subgroups
* Add PR number after creating a PR to 6687-support-subgroups-for-keycloak-client-rolemapping.yml
* Update changelogs/fragments/6687-support-subgroups-for-keycloak-client-rolemapping.yml
Add missing URL
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/keycloak_client_rolemapping.py
Set a correct version_added (previously it was a copy-paste)
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/keycloak_client_rolemapping.py
Fix typo after copy-paste
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/keycloak_client_rolemapping.py
Fix typo after copy-paste
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/keycloak_client_rolemapping.py
Fix typo after copy-paste
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Mikhail Putilov <Mikhail.Putilov@dimoco.eu>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit e06a0e22f7)
Co-authored-by: Mikhail Putilov <post.snowy@gmail.com>