[doc] update requirements for all consul modules/lookups (#10863)
* [doc] update requirements for consul_kv module
python-consul has been unmaintained for a while. It uses a legacy way of passing the Consul token when sending requests. This leads to warning messages in Consul log, and will eventually break communication. Using the maintained py-consul library ensures compatibility to newer Consul versions.
* [doc] replace all python-consul occurrences with py-consul
* [fix] tests and possible pip server errors
* [chore] remove referencce to python-consul in comment
---------
(cherry picked from commit 9d0150b2c3)
Co-authored-by: Sebastian Damm <SipSeb@users.noreply.github.com>
Co-authored-by: Sebastian Damm <sebastian.damm@pascom.net>
homebrew: Support old_tokens and oldnames in homebrew package data (#10805)
* homebrew: Support old_tokens and oldnames in homebrew package data
Fixes#10804
Since brew info will accept old_tokens (for casks) and oldnames (for formulae) when provided by the homebrew module "name" argument, the module also needs to consider thes old names as valid for the given package. This commit updates _extract_package_name to do that.
All existing package name tests, including existing tests for name aliases and tap prefixing, have been consolidated with new name tests into package_names.yml.
* Added changelog fragment.
* homebrew: replace non-py2 compliant f-string usage
* code formatting lint, and py2 compatibility fixes
* homebrew: added licenses to new files, nox lint
* Update plugins/modules/homebrew.py
use str.format() instead of string addition
* Update tests/integration/targets/homebrew/tasks/casks.yml
* Update tests/integration/targets/homebrew/tasks/package_names_item.yml
* Update tests/integration/targets/homebrew/tasks/formulae.yml
* Fixes for performance concerns on new homebrew tests.
1) tests for alternate package names are commented out in main.yml.
2) the "install via alternate name, uninstall via base name" test
case was deemed duplicative, and has been deleted .
3) minor fixes to use jinja2 "~" for string concat instead of "+"
* Fix nox lint
---------
(cherry picked from commit 833e6e36de)
Co-authored-by: brad2014 <brad2014@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Speed up tests in android_sdk module (#10818)
changed the dependency that is used to test the functionality in android_sdk module. The previous dependency was ~100MB, the current one is ~6MB. This should speed up the tests a bit and reduce the traffic.
(cherry picked from commit d2e2395ae3)
Co-authored-by: Stanislav Shamilov <shamilovstas@protonmail.com>
gitlab_protected_branch: refactor, add `allow_force_push`, `code_owner_approval_required` (#10795)
* gitlab_protected_branch: fix typo
* gitlab_protected_branch: lump parameters into options dictionary
Hardcoding parameter lists gets repetitive. Refactor this module to use
an options dictionary like many other gitlab_* modules. This makes it
cleaner to add new options.
* gitlab_protected_branch: update when possible
Until now, the module deletes and re-creates the protected branch if any
change is detected. This makes sense for the access level parameters, as
these are not easily mutated after creation.
However, in order to add further options which _can_ easily be updated,
we should support updating by default, unless known-immutable parameters
are changing.
* gitlab_protected_branch: add `allow_force_push` option
* gitlab_protected_branch: add `code_owner_approval_required` option
* gitlab_protected_branch: add issues to changelog
* Update changelog.
---------
(cherry picked from commit f772bcda88)
Co-authored-by: David Phillips <phillid@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
pacemaker_resource: Add cloning support for resources and groups (#10665)
* add clone state for pacemaker_resource
* add changelog fragment
* Additional description entry for comment header
* Apply suggestions from code review
* Update plugins/modules/pacemaker_resource.py
* fix formatting for yamllint
* Apply code review suggestions
* refactor state name to cloned
* Update plugins/modules/pacemaker_resource.py
* Apply suggestions from code review
* Apply suggestions from code review
---------
(cherry picked from commit 3baa13a3e4)
Co-authored-by: Dexter <45038532+munchtoast@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
parted: command args as list rather than string (#10642)
* parted: command args as list rather than string
* add changelog frag
* add missing command line dash args
* make scripts as lists as well
* Apply suggestions from code review
---------
(cherry picked from commit f6e1d90870)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
monit: handle arbitrary error status (#10743)
* handle arbitrary error status
* add changelog fragment
* mock module in test
* Update changelogs/fragments/10743-monit-handle-unknown-status.yml
---------
(cherry picked from commit 469e557b95)
Co-authored-by: Simon Kelly <skelly@dimagi.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Add ignores necessary for ansible-core 2.20 (#10755)
Add ignores necessary for ansible-core 2.20 if Python 2.7 is still supported by the collection.
(cherry picked from commit 9d0866bfb8)
Co-authored-by: Felix Fontein <felix@fontein.de>
random_string: Specify seed while generating random string (#10710)
* random_string: Specify seed while generating random string
* Allow user to specify seed to generate random string
Fixes: #5362
* Apply suggestions from code review
---------
(cherry picked from commit b5a2c5812c)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
ssh_config tests: remove paramiko version restriction (#10732)
Remove paramiko version restriction for ssh_config tests.
(cherry picked from commit 5ee02297b0)
Co-authored-by: Felix Fontein <felix@fontein.de>
remove extra brackets when params are a given by a comprehension (#10712)
* remove extra brackets when function params are a given by a comprehension
* add changelog frag
(cherry picked from commit cb84fa740a)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
update requirements for Python versions currently used (#10701)
(cherry picked from commit 3b9acafc72)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
pacemaker_resource: Fix resource_type parameter (#10663)
* Ensure resource standard, provider, and name are proper format
* Add changelog fragment
* Update changelogs/fragments/10663-pacemaker-resource-fix-resource-type.yml
---------
(cherry picked from commit b9385d7fe8)
Co-authored-by: Dexter <45038532+munchtoast@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
composer: fix command args as list rather than string (#10669)
(cherry picked from commit 13bd4b5d82)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
pacman: temporary disable yay test (#10674)
Temporary disable pacman yay test.
(cherry picked from commit dfc2a54d16)
Co-authored-by: Felix Fontein <felix@fontein.de>
CI: Make sure to install Java in Debian Bullseye (#10653)
Make sure to install Java in Debian Bullseye.
(cherry picked from commit eb5708a125)
Co-authored-by: Felix Fontein <felix@fontein.de>
Keycloak realm add support for some missing options (#10538)
* First commit
* fixe
* changelog
---------
(cherry picked from commit 85f6a07b19)
Co-authored-by: desand01 <desrosiers.a@hotmail.com>
Co-authored-by: Andre Desrosiers <andre.desrosiers@ssss.gouv.qc.ca>
Keycloak idp well known url support (#10527)
* first commit
* add and fixe test
* add example
* fragment and sanity
* sanity
* sanity
* Update plugins/modules/keycloak_identity_provider.py
* Update changelogs/fragments/10527-keycloak-idp-well-known-url-support.yml
---------
(cherry picked from commit 7ffeaaa16d)
Co-authored-by: desand01 <desrosiers.a@hotmail.com>
Co-authored-by: Andre Desrosiers <andre.desrosiers@ssss.gouv.qc.ca>
Co-authored-by: Felix Fontein <felix@fontein.de>
apk: command args as list rather than string (#10520)
* apk: command args as list rather than string
* add changelog frag
* APK_PATH itself should be a list not a string
* fix mock values in unit tests
* keep package names as list
* add package names as list to cmd line
(cherry picked from commit 2a4222c0f6)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Addressing multiple jenkins_plugins module issue (#10346)
* Fix version compatibility issue
* Add dependencies installation to specific versions
* Seperate Jenkins and updates_url credentials
* Create changelog fragment
* Added a test and some adjustments
* Return to fetch_url
* Add pull link to changelog and modify install latest deps function
* Use updates_url for plugin version if it exists
* Change version number
(cherry picked from commit d0a1a617af)
Co-authored-by: Youssef Ali <154611350+YoussefKhalidAli@users.noreply.github.com>
pacemaker_info: new module and enhance cli_action (#10291)
* feat(info): Add pacemaker_info module and enhance cli_action util
This commit adds in the pacemaker_info module which is responsible for
retrieving pacemaker facts. Additionally, the cli_action var has been
refactored for the pacemaker.py util, which is passed through the
runner.
* refactor(version): Bump version_added to 11.2.0
* Apply suggestions from code review
* Update plugins/modules/pacemaker_info.py
* refactor(process): Simplify command output
---------
(cherry picked from commit 47aec26001)
Co-authored-by: Dexter <45038532+munchtoast@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
lvm_pv_move_data: new module (#10416)
* Added lvm_pv_move_data module
* Removed trailing whitespace
* Decreased loop devices file size
* Remove test VG if exists
* Force remove test VG if exists
* Renamed test VG and LV names
* Updated assert conditions
* Added .ansible to .gitignore
* Force extending VG
* Wiping LVM metadata from PVs before creating VG
* Clean FS, LV, VG and PSs before run
* Migrated to CmdRunner
* Added more detailed info in case of failure and cosmetic changes
* Remove redundant params from CmdRunner call
* Updates the RETURN documentation block to properly specify the return type
of the 'actions' field:
- Changes return status from 'always' to 'success'
- Adds missing 'elements: str' type specification
(cherry picked from commit e91e2ef6f8)
Co-authored-by: Klention Mali <45871249+klention@users.noreply.github.com>
CI: python-jenkins 1.8.3 fails to import on Python 2.7 (#10570)
python-jenkins 1.8.3 fails to import on Python 2.7.
(cherry picked from commit c7e18306fb)
Co-authored-by: Felix Fontein <felix@fontein.de>
diy callback: add test for on_any_msg (#10550)
Add test for on_any_msg.
(cherry picked from commit ac4aca2004)
Co-authored-by: Felix Fontein <felix@fontein.de>
json_query: extend list of type aliases for compatibility with ansible-core 2.19 (#10539)
* Extend list of type aliases for json_query.
* Improve tests.
---------
(cherry picked from commit 3de073fb6f)
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Fix no longer valid constructs in tests (#10543)
Fix no longer valid constructs in tests.
(cherry picked from commit 7298f25fe0)
Co-authored-by: Felix Fontein <felix@fontein.de>
CI: Add Python 3.14 unit tests (#10511)
* Add Python 3.14 unit tests.
* Skip test if github cannot be imported.
It currently cannot be imported because nacl isn't compatible with Python 3.14 yet,
and importing github indirectly tries to import nacl, which fails as it uses a
type from typing that got removed in 3.14.
* Skip test if paramiko cannot be imported.
(cherry picked from commit 6ce9f805a8)
Co-authored-by: Felix Fontein <felix@fontein.de>
sysrc: refactor (#10417)
* sysrc: refactor
* sysrc: refactor changelog fragment
* sysrc: forgot the os import
* sysrc: update test to edit the correct file
* sysrc: Added copyright info to the test conf file
* sysrc: Added full copyright info to the test conf file
* sysrc: Detect permission denied when using sysrc
* sysrc: Fixed the permission check and 2.7 compatibility
* sysrc: Fix typo of import
* sysrc: Fix err.find check
* sysrc: Add bugfixes changelog fragment
* sysrc: Use `StateModuleHelper`
* sysrc: updated imports
* sysrc: remove re import and set errno.EACCES on the OSError
* sysrc: format code properly
* sysrc: fix Python 2.7 compatibility and set changed manually
* sysrc: add missing name format check
Also use `self.module.fail_json` through out
* sysrc: Removed os import by accident
* sysrc: updated per review, and the way the existing value is retrieved
(cherry picked from commit 44ca366173)
Co-authored-by: David Lundgren <dlundgren@syberisle.net>