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>
proxmox_kvm: Add required timeout arg when force deleting (#6827)
* Add required timeout arg when force deleting
* Add changelog fragment
* Update changelogs/fragments/6827-proxmox_kvm-force-delete-bug-fix.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 216962a98c)
Co-authored-by: Drew Brown <drew@drewburr.com>
Add example for github_key in a single task (#6854)
* Add example for github_key in a single task
* Update plugins/modules/github_key.py
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 99a35b1664)
Co-authored-by: Seige <charliefjennings+git@gmail.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 module utils: better error msg when token fails with old proxmoxer (#6839)
* proxmox module utils: clear msg when token fails with old proxmoxer
* add changelog frag
* better way to determine version
(cherry picked from commit e5dc697887)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
htpasswd: minor updates in the docs (#6840)
* htpasswd: minor updates in the docs
* remove double spaces
(cherry picked from commit b6883492c7)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Revert "proxmox_kvm: remove non-working example (#6498)" (#6832)
This reverts commit 61a0dc4370.
(cherry picked from commit 92ea63e20b)
Co-authored-by: Felix Fontein <felix@fontein.de>
[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>
random_string docs to say it's cryptographically secure (#6691)
Modify random_string docs to state that randomness is cryptographically secure
(cherry picked from commit 89ad18d1a7)
Co-authored-by: Matthew Davis <7035647+mdavis-xyz@users.noreply.github.com>
Module `proxmox_kvm` `restarted` state bug fix (#6773)
* Change proxmox_kvm restart to use new method
Previously, the `restarted` state used both stop and start vm functions to restart a vm.
This change introduces the a new function that utilizes the proxmox reboot endpoint instead for a more reliable method of restarting a vm.
* Create 6773-proxmox_kvm-restarted-state-bug-fix.yaml
* Fix typo
* Add link to PR
* Chanel log fragment formatting changes
* Move try/catch to `restart_vm` function
* Update changelogs/fragments/6773-proxmox_kvm-restarted-state-bug-fix.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 3571df837d)
Co-authored-by: Juan Estupinan <65736594+juan210012@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>
Fix multiple issues with the TSS lookup plugin when using fetch_attachments (#6720)
* Treat files as binary when downloading attachments
* Raise a warning when the attachment can't be read
* Set the 'itemValue' for files, even when they can't be read
* Always return the original secret content
* Add changelog
* Fix changelog
* Update changelog
Co-authored-by: Felix Fontein <felix@fontein.de>
* Revert "Always return the original secret content"
This reverts commit a9fb96e165.
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 6bff57ee6e)
Co-authored-by: laszlojau <49835454+laszlojau@users.noreply.github.com>
rhsm_repository: update returned "repositories" when using "purge=true" (#6676)
In case the "purge" option was enabled, the "repositories" element in
the returned JSON was not updated with the repositories disabled by that
option.
(cherry picked from commit ffb9b6ff96)
Co-authored-by: Pino Toscano <ptoscano@redhat.com>
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>
plugins/inventory/cobbler: Collect IP addresses for hosts and add opt… (#6711)
plugins/inventory/cobbler: Collect IP addresses for hosts and add option to collect all DNS name to IP address mappings
(cherry picked from commit 24f27a0bdf)
Co-authored-by: Orion Poplawski <orion@nwra.com>
gitlab_group => Make most options optional (#6712)
* Make most options optional as they should be
* Add filter to create_group instead
* Remove whitespace
* Add changelog fragment
* Added description and extension to fragment
* Update changelogs/fragments/6712-gitlab_group-filtered-for-none-values.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/gitlab_group.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Make Python 2.6 compatible.
* Another shot at compatibility.
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit e85b008036)
Co-authored-by: Intellium <w.moeken@moeken.eu>