Compare commits

...

208 Commits
7.2.1 ... 7.5.4

Author SHA1 Message Date
Felix Fontein
e67ba12211 Release 7.5.4. 2024-01-29 20:14:18 +01:00
patchback[bot]
2f04bd32d0 [PR #7697/a5cd4ebe backport][stable-7] Simplify regex for identifying order number in DN (#7646) (#7913)
Simplify regex for identifying order number in DN (#7646) (#7697)

Assume that if a string of digits occurs between curly braces anywhere
in the first component of the DN, that this is an order number. The
sequence does not necessarily have to occur after an equals sign.

(cherry picked from commit a5cd4ebea2)

Co-authored-by: Aaron Sowry <aeneby@users.noreply.github.com>
2024-01-29 19:30:04 +01:00
patchback[bot]
62613427af [PR #7695/997e6345 backport][stable-7] Fixes #7389 - NMCLI issue with creating a wifi bridge-slave (#7911)
Fixes #7389 - NMCLI issue with creating a wifi bridge-slave (#7695)

* working mod

* added changelog fragment

* added link on fragment

* Update changelogs/fragments/7389-nmcli-issue-with-creating-a-wifi-bridge-slave.yml

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

* last fix

---------

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

Co-authored-by: Gianmarco Mameli <57061995+gianmarco-mameli@users.noreply.github.com>
2024-01-28 13:39:28 +01:00
patchback[bot]
febf5f24ab [PR #7907/2580da97 backport][stable-7] Zuul third-party-check: disable ansible-doc part of galaxy-importer (#7909)
Zuul third-party-check: disable ansible-doc part of galaxy-importer (#7907)

Zuul third-party-check: disable ansible-doc part of galaxy-importer.

(cherry picked from commit 2580da9796)

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-01-27 16:05:36 +01:00
patchback[bot]
6652261ef4 [PR #7870/be3bfd6f backport][stable-7] Detection of already installed homebrew cask (#7903)
Detection of already installed homebrew cask (#7870)

* fix: detect already installed cask

Use json output v2 to check if formulae and casks are installed

chore: add changelog fragment

* test: add homebrew cask specific tests

* refactor: change cask used in tests

* chore: apply suggestions to changelog fragment

(cherry picked from commit be3bfd6fa5)

Co-authored-by: João Victor Silva <160127815@aluno.unb.br>
2024-01-27 10:37:10 +01:00
patchback[bot]
c4da880c46 [PR #7873/13e3161f backport][stable-7] Refer to LXD containers/VMs as instances (#7890)
Refer to LXD containers/VMs as instances (#7873)

* plugins/connection/lxd: rename container to instance

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>

* plugins/inventory/lxd: rename container to instance

It seems that a previous search and replace was done but it
missed those `containe_name` due to missing `r` in `container`.

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>

---------

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
(cherry picked from commit 13e3161f2a)

Co-authored-by: Simon Deziel <simon.deziel@canonical.com>
2024-01-24 19:48:56 +01:00
patchback[bot]
1d87acef96 [PR #7855/cd77d67e backport][stable-7] Add missing id parameter into pacman_key documentation examples. (#7867)
Add missing `id` parameter into pacman_key documentation examples. (#7855)

Key ID is a mandatory parameter, and the examples which miss it are
incorrect.

(cherry picked from commit cd77d67efb)

Co-authored-by: Danila Kiver <forumdan@mail.ru>
2024-01-18 08:12:55 +01:00
patchback[bot]
8bc51bb0ec [PR #7821/92f8bf7b backport][stable-7] mssql_script: make module Python 2 compatible (#7865)
mssql_script: make module Python 2 compatible (#7821)

Make module Python 2 compatible.

(cherry picked from commit 92f8bf7b6f)

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-01-18 07:33:47 +01:00
patchback[bot]
504759ce92 [PR #7857/069b485b backport][stable-7] Use shared workflow for Galaxy import test (#7863)
Use shared workflow for Galaxy import test (#7857)

Simplifiy workflows.

(cherry picked from commit 069b485b7e)

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-01-18 07:33:37 +01:00
patchback[bot]
a3704353c9 [PR #7858/002208f4 backport][stable-7] Make compatible with newer reuse versions (#7859)
Make compatible with newer reuse versions (#7858)

Make compatible with newer reuse versions.

(cherry picked from commit 002208f425)

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-01-18 07:10:53 +01:00
patchback[bot]
fef1a495e1 [PR #7795/31de16ce backport][stable-7] ipa_otptoken: fix wrong return value string to bool (#7851)
ipa_otptoken: fix wrong return value string to bool (#7795)

ipa_data is return ipatokendisable in boolean format and the module expects it as a string
this behavior causes a lack of idempotency and the get_diff module will fail in the second run.

(cherry picked from commit 31de16cee3)

Co-authored-by: Parsa Yousefi <p.yousefi97@gmail.com>
2024-01-16 22:31:44 +01:00
Felix Fontein
871829dd97 [stable-7] Use import galaxy workflow from ansible-collections/community.docker#754 (#7841)
Use import galaxy workflow from ansible-collections/community.docker#754 (#7839)

Use import galaxy workflow from https://github.com/ansible-collections/community.docker/pull/754.

(cherry picked from commit 32ec751996)
2024-01-13 19:25:38 +01:00
patchback[bot]
957ccd463e [PR #7831/8891f559 backport][stable-7] Disable timezone tests on Arch Linux (#7834)
Disable timezone tests on Arch Linux (#7831)

Disable timezone tests on Arch Linux.

(cherry picked from commit 8891f559ef)

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-01-13 11:00:20 +01:00
patchback[bot]
a0c7c10099 [PR #7827/87866477 backport][stable-7] CI: fix xml tests on RHEL 8 (#7829)
CI: fix xml tests on RHEL 8 (#7827)

* Try to fix xml installation on RHEL.

* Install python-lxml on RHEL 8. Should speed up tests considerably.

(cherry picked from commit 878664778e)

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-01-13 10:11:36 +01:00
Felix Fontein
50e2794658 [stable-7] CI: for some reason async-timeout doesn't seem to get installed on Python 3.11 (#7813)
CI: for some reason async-timeout doesn't seem to get installed on Python 3.11 (#7811)

For some reason async-timeout doesn't seem to get installed on Python 3.11.

(cherry picked from commit 9946f758af)
2024-01-05 08:53:08 +01:00
patchback[bot]
c88610305b [PR #7807/ee8b1570 backport][stable-7] Fix failing sanity and integration tests (#7808)
Fix failing sanity and integration tests (#7807)

* Remove some Shippable specific code that trips latest shellcheck.

* Rename templated shell script to .sh.j2 to avoid shellcheck disliking the templating.

* Copy on the remote, not from controller to remote.

(cherry picked from commit ee8b15708f)

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-01-04 23:24:35 +01:00
Felix Fontein
9f0af5380c Next release will be 7.5.4. 2024-01-01 18:10:47 +01:00
Felix Fontein
c512b789cb Release 7.5.3. 2024-01-01 17:52:00 +01:00
Felix Fontein
ec23171586 Prepare 7.5.3 release. 2024-01-01 14:37:52 +01:00
patchback[bot]
1704f947e3 [PR #7797/8d307cb1 backport][stable-7] Remove FreeBSD 12.4 from CI (#7799)
Remove FreeBSD 12.4 from CI (#7797)

Remove FreeBSD 12.4 from CI.

(cherry picked from commit 8d307cb190)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-31 15:19:27 +01:00
Felix Fontein
80c7fc2d12 [stable-7] Update BOTMETA.yml - Remove fxfitz as maintainer of IPA (#7767) (#7788)
Update BOTMETA.yml - Remove fxfitz as maintainer of IPA (#7767)

* Update BOTMETA.yml

Remove fxfitz

* Add ignore fxfitz

---------

Co-authored-by: Fran Fitzpatrick <fran.fitzpatrick@tanium.com>
(cherry picked from commit dfb9b1b9fb)

Co-authored-by: Fran Fitzpatrick <francis.x.fitzpatrick@gmail.com>
2023-12-28 21:31:20 +01:00
Felix Fontein
5b1bb61b9e [stable-7] cloudflare_dns: announce removal of SPF support (#7773) (#7783)
cloudflare_dns: announce removal of SPF support (#7773)

Announce removal of SPF support.

(cherry picked from commit 56a18a029a)
2023-12-28 17:48:14 +01:00
patchback[bot]
56e00efcba [PR #7776/e9f7f7e2 backport][stable-7] CI: python-memcached 1.60 needs Python 3.6+ (#7778)
CI: python-memcached 1.60 needs Python 3.6+ (#7776)

python-memcached 1.60 needs Python 3.6+.

(cherry picked from commit e9f7f7e2de)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-28 13:53:25 +01:00
patchback[bot]
ef42314714 [PR #7418/fd0d05d6 backport][stable-7] Bugfix: keycloak_identity_provider does not handle mapper changes properly (#7774)
Bugfix: keycloak_identity_provider does not handle mapper changes properly (#7418)

* fix keycloak_identity_provider ITs to actually pass

- wrong identityProviderAlias in mapper configuration

* kc_identity_provider: add mapper reconfiguration regression tests

* test for removing an existing mapper
* test for adding a new mapper when others already exist
* test for module idempotency when mappers not ordered by name in ascending order

* kc_identity_provider: add bugfixes for mapper reconfigurations

* removing an existing mapper
* adding a new mapper when others already exist
* module idempotency when mappers not ordered by name in ascending order

* add changelog fragment

* prevent unnecessary update_mapper calls when there is no change

* Update changelogs/fragments/7418-kc_identity_provider-mapper-reconfiguration-fixes.yml

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

* Update changelogs/fragments/7418-kc_identity_provider-mapper-reconfiguration-fixes.yml

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

* Update changelogs/fragments/7418-kc_identity_provider-mapper-reconfiguration-fixes.yml

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

* Update plugins/modules/keycloak_identity_provider.py

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

* kc_identity_provider: sort changeset mappers via name OR id to prevent potential failures in case name was not specified in playbook

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

---------

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

Co-authored-by: Jakub Danek <danekja@users.noreply.github.com>
2023-12-28 09:59:43 +01:00
patchback[bot]
9a6eb4e028 [PR #7754/4a1006ac backport][stable-7] Fixed payload format (#7762)
Fixed payload format (#7754)

* Fixed payload format

* added changelog fragment

* Update changelogs/fragments/7754-fixed-payload-format.yml

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

---------

Co-authored-by: Ed Ferguson <eferguson@nrtc.coop>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 4a1006ac34)

Co-authored-by: Ed Ferguson <5855090+eeferg@users.noreply.github.com>
2023-12-26 22:24:38 +01:00
patchback[bot]
cf4b814c2d [PR #7727/825bec70 backport][stable-7] Improve docs of bitwarden lookup (#7759)
Improve docs of bitwarden lookup (#7727)

* Improve docs of bitwarden lookup.

* Improve formulations.

Co-authored-by: Don Naro <dnaro@redhat.com>

* Improve formulation.

---------

Co-authored-by: Don Naro <dnaro@redhat.com>
(cherry picked from commit 825bec7053)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-22 21:24:09 +01:00
patchback[bot]
f47fced4ca [PR #7696/1389bba4 backport][stable-7] keycloak_user: avoid error when trying to delete a non-existing user (#7755)
keycloak_user: avoid error when trying to delete a non-existing user (#7696)

* avoid error when trying to delete a non-existing user

when force is set, but the user doesn't exist yet, this fails.

* 7696-avoid-attempt-to-delete-non-existing-user

add changelog entry

* rename changelog file

* Update changelogs/fragments/7696-avoid-attempt-to-delete-non-existing-user.yml

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

---------

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

Co-authored-by: Michiel Dethmers <michiel@phplist.com>
2023-12-21 13:20:29 +01:00
patchback[bot]
370fa9814a [PR #7731/916f6f7c backport][stable-7] using timeout parameter within community.general.mail module (#7751)
using timeout parameter within community.general.mail module (#7731)

* using timeout parameter within community.general.mail module

* consolidated time-out example within an existing playbook

* consolidated time-out example within an existing playbook

* Update plugins/modules/mail.py

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

---------

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

Co-authored-by: Aditya Putta <puttaa@skiff.com>
2023-12-20 08:19:49 +01:00
patchback[bot]
7f60b1f2dd [PR #7685/98b2d043 backport][stable-7] Updated documentation to reflect new behaviour (#7748)
Updated documentation to reflect new behaviour (#7685)

* Updated documentation to reflect new behaviour

Per issue [6027](https://github.com/ansible-collections/community.general/issues/6027), disk and storage should not be used together, and changes to the API make it so "disk" should be formatted like "<storage>:<size in gb>".

Documentation edited to reflect this new behavior.

* Apply suggestions from code review

Change format due to referencing options.

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

---------

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

Co-authored-by: Wesley P <68830971+xhk416x@users.noreply.github.com>
2023-12-20 07:35:05 +01:00
patchback[bot]
bbbc98a751 [PR #7739/097f0860 backport][stable-7] Bump github/codeql-action from 2 to 3 (#7741)
Bump github/codeql-action from 2 to 3 (#7739)

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 097f08608f)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-18 19:30:09 +01:00
patchback[bot]
233743f2fe [PR #7709/0c7b9e50 backport][stable-7] Fix keytool setup on Debian Bookworm (#7711)
Fix keytool setup on Debian Bookworm (#7709)

Fix keytool setup on Debian Bookworm.

(cherry picked from commit 0c7b9e50b5)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-10 09:16:45 +01:00
patchback[bot]
8539c534e3 [PR #7705/aea238e5 backport][stable-7] Fix integration tests on Arch (#7707)
Fix integration tests on Arch (#7705)

* Fix ejabberd_user integration tests on Arch Linux.

* Fix odbc integration tests on Arch Linux.

* The old name of systemd_service is systemd.

(cherry picked from commit aea238e5d1)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-09 17:30:31 +01:00
patchback[bot]
eadf1320df [PR #7699/2b64ef2a backport][stable-7] Deactivate FreeBSD 13.1 in CI (#7701)
Deactivate FreeBSD 13.1 in CI (#7699)

Deactivate FreeBSD 13.1 in CI.

(cherry picked from commit 2b64ef2a62)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-08 07:10:30 +01:00
Felix Fontein
1242dff77f The next expected release is 7.5.3. 2023-12-04 18:21:43 +01:00
Felix Fontein
2ce82ce1fa Release 7.5.2 2023-12-04 06:51:29 +01:00
patchback[bot]
f3aab7a5b8 [PR #7653/3d0da927 backport][stable-7] Change tab to space in SSHFP requests (#7679)
Change tab to space in SSHFP requests (#7653)

* Change tab to space in SSHFP requests

Cloudflare uses space and not tab when you search for SSHFP records

Cloudflare changes fingerprint to uppercase

Create 7653-fix-cloudflare-lookup.yml

* Update changelog fragment.

---------

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

Co-authored-by: Kalle Møller <git@k-moeller.dk>
2023-12-04 06:29:10 +01:00
patchback[bot]
b3d79d728e [PR #7601/32558558 backport][stable-7] lvol: check return message in both stderr and stdout (#7673)
lvol: check return message in both stderr and stdout (#7601)

* lvol: check return message in both stderr and stdout

* add changelog frag

(cherry picked from commit 32558558c0)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-12-03 09:49:15 +01:00
patchback[bot]
ecd6bca049 [PR #7641/58cce27d backport][stable-7] Fix Keycloak API client to quote '/' properly (#7664)
Fix Keycloak API client to quote '/' properly (#7641)

* fix Keycloak API client to quote '/' properly

* add changelog

* Update changelogs/fragments/7641-fix-keycloak-api-client-to-quote-properly.yml

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

---------

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

Co-authored-by: Tomohiko Ozawa <kota65535@gmail.com>
2023-12-02 09:40:02 +01:00
patchback[bot]
84c883e854 [PR #7564/241cc02f backport][stable-7] onepassword lookup - Make section and field case insensitive (#7661)
onepassword lookup - Make section and field case insensitive (#7564)

* onepassword lookup: Make section and field case insensitive

This was a regression in behavior when adding support for op v2.

* Return a string by default to avoid an exception if a field is missing

* Use a helper function to lower a value if possible

* Update changelog

(cherry picked from commit 241cc02fa8)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2023-12-01 18:17:44 +01:00
patchback[bot]
91c8d6badc [PR #7656/096d36ad backport][stable-7] passwordstore tests: re-enable gopass on Debian-like systems (#7659)
passwordstore tests: re-enable gopass on Debian-like systems (#7656)

Re-enable gopass on Debian-like systems.

(cherry picked from commit 096d36adc5)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-01 18:02:48 +01:00
patchback[bot]
3cf6a67f74 [PR #7630/0589c841 backport][stable-7] Fix and re-enable cmd_runner tests (#7654)
Fix and re-enable cmd_runner tests (#7630)

Fix cmd_runner tests.

(cherry picked from commit 0589c84176)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-01 17:48:33 +01:00
patchback[bot]
3593d9c17c [PR #7624/af01b462 backport][stable-7] redhat_subscription: use D-Bus registration on RHEL 7 only on 7.4+ (#7642)
redhat_subscription: use D-Bus registration on RHEL 7 only on 7.4+ (#7624)

subscription-manager does not provide a D-Bus interface in versions of
RHEL 7 older than 7.4.

(cherry picked from commit af01b462d5)

Co-authored-by: Pino Toscano <ptoscano@redhat.com>
2023-11-30 05:13:48 +00:00
patchback[bot]
b0910d6a47 [PR #7631/dbba0d19 backport][stable-7] Fix osx_defaults tests (#7632)
Fix osx_defaults tests (#7631)

Fix osx_defaults tests.

(cherry picked from commit dbba0d1956)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-29 07:47:08 +01:00
patchback[bot]
5c6053bf79 [PR #7625/3b779eca backport][stable-7] Fix bad expressions in tests (#7628)
Fix bad expressions in tests (#7625)

* Fix bad expressions in tests.

ci_complete

* Disable cmd_runner integration tests.

ci_complete

* Another bad expression.

ci_complete

(cherry picked from commit 3b779ecade)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-29 07:24:10 +01:00
patchback[bot]
d789351195 [PR #7612/5adb7ab9 backport][stable-7] interfaces_file: filter by address_familiy when updating method (#7615)
interfaces_file: filter by address_familiy when updating method (#7612)

* When updating method, check address_family if provided.

* Also test modifying 'method' without address_family filter.

(cherry picked from commit 5adb7ab948)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-26 20:30:52 +01:00
patchback[bot]
a4739d8a36 [PR #7611/f496256d backport][stable-7] Improve interfaces_file documentation (#7613)
Improve interfaces_file documentation (#7611)

Improve interfaces_file documentation.

(cherry picked from commit f496256d18)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-26 20:30:38 +01:00
patchback[bot]
986c0ab03a [PR #7603/12395732 backport][stable-7] CI: temporarily skip passwordstore tests on Debian/Ubuntu (#7609)
CI: temporarily skip passwordstore tests on Debian/Ubuntu (#7603)

Skip passwordstore tests on Debian/Ubuntu.

(cherry picked from commit 12395732e8)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-26 17:35:27 +01:00
patchback[bot]
67279e7ca1 [PR #7535/af5da7d4 backport][stable-7] fix(modules/terraform): handle multiline strings correctly in complex variables (#7598)
fix(modules/terraform): handle multiline strings correctly in complex variables (#7535)

(cherry picked from commit af5da7d412)

Co-authored-by: Yann Soubeyrand <github@yann.soubeyrand.eu>
2023-11-24 21:47:58 +01:00
patchback[bot]
f34cd9ddb9 [PR #7591/19984ce4 backport][stable-7] Update proxmox_tasks_info.py (#7594)
Update proxmox_tasks_info.py (#7591)

fix typo
I spend 3 hours because of this mistake

(cherry picked from commit 19984ce4df)

Co-authored-by: Андрей Неустроев <99169437+aneustroev@users.noreply.github.com>
2023-11-24 21:27:28 +01:00
patchback[bot]
cbab5e887d [PR #7592/b2dea631 backport][stable-7] Remove Fedora 36 from CI (#7596)
Remove Fedora 36 from CI (#7592)

Remove Fedora 36 from CI.

(cherry picked from commit b2dea631d1)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-24 21:27:02 +01:00
patchback[bot]
c0cd4827da [PR #7558/fce91ebb backport][stable-7] ini_file: documentation for 'section' to stop mentioning that null can be passed (#7583)
ini_file: documentation for 'section' to stop mentioning that null can be passed (#7558)

Update ini_file's documentation for 'section' to stop mentioning that null can be passed.

(cherry picked from commit fce91ebbd4)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-23 06:53:29 +01:00
patchback[bot]
833c21a2bc [PR #7549/d530470d backport][stable-7] logentries: docs improvements (#7571)
logentries: docs improvements (#7549)

Docs improvements.

(cherry picked from commit d530470d30)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-22 19:27:28 +01:00
patchback[bot]
cd333e6575 [PR #7563/09b9ea46 backport][stable-7] Set resources payload as a list (#7573)
Set resources payload as a list (#7563)

* Set resources payload as a list

* Update changelogs/fragments/7151-fix-keycloak_authz_permission-incorrect-resource-payload.yml

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

---------

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

Co-authored-by: fostermi <mfosterm@gmail.com>
2023-11-22 19:20:53 +01:00
patchback[bot]
a70de88577 [PR #7542/21cd65fc backport][stable-7] ssl.wrap_socket() was removed in Python 3.12 (#7556)
ssl.wrap_socket() was removed in Python 3.12 (#7542)

* ssl.wrap_socket() was removed in Python 3.12.

* Make code for irc module backwards-compatible.

(cherry picked from commit 21cd65fccf)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-19 14:41:33 +01:00
patchback[bot]
3ce83dcf6a [PR #7541/b8ecb167 backport][stable-7] CI: devel supports Fedora 39, and no longer Fedora 38 (#7547)
CI: devel supports Fedora 39, and no longer Fedora 38 (#7541)

* devel supports Fedora 39, and no longer Fedora 38.

* Disable 'mail' tests for Python 3.12+.

Ref: https://github.com/ansible-collections/community.general/issues/4656

* Fix setupSSLServer to work with Python 3.12.

(cherry picked from commit b8ecb1671b)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-18 14:34:11 +01:00
patchback[bot]
6448372c04 [PR #7543/b3c661a9 backport][stable-7] sysrc: FreeBSD jail test no longer works with FreeBSD 13.1 (#7545)
sysrc: FreeBSD jail test no longer works with FreeBSD 13.1 (#7543)

Jail test no longer works with FreeBSD 13.1.

(cherry picked from commit b3c661a9f6)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-18 13:59:50 +01:00
patchback[bot]
be09373815 [PR #7524/32fa588f backport][stable-7] CI: Add rhel/9.3 for devel, remove rhel/9.2 (#7530)
CI: Add rhel/9.3 for devel, remove rhel/9.2 (#7524)

* Add rhel/9.3 for devel, remove rhel/9.2.

* Also skip rhel/9.3 when skipping rhel/9.2.

* snapd is also on available on RHEL 9.3.

(cherry picked from commit 32fa588f47)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-16 07:55:30 +01:00
patchback[bot]
9a6f7c5c3f [PR #7517/8d886b42 backport][stable-7] Close elastic APM client to release connections (#7528)
Close elastic APM client to release connections (#7517)

* Close elastic APM client to release connections

* Changelog fragment

(cherry picked from commit 8d886b42ec)

Co-authored-by: Iuri de Silvio <iurisilvio@gmail.com>
2023-11-15 22:28:02 +01:00
Felix Fontein
1f94bd4a17 Prepare 7.5.2 release. 2023-11-12 12:18:43 +01:00
Felix Fontein
b15a2c52e3 Fix RST code formatting.
(cherry picked from commit e1503fc306)
2023-11-11 12:38:50 +01:00
patchback[bot]
f764685c53 [PR #7506/c2e578cb backport][stable-7] pipx: change parameter formatter for pip_args (#7509)
pipx: change parameter formatter for pip_args (#7506)

* change parameter formatter for pip_args

* add changelog frag

(cherry picked from commit c2e578cb14)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-11-11 12:28:35 +01:00
patchback[bot]
1d6552e005 [PR #7501/48e860be backport][stable-7] Use isinstance() instead of type() (#7502)
Use isinstance() instead of type() (#7501)

* Replace type comparisons with isinstance() checks.

* Add changelog.

(cherry picked from commit 48e860be20)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-08 13:26:52 +01:00
Felix Fontein
770ae38aff Next expected release will be 7.5.2. 2023-11-06 21:26:10 +01:00
Felix Fontein
4edae7afd0 Release 7.5.1. 2023-11-06 20:54:09 +01:00
patchback[bot]
40f87e25ff [PR #7464/03049893 backport][stable-7] fix vm removal in proxmox_pool_member.py (#7493)
fix vm removal in proxmox_pool_member.py (#7464)

* fix vm removal in proxmox_pool_member.py

in the original the vm doesn't get removed, always errors with "'Failed to delete a member (12345) from the pool TestPool: list.remove(x): x not in list'

* add changelog fragment

* fix linting errors in changelog

(cherry picked from commit 0304989392)

Co-authored-by: aungvari <12872375+aungvari@users.noreply.github.com>
2023-11-06 20:45:50 +01:00
patchback[bot]
ebf8d9cde1 [PR #7471/ab0b85d7 backport][stable-7] Redfish: Updated message handling for update operations to skip message objects with missing MessageId properties (#7491)
Redfish: Updated message handling for update operations to skip message objects with missing MessageId properties (#7471)

* Redfish: Updated message handling for update operations to skip message objects with missing MessageId properties

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

* Update 7465-redfish-firmware-update-message-id-hardening.yml

---------

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

Co-authored-by: Mike Raineri <mraineri@gmail.com>
2023-11-06 06:25:12 +01:00
patchback[bot]
f0c5dd9cbc [PR #7480/74e941e4 backport][stable-7] Disable nomad tests (#7483)
Disable nomad tests (#7480)

Disable nomad tests.

(cherry picked from commit 74e941e432)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-04 14:01:05 +01:00
patchback[bot]
656a7f7087 [PR #7476/57e36d7d backport][stable-7] timezone tests: do not restore original timezone if it wasn't known (value 'n/a') (#7478)
timezone tests: do not restore original timezone if it wasn't known (value 'n/a') (#7476)

Do not restore original timezone if it wasn't known (value 'n/a').

(cherry picked from commit 57e36d7dc2)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-04 13:22:57 +01:00
Felix Fontein
c2303926af Prepare 7.5.1 release. 2023-11-04 12:19:20 +01:00
patchback[bot]
aa707d665e [PR #7467/a366318a backport][stable-7] [gitlab] Fix gitlab constants calls (#7473)
[gitlab] Fix gitlab constants calls (#7467)

fix: Fix gitlab constants calls

Co-authored-by: Arnaud Hatzenbuhler <arnaud.hatzenbuhler@conserto.pro>
(cherry picked from commit a366318ac6)

Co-authored-by: Arnaud Hatzenbuhler <arnaud.hatzenbuhler@gmail.com>
2023-11-04 09:31:54 +01:00
patchback[bot]
be2fd43243 [PR #7405/f7267c71 backport][stable-7] Fix the ability to run Composer "working_dir" dependent commands (#7460)
Fix the ability to run Composer "working_dir" dependent commands (#7405)

* pass the working_dir to all composer command invocations that are not global

* 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 f7267c7123)

Co-authored-by: Xavier Lacot <xavier@lacot.org>
2023-11-01 08:22:42 +01:00
Felix Fontein
b2eb0fb8f8 Main branches are stable-8 and stable-7; stable-6 runs more seldomly in CI.
(cherry picked from commit 6d0bcec1cb)
2023-11-01 08:10:42 +01:00
patchback[bot]
57053f8a32 [PR #7444/2a7f9f28 backport][stable-7] Improve docsite extra docs (#7453)
Improve docsite extra docs (#7444)

* Improve markup.

* Improve filter and test guides by linking to plugins and using FQCNs more consistently.

* list_merge is an option, not the filter's name.

* Improve filter docs.

(cherry picked from commit 2a7f9f28b9)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-30 23:19:01 +01:00
patchback[bot]
583a7a75d3 [PR #7450/f5c544d9 backport][stable-7] CI: make sure that Python 2.7 unit tests also run with AZP (#7451)
CI: make sure that Python 2.7 unit tests also run with AZP (#7450)

Make sure that Python 2.7 unit tests also run with AZP.

(cherry picked from commit f5c544d99c)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-30 22:23:39 +01:00
patchback[bot]
065fdf990d [PR #7446/8055dd1c backport][stable-7] Revert "Disable ansible_galaxy_install tests until Galaxy is fixed (#7440)" (#7449)
Revert "Disable ansible_galaxy_install tests until Galaxy is fixed (#7440)" (#7446)

This reverts commit f7532c7d9d.

(cherry picked from commit 8055dd1c9b)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-29 20:57:51 +01:00
patchback[bot]
2ed7e96372 [PR #7439/2b628260 backport][stable-7] Fix more typos (#7445)
Fix more typos (#7439)

* Fix more typos in plugins/.

* Fix typos in tests/unit/.

* Fix typos in tests/integration/.

* Fix more typos.

Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>

---------

Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
(cherry picked from commit 2b62826082)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-29 20:26:39 +01:00
patchback[bot]
985fbb321b [PR #7403/09ae963f backport][stable-7] nmcli: add additional documentation for routing_rules4 option (#7425)
nmcli: add additional documentation for routing_rules4 option (#7403)

* Add additional documentation for routing_rules4 option.

I had some trouble initially getting this to work as I wasn't very clear on what was required to that end I have added an example task and fixed what I suspect is a typo in the description.

* Update nmcli.py

Remove trailing whitespace.

(cherry picked from commit 09ae963f58)

Co-authored-by: Alistair MacCallum [Vaarst] <81685753+AlistairMaccallum@users.noreply.github.com>
2023-10-29 15:29:20 +01:00
patchback[bot]
037863b834 [PR #7440/f7532c7d backport][stable-7] Disable ansible_galaxy_install tests until Galaxy is fixed (#7443)
Disable ansible_galaxy_install tests until Galaxy is fixed (#7440)

Disable ansible_galaxy_install tests until Galaxy is fixed.

(cherry picked from commit f7532c7d9d)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-29 09:58:26 +01:00
patchback[bot]
e19fda6cb0 [PR #7429/e556abb5 backport][stable-7] Many typo fixes (#7430)
Many typo fixes (#7429)

(cherry picked from commit e556abb56b)

Co-authored-by: Alex <alex@alxg.de>
2023-10-26 06:20:21 +02:00
patchback[bot]
4175c4c8fe [PR #7427/f4d81681 backport][stable-7] Typo fix (#7428)
Typo fix (#7427)

* Fix typos in proxmox modules

* Fix typos on gitlab modules

* Fix typo

(cherry picked from commit f4d8168131)

Co-authored-by: Alex <alex@alxg.de>
2023-10-25 22:47:24 +02:00
Felix Fontein
e64d124e18 [stable-7] CI: remove macOS 12.0 from CI (#7420)
CI: remove macOS 12.0 from CI (#7419)

macOS in CI seems to be very unreliable or even totally dead.

(cherry picked from commit 932b657ab8)
2023-10-22 17:30:20 +00:00
patchback[bot]
52c0a1565d [PR #7410/9abba281 backport][stable-7] plugins/modules/gitlab: typo fix: s/Wether/Whether/ (#7413)
plugins/modules/gitlab: typo fix: s/Wether/Whether/ (#7410)

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
(cherry picked from commit 9abba2816e)

Co-authored-by: Simon Deziel <simon.deziel@canonical.com>
2023-10-20 08:13:49 +02:00
patchback[bot]
df89012081 [PR #7382/33133f3b backport][stable-7] kernel_blacklist: bugfix (#7409)
kernel_blacklist: bugfix (#7382)

* kernel_blacklist: bugfix

* add fix + changelog frag

* skip aix,freebsd,macos,osx in integration test

* Update changelogs/fragments/7382-kernel-blacklist-bugfix.yml

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

---------

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

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-10-18 21:15:28 +02:00
patchback[bot]
ee2d7cd21b [PR #7375/eb4f8d43 backport][stable-7] Fix pagination issue in community.general.github_deploy_key (#7408)
Fix  pagination issue in community.general.github_deploy_key (#7375)

* Fix pagination issue in community.general.github_deploy_key

* Add changelog fragment

* Update changelogs/fragments/7375-fix-github-deploy-key-pagination.yml

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

---------

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

Co-authored-by: Padraic Calpin <padraic.calpin93@gmail.com>
2023-10-18 21:15:17 +02:00
patchback[bot]
22735bcc73 [PR #7397/cdb19ab8 backport][stable-7] Update proxmox.py (#7398)
Update proxmox.py (#7397)

fix simple typo

(cherry picked from commit cdb19ab8c1)

Co-authored-by: Dustin Rue <ruedu@dustinrue.com>
2023-10-15 18:58:37 +02:00
patchback[bot]
5100d972b3 [PR #7374/479e7df6 backport][stable-7] Fix callback/selective task print being long (#7391)
Fix callback/selective task print being long (#7374)

* Fix callback/selective task print being long

Compare against all text on the line rather than simply the task_name var,
which does not include 3 formatting characters in the string

* Add changelog fragment

---------

Co-authored-by: Aidan Houck <AidanHouck@users.noreply.github.com>
(cherry picked from commit 479e7df687)

Co-authored-by: Aidan Houck <92699100+AidanHouck@users.noreply.github.com>
2023-10-11 17:08:15 +02:00
patchback[bot]
7ce39c38c9 [PR #7385/91fdc8e0 backport][stable-7] Skip odbc tests on Python 2.6 and CentOS 7 (#7388)
Skip odbc tests on Python 2.6 and CentOS 7 (#7385)

Skip odbc tests on Python 2.6 and CentOS 7.

(cherry picked from commit 91fdc8e06a)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-11 15:58:21 +02:00
patchback[bot]
6316bd6e4d [PR #7378/d7bb8648 backport][stable-7] redhat_subscription: fix D-Bus option for consumer type on older distros (#7384)
redhat_subscription: fix D-Bus option for consumer type on older distros (#7378)

subscription-manager 1.29.32 renames the "type" D-Bus registration
option to "consumer_type"; this means that the right option must be
passed according to the distro type & version.

Copy the same approach done for environments, tweaking the version
needed: this change is found in RHEL 9.2+ and supported Fedora versions.

Reported-by: Radek Bíba <rbiba@redhat.com>
(cherry picked from commit d7bb8648f3)

Co-authored-by: Pino Toscano <ptoscano@redhat.com>
2023-10-11 09:01:00 +02:00
patchback[bot]
d3b9759ef1 [PR #7379/557a4ae6 backport][stable-7] Make compatible with current ansible-core devel (#7381)
Make compatible with current ansible-core devel (#7379)

Make compatible with current ansible-core devel.

(cherry picked from commit 557a4ae653)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-10 09:06:52 +02:00
Felix Fontein
2321a12d07 The next expected release will be 7.5.1. 2023-10-09 11:50:34 +02:00
Felix Fontein
e8f9f21be1 Release 7.5.0. 2023-10-09 11:32:45 +02:00
patchback[bot]
f1fee975ba [PR #7144/c7084c6c backport][stable-7] Adding bios registries command to redfish_info (#7372)
Adding bios registries command to redfish_info (#7144)

* added bios attribute registry

* changelog

* changed bios registry function

* Added credential based support

* removed request and added workaround for HPE servers

* Update plugins/module_utils/redfish_utils.py

Agreed

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

* Update plugins/module_utils/redfish_utils.py

Agreed

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

* Added vendor specific changes

---------

Co-authored-by: Ramasamy <gayathiri.dev.ramasamy@hpe.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit c7084c6c30)

Co-authored-by: Gayathirideviramasamy <48905873+Gayathirideviramasamy@users.noreply.github.com>
2023-10-09 09:25:53 +02:00
patchback[bot]
d4e831f31d [PR #7369/1bf5a44a backport][stable-7] Fix lxc plugin options (#7371)
Fix lxc plugin options (#7369)

* Fixture for liblxc

Add a fixture to allow testing the lxc connection plugin both with and
without liblxc being present.

Also change the test from unittest to pytest.

* Update liblxc error message

The error is not specific to python2, so remove the version. Also add
a test for it.

* Migrate to options

Because the lxc plugin was only using PlayContext properties, using host
vars like `ansible_lxc_host` didn't work. This is fixed by instead using
the `get_option` method inherited from `AnsiblePlugin`.
The options are not yet available in the `__init__` function, so the
determination of the container name is moved to the `_connect` method,
which is the first time it is actually needed.
The default for the `remote_addr` option is removed, because the string
`inventory_hostname` is not very useful. At all. This seams to have been
spread with copy&paste and a bit of cargo culting. The variable priority
already takes care of setting the value.

* Add changelog fragment

* Fix for Py2.7

`TypeError: super() takes at least 1 argument (0 given)`

* Add plugin type to changelog fragment.

* Restore untemplated default

This partially reverts commit 429d8c8cfb.

---------

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

Co-authored-by: Corubba <97832352+corubba@users.noreply.github.com>
2023-10-09 09:21:31 +02:00
Felix Fontein
07d0de5640 Mention that this is the last minor 7.x.0 release. 2023-10-08 18:42:18 +02:00
patchback[bot]
c1309ceb8b [PR #7355/85e866cc backport][stable-7] newrelic_deployment: add app_name_exact_match parameter (#7367)
newrelic_deployment: add app_name_exact_match parameter (#7355)

* newrelic_deployment: add app_name_exact_match parameter

* add changelog

* fix ident

* fix line ending format

* Update plugins/modules/newrelic_deployment.py

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

* Update changelogs/fragments/7355-newrelic-deployment-add-exact-name.yml

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

* Update plugins/modules/newrelic_deployment.py

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

* Update plugins/modules/newrelic_deployment.py

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

* Update plugins/modules/newrelic_deployment.py

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

* Update plugins/modules/newrelic_deployment.py

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

* Write out abbreviation.

---------

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

Co-authored-by: matiasba <matiasabarros@hotmail.com>
2023-10-08 18:37:19 +02:00
patchback[bot]
00efbe6ea2 [PR #7364/8a51a3c3 backport][stable-7] Add option force_delete module gitlab_group (#7368)
Add option force_delete module gitlab_group (#7364)

* Update gitlab_group.py

- Add option force (default value: false) to delete group even if projects exists in it.

* Create 7364-add-option-force-gitlab-group.yml

* Update 7364-add-option-force-gitlab-group.yml

* Update plugins/modules/gitlab_group.py

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

* Update changelogs/fragments/7364-add-option-force-gitlab-group.yml

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

* Update plugins/modules/gitlab_group.py

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

* Update gitlab_group.py

- Add message in projects inside group

* Update plugins/modules/gitlab_group.py

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

* Update gitlab_group.py

Split lines

* Update gitlab_group.py

---------

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

Co-authored-by: paytroff <paytroff@gmail.com>
2023-10-08 18:37:15 +02:00
Felix Fontein
d18092a128 Fix filename. 2023-10-08 13:31:00 +02:00
Felix Fontein
b783d025df Prepare 7.5.0 release. 2023-10-08 12:59:54 +02:00
patchback[bot]
113764215d [PR #7340/323a1dcf backport][stable-7] snap: detect change by checking final state (#7366)
snap: detect change by checking final state (#7340)

* snap: detect change by checking final state

* detect change in snap_status variable

* add changelog frag

(cherry picked from commit 323a1dcff8)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-10-08 12:46:27 +02:00
patchback[bot]
ef8fb888cd [PR #7304/324c22f6 backport][stable-7] Prevent parted warnings in script mode (#7365)
Prevent parted warnings in script mode (#7304)

* Prevent parted warnings in script mode

* Update parted.py with check parted version

* Typo

* Create 7304-prevent-parted-warnings.yml

* Update 7304-prevent-parted-warnings.yml

* Update 7304-prevent-parted-warnings.yml

* Update 7304-prevent-parted-warnings.yml

* Update 7304-prevent-parted-warnings.yml

* Update 7304-prevent-parted-warnings.yml

* Update changelogs/fragments/7304-prevent-parted-warnings.yml

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

* Update plugins/modules/parted.py

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

* Update parted.py - simplification

---------

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

Co-authored-by: oldmanhere <79988786+oldmanhere@users.noreply.github.com>
2023-10-08 12:46:12 +02:00
patchback[bot]
8385d2eb39 [PR #6813/55893f27 backport][stable-7] Adding CreateVolume functionality (#7359)
Adding CreateVolume functionality (#6813)

* Adding create volume functionality

* Adding changelog fragment

* Sanity Fix

* Sanity fix

* Update 6813-redfish-config-add-create-volume.yml

* Sanity fix

* Sanity fix

* Removing capabilities check and correcting controllers terminology to storage subsystem

* Updating as per PR suggestions

* sanity fix

* Update plugins/modules/redfish_config.py

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

* Update plugins/modules/redfish_config.py

Agreed

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

* Fixing merge issue

* Fixing sanity issues

* Adding CapacityBytes as a mandatory parameter and adding failure message when run for server below iLO6

* Sanity fix

* Sanity fix

* Updating vendor specific failure

* Update plugins/modules/redfish_config.py

Agreed

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

* Removing vendor specific failure case

* removing unused import

---------

Co-authored-by: Kushal <t-s.kushal@hpe.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 55893f27c9)

Co-authored-by: TSKushal <44438079+TSKushal@users.noreply.github.com>
2023-10-06 23:24:53 +02:00
patchback[bot]
de38d23bdc [PR #7352/0ca07b0b backport][stable-7] Add executable option to cargo (#7357)
Add `executable` option to cargo (#7352)

* Add `executable` option to cargo

Add `executable` option to cargo to make the module easier to use with
cargo installed by rustup.

* Add changelog fragment

* Add license to integration test

* Do not test on CentOS 6

CentOS 6 cannot even validate the certificate in https://sh.rustup.rs.

* Fix condition to skip tests on CentOS 6

* Add version_added to path

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

* Update plugins/modules/cargo.py

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

* shell → command

---------

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

Co-authored-by: radek-sprta <mail@radeksprta.eu>
2023-10-06 07:54:16 +02:00
patchback[bot]
3cb9b0fa91 [PR #7348/6c9713b3 backport][stable-7] Fix Python 3.12 unit tests (#7351)
Fix Python 3.12 unit tests (#7348)

* Re-enable Python 3.12 unit tests.

* Stop using deprecated alias.

* Stop using long deprecated subset comparison function.

* Avoid another alias.

* Fix name, add Python 2 compatibility.

* Properly make backwards compatible.

(cherry picked from commit 6c9713b36c)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-05 06:36:50 +02:00
patchback[bot]
551e5e4bd5 [PR #7332/160e00e5 backport][stable-7] LXD moved to Canonical (#7350)
LXD moved to Canonical (#7332)

* plugins/inventory/lxd: update links to doc

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>

* plugins/modules/lxd_container: update links to doc

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>

* plugins/modules/lxd_profile: update links to doc

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>

* plugins/modules/lxd_project: update links to doc

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>

---------

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
(cherry picked from commit 160e00e5b9)

Co-authored-by: Simon Deziel <simon.deziel@gmail.com>
2023-10-04 20:20:46 +02:00
patchback[bot]
c75711167f [PR #7343/cda6fc95 backport][stable-7] Add TCP option for dig plugin. (#7349)
Add TCP option for dig plugin. (#7343)

* Add TCP option for dig plugin.

* Add changelog of dig tcp option

* Apply suggestions from code review

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

---------

Co-authored-by: s-miyachi <s-miyachi@jocdn.co.jp>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit cda6fc956f)

Co-authored-by: k_e <niea.seven@gmail.com>
2023-10-04 19:37:33 +02:00
patchback[bot]
b279694779 [PR #7339/39895a6d backport][stable-7] pnpm: version should not be latest when state is latest (#7347)
pnpm: version should not be latest when state is latest (#7339)

* (fix) don't set version at latest at state: latest

If version is forcefully set at latest when state is latest, the package
will always be changed, as there is no version "latest" will ever be
detected. It is better to keep it None.

* (fix) fixed tests to reflect recent changes

* Apply suggestions from code review

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

* (feat) added changelog fragment for pull #7339

* (fix) apply correct punctuation to changelog

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

---------

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

Co-authored-by: Aritra Sen <125266845+aretrosen@users.noreply.github.com>
2023-10-04 16:47:32 +00:00
patchback[bot]
625d22391f [PR #7344/8c069f3a backport][stable-7] CI: ansible-core devel drops support for Python 2.7 and 3.6 (#7345)
CI: ansible-core devel drops support for Python 2.7 and 3.6 (#7344)

* ansible-core devel drops support for Python 2.7 and 3.6.

* Temporarily disable unit tests for Python 3.12.

(cherry picked from commit 8c069f3afb)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-04 09:13:13 +02:00
patchback[bot]
1b488b53f5 [PR #6618/8dc5a602 backport][stable-7] Support for simpleinit-msb init system (#7342)
Support for simpleinit-msb init system (#6618)

* Support for simpleinit-msb init system

* Drop unused imports

* Correct regex

* Fix documentation

* Address BOTMETA

* PEP8 compliance

* Drop irrelevant snippet

* Add missing option type in docs

* PEP8 compliance

* Update plugins/modules/simpleinit_msb.py

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

* Update plugins/modules/simpleinit_msb.py

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

* Update plugins/modules/simpleinit_msb.py

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

* Daemonize commands in service control to handle telinit broken behavior

* Update plugins/modules/simpleinit_msb.py

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

* Update plugins/modules/simpleinit_msb.py

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

* Update plugins/modules/simpleinit_msb.py

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

* Update plugins/modules/simpleinit_msb.py

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

* Unify examples section

* Add unit tests for service state detection

* Drop unused import

* Add service enable/disable tests

* Test get_service_tools()

* Do not shadow fail_json()

* Reuse module init

* Implement service_enabled() and associated tests

* Update plugins/modules/simpleinit_msb.py

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

* Indent

* Bump version_added

* Bump requirements

* Reword and move to notes

---------

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

Co-authored-by: Val V <vaygr@users.noreply.github.com>
2023-10-03 07:24:09 +02:00
patchback[bot]
51648d5328 [PR #7330/cd83b245 backport][stable-7] Add support for Oem params (#7341)
Add support for Oem params (#7330)

* Add support for "Oem" parameters in the MultipartHTTPPushUpdate redfish_command

* Add doc entry

* Add changelog fragment
Add version_added field

* Re-word the changelog fragment

* After further testing this should not have a default definition as
it should not be in the payload if not defined

(cherry picked from commit cd83b245bb)

Co-authored-by: Scott Seekamp <sseekamp@coreweave.com>
2023-10-02 22:13:36 +02:00
patchback[bot]
87aedc7bd6 [PR #7334/92d7bd68 backport][stable-7] Fix Galaxy URLs (#7337)
Fix Galaxy URLs (#7334)

Fix Galaxy URLs.

(cherry picked from commit 92d7bd68e9)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-09-30 21:26:38 +02:00
patchback[bot]
1a0c9eb5e6 [PR #7308/35b252c9 backport][stable-7] allow specifying a 1Password account ID (#7328)
allow specifying a 1Password account ID (#7308)

* allow specifying a 1p account ID

* add 'version_added' field

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

* fix spacing

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

* add changelog fragment

* update onepassword_raw

* Remove periods.

---------

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

Co-authored-by: Ilya Trushchenko <i@whitehat.com.ua>
2023-09-29 13:00:25 +02:00
patchback[bot]
b862c0db49 [PR #7295/eae7161b backport][stable-7] Adding deprecation for timeout parameter from 10 to 60 for redfish_info, redfish_config and redfish_command (#7327)
Adding deprecation for timeout parameter from 10 to 60 for redfish_info, redfish_config and redfish_command (#7295)

* Adding deprecation for timeout from 10 to 60 for redfish_info, redfish_config and redfish_command

* Adding changelog fragment and sanity fixes

* Update changelogs/fragments/7295-adding_deprecation_for_timeout_in_redfish_info_config_command.yml

Agreed. Thanks!

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

* Update changelogs/fragments/7295-adding_deprecation_for_timeout_in_redfish_info_config_command.yml

Agreed. Thanks!

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

* Update plugins/modules/redfish_command.py

Agreed. Thanks!

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

* Update plugins/modules/redfish_command.py

Agreed. Thanks!

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

* Updating release version

---------

Co-authored-by: Kushal <t-s.kushal@hpe.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit eae7161bf0)

Co-authored-by: TSKushal <44438079+TSKushal@users.noreply.github.com>
2023-09-29 13:00:15 +02:00
patchback[bot]
adba23c223 [PR #7267/43396efa backport][stable-7] feat(redis_info): use module_utils redis to support TLS (#7326)
feat(redis_info): use module_utils redis to support TLS (#7267)

feat(redis_info): use redis module_utils to support TLS

(cherry picked from commit 43396efa2c)

Co-authored-by: Grégoire Martini <greg5813@users.noreply.github.com>
2023-09-29 13:00:05 +02:00
patchback[bot]
7fa84e8ec7 [PR #7323/53978b74 backport][stable-7] nmap: fix get_option calls (#7329)
nmap: fix get_option calls (#7323)

Fix get_option calls.

(cherry picked from commit 53978b7440)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-09-29 12:59:04 +02:00
patchback[bot]
14a86ed0ad [PR #7284/b88b0459 backport][stable-7] supervisorctl: stop process before removing it (#7325)
supervisorctl: stop process before removing it (#7284)

* supervisorctl: stop process before removing it

* Update supervisorctl.py

Removes blanks

* adds fragment

* introduces stop_before_removing parameter and fix deleting after stopping

* reduce line length

* Apply suggestions from code review

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

* miss some exit

* fixing review

---------

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

Co-authored-by: Damien Gustave <delovan@gmail.com>
2023-09-28 21:43:45 +02:00
patchback[bot]
dcfd0f47e6 [PR #7318/fbebcbad backport][stable-7] Add LinkStatus to Ethernet Interface attribute list (#7324)
Add LinkStatus to Ethernet Interface attribute list (#7318)

* Add LinkStatus to Ethernet Interface attribute list

* Add changelog fragment

---------

Co-authored-by: Pierre-yves FONTANIERE <pyf@cc.in2p3.fr>
(cherry picked from commit fbebcbada5)

Co-authored-by: Pierre-yves Fontaniere <pyfontan@cc.in2p3.fr>
2023-09-28 21:28:00 +02:00
Felix Fontein
481570d0e3 [stable-7] Fix typo in changelog (#7322)
Fix typo in changelog.
2023-09-28 21:04:38 +02:00
patchback[bot]
9254110b8b [PR #6134/a0d8f4de backport][stable-7] feat(cargo): add locked option (#7310)
feat(cargo): add locked option (#6134)

* feat(cargo): add locked option

This commit introduces locked option to cargo module,
allowing user to install with locked dependency.

Equivalent to `--locked` flag of `cargo install` command

* Update docs.

---------

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

Co-authored-by: Murad Bashirov <66242799+m-spitfire@users.noreply.github.com>
2023-09-25 05:51:31 +02:00
patchback[bot]
17c8e274dc [PR #7301/7bf24eeb backport][stable-7] Fixing incorrect string encapsulation for -backend-config. (#7315)
Fixing incorrect string encapsulation for -backend-config. (#7301)

* Fixing incorrect string encapsulation for -backend-config. Removing shlex_quote.

* Adding change log fragemnt for bugfix:

- "terraform module - prevents `-backend-config` option double encapsulating with `shlex_quote` function. (https://github.com/ansible-collections/community.general/pull/7301)."

* Update changelogs/fragments/7301-fix-backend-config-string-encapsulation.yml

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

---------

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

Co-authored-by: Kosala Atapattu <kosala@kosala.net>
2023-09-25 05:51:22 +02:00
patchback[bot]
30289c7a03 [PR #7309/522fb23e backport][stable-7] xinetd no longer exists; use mdadm instead (#7313)
xinetd no longer exists; use mdadm instead (#7309)

xinetd no longer exists; use mdadm instead.

(cherry picked from commit 522fb23e06)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-09-25 05:51:07 +02:00
patchback[bot]
e8861cafa6 [PR #7263/28b3da88 backport][stable-7] [proxmox] return vmid and taskid (#7307)
[proxmox] return vmid and taskid (#7263)

* add vmid exit value

if create succeeds, we want the vmid

* fix syntax

* add vmid to return codes

* Add taskid to return, and only return vmid when it makes sense to

* add changelog fragment with temporary filename

* Add pr number to fragment

* fix PEP8 E501: line too long

* oops, I knew I still missed something...

* Update 7263-proxmox-return-vmid-and-taskid.yaml

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

* removed taskid from places it's not defined

* finally fixed sanity test errors

Okay, so maybe just waiting for CI to run the tests was a terrible idea.

I installed `inotifywait`, set up a venv for the tests, and in my
editor's terminal pane I ran the following, letting it run every save
until it exited:

    until ansible-test sanity proxmox ; do
        inotifywait --event modify plugins/modules/proxmox.py
    done

---------

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

Co-authored-by: bri <284789+b-@users.noreply.github.com>
2023-09-22 21:55:52 +02:00
patchback[bot]
c47888a5f9 [PR #7303/f4237dde backport][stable-7] Fix incorrect parsing of headers containing equal character (#7306)
Fix incorrect parsing of headers containing equal character (#7303)

* Fix incorrect parsing of header containing equal character

* Add changelog fragment

* Update changelogs/fragments/7303-mail-incorrect-header-parsing.yml

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

---------

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

Co-authored-by: Théo Lévesque <Theo024@users.noreply.github.com>
2023-09-22 13:17:58 +02:00
patchback[bot]
58ba101990 [PR #7296/756e8f5c backport][stable-7] Update from_csv.py docs (#7300)
Update from_csv.py docs (#7296)

Typo fix

(cherry picked from commit 756e8f5cca)

Co-authored-by: bontreger <bontreger@users.noreply.github.com>
2023-09-20 22:44:15 +02:00
patchback[bot]
bf54291500 [PR #7129/12b48aaa backport][stable-7] Adding SetSecureBoot to redfish_config (#7298)
Adding SetSecureBoot to redfish_config (#7129)

* Changing EnableSecureBoot to SetSecureBoot

* Sanity Fix

* Adding changelog fragment

* Update plugins/modules/redfish_config.py

Agreed

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

* Updating PR to just add SetSecureBoot command

* Update plugins/modules/redfish_config.py

Agreed

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

---------

Co-authored-by: Kushal <t-s.kushal@hpe.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 12b48aaa2d)

Co-authored-by: TSKushal <44438079+TSKushal@users.noreply.github.com>
2023-09-20 22:25:40 +02:00
patchback[bot]
8f27ef76f5 [PR #7271/9489a1ea backport][stable-7] New Module: gio_mime (#7293)
* New Module: gio_mime (#7271)

* gio_mime: new module

* multiple changes

- fixed gio_mime module utils handler detection
- add message to test helper assertion
- add unit test

* gio mime output uses unicode smart quotes

* test helper: do not use skip/xfail reason messages - break in old pytest

* Update plugins/modules/gio_mime.py

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

* change exist variables to meet standards

---------

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

* Add ignore for 2.17.

(cherry picked from commit c4009deeb1)

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-09-20 22:04:36 +02:00
patchback[bot]
61e82c50e4 [PR #7242/c3fd14e1 backport][stable-7] Ignore similar chars in random_string (#7292)
Ignore similar chars in random_string (#7242)

* Added the option to ignore certain characters

This can be usefull for eliminating confusion.

* Removed the loop and added each char_sets

The variable name is not known inside the loop so updating it does not work.

* Changelog fragment file

* Forgot the file extention for the fragment yaml file

* Update plugins/lookup/random_string.py

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

* Update plugins/lookup/random_string.py

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

* Update plugins/lookup/random_string.py

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

---------

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

Co-authored-by: Gustav Alerby <g.alerby@gmail.com>
2023-09-20 22:04:29 +02:00
patchback[bot]
dfbde55aeb [PR #7251/fc2e6c4b backport][stable-7] Fixed gitlab_*_variable when using purge (#7294)
Fixed gitlab_*_variable when using purge (#7251)

* Fixed gitlab_*_variable when using purge, see issue #7250

* Update changelogs/fragments/7251-gitlab-variables-deleteing-all-variables.yml

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

---------

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

Co-authored-by: MaxBidlingmaier <103562872+MaxBidlingmaier@users.noreply.github.com>
2023-09-20 22:04:19 +02:00
patchback[bot]
24b6441580 [PR #7127/9a7a7a96 backport][stable-7] Add keycloak_realm_key module (#7291)
Add keycloak_realm_key module (#7127)

* Add keycloak_realm_key module

* keycloak_realm_key: make "ansible-test sanity" happy

Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>

* keycloak_realm_key: support check_mode

* keycloak_realm_key: add integration tests

* keycloak_realm_key: remove FIXME comment

* keycloak_realm_key: fix EOL in integration test variables

* keycloak_realm_key: remove unused import

* keycloak_realm_key: remove integration test realm at the end of test suite

* keycloak_realm_key: add version_added metadata

* keycloak_realm_key: add documentation for end_state

* keycloak_realm_key: support the "certificate" parameter

As with "private_key" changing the certificate after creation is not possible
because we can't compare the current value to the desired value.

* keycloak_realm_key: document default for certificate parameter

Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>

* keycloak_realm_key: implement diff mode

* Update plugins/modules/keycloak_realm_key.py

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

* Update plugins/modules/keycloak_realm_key.py

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

* Update plugins/modules/keycloak_realm_key.py

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

* Update plugins/modules/keycloak_realm_key.py

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

* Update plugins/modules/keycloak_realm_key.py

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

* keycloak_realm_key: remove note about literal linefeeds

* keycloak_realm_key: remove defaults from priority and certificate

* keycloak_realm_key: mark diff and check modes as partially supported

* keycloak_realm_key: implement "force" parameter

This ensures that the desired state is always enforced on keys that should be,
and are, present.

* keycloak_realm_key: fix yaml parsing error in documentation

* keycloak_realm_key: document why check_mode support is partial

* Update plugins/modules/keycloak_realm_key.py

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

* Update plugins/modules/keycloak_realm_key.py

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

* keycloak_realm_key: documentation and metadata fixes

* keycloak_realm_key: small documentation fix

* keycloak_realm_key: change version_added to 7.5.0

* Update plugins/modules/keycloak_realm_key.py

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

---------

Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 9a7a7a9658)

Co-authored-by: Samuli Seppänen <samuli.seppanen@gmail.com>
2023-09-19 22:09:54 +00:00
patchback[bot]
4381ac1bf3 [PR #7126/721108d9 backport][stable-7] Add keycloak_authz_custom_policy module (#7290)
Add keycloak_authz_custom_policy module (#7126)

* Add keycloak_authz_custom_policy module

* keycloak.py: add linefeed to keep linter happy

* keycloak_authz_custom_policy: add basic integration tests

* keycloak_authz_custom_policy: add support for check_mode

* keycloak_authz_custom_policy: add check_mode-specific integration tests

Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>

* keycloak_authz_custom_policy: improve logging

Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>

* keycloak_authz_custom_policy: fix typo

* keycloak_authz_custom_policy: add licensing information

This should make this module REUSE compliant

* keycloak_authz_custom_policy: remove comment markers from license files

* keycloak_authz_custom_policy: fix typo in the example

* keycloak_authz_custom_policy: fix typos in metadata

* keycloak_authz_custom_policy: change version_added to 7.5.0

* Update plugins/modules/keycloak_authz_custom_policy.py

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

---------

Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 721108d92e)

Co-authored-by: Samuli Seppänen <samuli.seppanen@gmail.com>
2023-09-19 21:23:36 +02:00
patchback[bot]
e83bb285b2 [PR #7286/b38423c0 backport][stable-7] Add ansible-core 2.16 to the matrix (#7289)
Add ansible-core 2.16 to the matrix (#7286)

* Add ansible-core 2.16 to the matrix.

* Re-order entries.

(cherry picked from commit b38423c059)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-09-19 21:23:26 +02:00
patchback[bot]
edd4637b9f [PR #6972/d0f229f5 backport][stable-7] Add consul_role module from domant PR (#7282)
Add consul_role module from domant PR (#6972)

* Update as per PR comments

* Move common code to module_utils

* Break up long import line

* Fix pipeline errors

* Inital version of check_mode support

* Fix updating a role, add tests

* Fix line spacing

* Fix line indentation

* Add consul-role tests

* Fixes for role update

* Apply suggestions from code review

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

* Update as per MR comments

* Update as per MR comments

* Fix documentation issues

* Add types for sub-options

* Allow setting of policy, service and node id fields by specifying a value, or leaving them unchanged by omitting them

* Fix typo in test

* Apply suggestions from code review

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

* Reset and force push to get rid of merge

* Corrected unit tests

* Apply suggestions from code review

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

* Add suboptions documentation for node and service identities

* Fix PEP errors from pipeline

* Fix pipeline errors.

* Fix more pipeline errors

* Apply suggestions from code review

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

* Fix line that is too long

* Not specifying a value for description during update now leaves existing value unchanged

* Fixes for pipeline errors

* Add test cases to verify handling description works

---------

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

Co-authored-by: Valerio Poggi <106782233+valeriopoggi@users.noreply.github.com>
2023-09-17 14:51:07 +02:00
patchback[bot]
eefdf5b58e [PR #7249/4030481b backport][stable-7] ipa_user documentation: givenname and sn are required when user doesn't exist (#7281)
ipa_user documentation: givenname and sn are required when user doesn't exist (#7249)

* Edit  givenname and sn description.

* Update plugins/modules/ipa_user.py

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

* Update plugins/modules/ipa_user.py

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

---------

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

Co-authored-by: Christer Warén <cwchristerw@gmail.com>
2023-09-17 14:36:20 +02:00
patchback[bot]
39c39e3de1 [PR #7273/8a9b9827 backport][stable-7] Add ignore_spaces option to ini_file to ignore spacing changes (#7279)
Add `ignore_spaces` option to `ini_file` to ignore spacing changes (#7273)

* Add `ignore_spaces` option to `ini_file` to ignore spacing changes

Add a new `ignore_spaces` option to the `ini_file` module which, if
true, prevents the module from changing a line in a file if the only
thing that would change by doing so is whitespace before or after the
`=`.

Also add test cases for this new functionality. There were previously
no tests for `ini_file` at all, and this doesn't attempt to fix that,
but it does add tests to ensure that the new behavior implemented here
as well as the old behavior in the affected code are correct.

Fixes #7202.

* Add changelog fragment

* pep8 / pylint

* remove unused import

* fix typo in comment in integration test file

* Add symlink tests to main.yml

It appears that #6546 added symlink tests but neglected to add them to
main.yml so they weren't being executed.

* ini_file symlink tests; create output files in correct location

* Add integration tests for ini_file ignore_spaces

* PR feedback

(cherry picked from commit 8a9b98273d)

Co-authored-by: Jonathan Kamens <jik@kamens.us>
2023-09-17 14:36:05 +02:00
patchback[bot]
50284d1292 [PR #7274/be9dcd2c backport][stable-7] add russoz as maintainer of modules/snap and module_utils/snap (#7276)
add russoz as maintainer of modules/snap and module_utils/snap (#7274)

(cherry picked from commit be9dcd2c85)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-09-16 12:11:29 +02:00
patchback[bot]
1590892a56 [PR #7266/e7ff0acd backport][stable-7] refactor test helper context class (#7270)
refactor test helper context class (#7266)

(cherry picked from commit e7ff0acdac)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-09-15 23:11:31 +02:00
patchback[bot]
f6722c142d [PR #7264/fc530cd3 backport][stable-7] ldap_search: make sure to also handle binary strings in Python 3 (#7268)
ldap_search: make sure to also handle binary strings in Python 3 (#7264)

Make sure to also handle binary strings in Python 3.

(cherry picked from commit fc530cd3f5)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-09-15 19:15:03 +02:00
Felix Fontein
417db583e7 [stable-7] Deprecate support for ansible-core 2.11 and 2.12 (#7259)
Deprecate support for ansible-core 2.11 and 2.12.
2023-09-15 18:51:10 +02:00
patchback[bot]
aa3b53fb87 [PR #7241/1beb38ce backport][stable-7] Use get(..) instead of [..] for safe lookup of value (Fixes #7240) (#7258)
Use `get(..)` instead of [..] for safe lookup of value (Fixes #7240) (#7241)

A OnePassword field item might not have a value (property) when the user has omitted it (on purpose).

(cherry picked from commit 1beb38ceff)

Co-authored-by: Wouter Klein Heerenbrink <wouter@fluxility.com>
2023-09-13 06:24:22 +00:00
patchback[bot]
ffca7eaf52 [PR #7247/6e3a56ff backport][stable-7] encapsulate test function in the helper class (#7255)
encapsulate test function in the helper class (#7247)

(cherry picked from commit 6e3a56ffce)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-09-13 07:58:02 +02:00
patchback[bot]
5b9b98340b [PR #7248/17c76872 backport][stable-7] DRY: using YAML anchors and aliases (#7256)
DRY: using YAML anchors and aliases (#7248)

(cherry picked from commit 17c7687283)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-09-13 07:57:30 +02:00
patchback[bot]
4be9bb1118 [PR #7252/7d97b37b backport][stable-7] Update my maintainer status for 1PW plugin (#7254)
Update my maintainer status for 1PW plugin (#7252)

* ignore notifications for scottsb on 1pw plugin; update email

* Also update maintainers list.

---------

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

Co-authored-by: Scott Buchanan <scottiesb@gmail.com>
2023-09-13 07:20:07 +02:00
patchback[bot]
d50476cdab [PR #7237/bc9dca4b backport][stable-7] build(deps): bump actions/checkout from 3 to 4 (#7244)
build(deps): bump actions/checkout from 3 to 4 (#7237)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit bc9dca4bc8)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 08:00:12 +02:00
patchback[bot]
363e8662b0 [PR #7239/bdf8852e backport][stable-7] test helper: create static methods .from_file() and .from_list() (#7245)
test helper: create static methods .from_file() and .from_list() (#7239)

create static methods .from_file() and .from_list()

(cherry picked from commit bdf8852e8d)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-09-12 08:00:02 +02:00
Felix Fontein
5365dcef3c The next expected release will be 7.5.0. 2023-09-11 21:13:09 +02:00
Felix Fontein
89accbfa2b Release 7.4.0. 2023-09-11 20:27:32 +02:00
patchback[bot]
63210f4fc4 [PR #7219/208df2c9 backport][stable-7] nsupdate: fix 'index out of range' error when no TTL answer is given (#7236)
nsupdate: fix 'index out of range' error when no TTL answer is given (#7219)

* nsupdate: fix 'index out of range' error when no TTL answer is given

Fix a possible `list index out of range` when no answer is returned in the `ttl_changed` method
by applying the existing workaround for NS records to all record types.

Resolves #836

* fixup! nsupdate: fix 'index out of range' error when no TTL answer is given

(cherry picked from commit 208df2c9e6)

Co-authored-by: Silke Hofstra <silkeh@users.noreply.github.com>
2023-09-11 06:01:11 +02:00
patchback[bot]
01864514c2 [PR #7204/afeeb89a backport][stable-7] Improvements to the jenkins_build module and new jenkins_build_info module (#7234)
Improvements to the jenkins_build module and new jenkins_build_info module (#7204)

* Add detach option so the task doesn't wait until the Jenkins job is finished

* Add new time_between_checks to be able to configure the sleep time between requests

* New jenkins_build_info to get information about a specific build

* Add version_added to the new module

* Add changelog fragment for jenkins_build changes

* Fix tests that required the python-jenkins module

* Remove tests that failed

Doesn't really make sense to test that with a mock

* Fix pep8 error

* Update maintainers for the jenkins_build and jenkins_build_info modules

* Improve format and add link to PR

* Move version_added documentation to the right file

* Fix incorrect examples

* Improve text format

* Fix incorrect code style

* Fix incorrect YAML for documentation

* Add version_added documentation to the new options

(cherry picked from commit afeeb89af6)

Co-authored-by: Juan Manuel Casanova González <juan.casanova.922@gmail.com>
2023-09-11 06:00:57 +02:00
patchback[bot]
418589e346 [PR #7231/517e2d48 backport][stable-7] cpanm: using yaml-specified unit tests (#7233)
cpanm: using yaml-specified unit tests (#7231)

* cpanm: using yaml-specified unit tests

* add quote around URLs to appease pyaml@py26

* add changelog frag

(cherry picked from commit 517e2d48eb)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-09-10 21:45:36 +02:00
Felix Fontein
88fab247ca Prepare 7.4.0 release. 2023-09-10 21:30:45 +02:00
patchback[bot]
56edbfc539 [PR #7183/6012d262 backport][stable-7] feat: pagerduty_alert: Adds in use of v2 api provided (#7229)
feat: pagerduty_alert: Adds in use of v2 api provided (#7183)

* feat: pagerduty_alert: Adds in use of v2 api provided

* doc: Adds xishen1 to maintainer

* Pagerduty_alert: documentation change

* pagerduty_alert: update documentation

* pagerduty_alert: update periods

* pagerduty_alert: update documentation

(cherry picked from commit 6012d2623e)

Co-authored-by: xshen1 <araticroyal1998@gmail.com>
2023-09-10 09:00:28 +02:00
patchback[bot]
c94fa6132d [PR #7200/8fa667ee backport][stable-7] CmdRunner bugfix (#7228)
CmdRunner bugfix (#7200)

* cmd_runner module utils: fix bug when passing absolute path not in standard search paths

* improved tests

* changed /usr/bin/echo to /bin/echo for the sake of alpine

* fixed error messaging for last testcase

* add condition to test cases, and remove macos from troubling ones

* fix templating

* fix templating

* exclude centos 6 from testcases copying echo to tmp dir

* try different way of specifying version

* trying trick for old jinjas

* use os.path.isabs() to determine if path is absolute

* add changelog frag

* Update plugins/module_utils/cmd_runner.py

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

* Update changelogs/fragments/7200-cmd-runner-abs-path.yml

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

---------

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

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-09-10 09:00:14 +02:00
patchback[bot]
2fa17c32a3 [PR #6741/568814fc backport][stable-7] New module: pnpm package manager (#7225)
New module: pnpm package manager (#6741)

* (feat) New module pnpm added

A new module for pnpm is added. Necessary entries were written to
BOTMETA.yml.

* (feat) Basic tests added

* (feat) reduced nesting of ifs

* (fix) trying to fix up CI pipelines

* (fix) incorrect indentation of alias fixed

* (feat) fixed further indentations

* Apply suggestions from code review

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

* (fix) various linting and CI errors fixed/ignored

* (feat) reduced restriction, new install method

Some restrictions on OS are reduced. New installation method, similar to
the official installation method, is provided.

* (fix) ignoring CentOS 6 for CI.

* retrigger checks

---------

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

Co-authored-by: Aritra Sen <125266845+aretrosen@users.noreply.github.com>
2023-09-08 17:38:30 +02:00
patchback[bot]
926f627128 [PR #7205/58d89ce4 backport][stable-7] smbios option description (#7224)
smbios option description (#7205)

* smbios option description

More detailed description smbios option

* Update plugins/modules/proxmox_kvm.py

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

* Change map to string

* Update proxmox_kvm.py

---------

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

Co-authored-by: Андрей Неустроев <99169437+aneustroev@users.noreply.github.com>
2023-09-08 13:27:34 +02:00
patchback[bot]
7c6f286df2 [PR #7212/12708c38 backport][stable-7] fix typo (#7222)
fix typo (#7212)

(cherry picked from commit 12708c3848)

Co-authored-by: Андрей Неустроев <99169437+aneustroev@users.noreply.github.com>
2023-09-08 13:17:31 +02:00
patchback[bot]
b6ed6787b5 [PR #7161/a23cd6c1 backport][stable-7] Update incorrect path for pritunl organization post (#7214)
Update incorrect path for pritunl organization post (#7161)

* Update incorrect path for organization post

* Create changelog fragment

* Update changelog fragment.

---------

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

Co-authored-by: dsmackie <48046804+dsmackie@users.noreply.github.com>
2023-09-06 22:06:16 +02:00
patchback[bot]
94a350e72b [PR #7156/0862511e backport][stable-7] Ensure pritunl validate_certs is honoured in all methods (#7216)
Ensure pritunl validate_certs is honoured in all methods (#7156)

* Ensure pritunl validate_certs is honoured in all methods

* Create changelog fragment

* Rename 7156-ensure-validate-certs-parameter-is-honoured to 7156-ensure-validate-certs-parameter-is-honoured.yml

* Update changelog fragment.

---------

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

Co-authored-by: dsmackie <48046804+dsmackie@users.noreply.github.com>
2023-09-06 22:06:09 +02:00
patchback[bot]
46d454eae0 [PR #7180/9021e741 backport][stable-7] community.general.make: (#7218)
community.general.make: (#7180)

* community.general.make:

  allows parameters without value

  closes #7178

* add changelog fragment for community.general.make

* correction: v != none -> v is not None

* update fragment changelog as per developer request

* add an example

* document the modification

* update example with comments as per maintainer request

(cherry picked from commit 9021e7416d)

Co-authored-by: snail59 <25689269+snail59@users.noreply.github.com>
2023-09-06 22:05:57 +02:00
patchback[bot]
adfd73d7ed [PR #7209/9f1a9e30 backport][stable-7] plugins/modules/apache2_module: fix typo (#7211)
plugins/modules/apache2_module: fix typo (#7209)

(cherry picked from commit 9f1a9e306c)

Co-authored-by: Célestin Matte <celestin.matte@gmail.com>
2023-09-06 19:10:04 +02:00
patchback[bot]
aa2a5d9578 [PR #7184/0c03f34f backport][stable-7] plugins/inventory/cobbler: Add exclude/include_mgmt_classes (#7208)
plugins/inventory/cobbler: Add exclude/include_mgmt_classes (#7184)

(cherry picked from commit 0c03f34f54)

Co-authored-by: Orion Poplawski <orion@nwra.com>
2023-09-05 20:50:11 +02:00
patchback[bot]
0f300bddb9 [PR #7179/631d215f backport][stable-7] Add unixy support for check_mode_markers (#7201)
Add unixy support for check_mode_markers (#7179)

* Add unixy support for check_mode_markers

Modifies output on playbook start, task start, and handler start when
playbook runs in check mode.

* changelog fragment

* Address feedback

* Oops

(cherry picked from commit 631d215fe8)

Co-authored-by: akatch <akatch@users.noreply.github.com>
2023-09-03 18:17:29 +02:00
patchback[bot]
3785b656d6 [PR #7196/40cad3e7 backport][stable-7] gconftool2: using yaml-specified unit tests (#7198)
gconftool2: using yaml-specified unit tests (#7196)

* gconftool2: using yaml-specified unit tests

* gconftool2_info: using yaml-specified unit tests

* adjust code for skip and xfail

(cherry picked from commit 40cad3e7a9)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-09-02 18:49:53 +02:00
patchback[bot]
16499072ff [PR #7193/41bd07e3 backport][stable-7] puppet: using yaml-specified unit tests (#7197)
puppet: using yaml-specified unit tests (#7193)

(cherry picked from commit 41bd07e372)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-09-02 13:39:22 +02:00
patchback[bot]
cad6b30036 [PR #7192/14bc13ba backport][stable-7] further improvements (#7195)
further improvements (#7192)

* further improvements

* some renaming

(cherry picked from commit 14bc13ba3c)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-09-02 13:06:17 +02:00
patchback[bot]
2df1126d27 [PR #7191/c2d3302f backport][stable-7] snap: using yaml-specified unit tests (#7194)
snap: using yaml-specified unit tests (#7191)

* snap: using yaml-specified unit tests

* remove extraneous code

(cherry picked from commit c2d3302fc4)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-09-02 09:10:04 +02:00
patchback[bot]
0d5ec37249 [PR #7185/ce6b2bc3 backport][stable-7] remove extraneous unused constant (#7188)
remove extraneous unused constant (#7185)

(cherry picked from commit ce6b2bc362)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-09-01 11:28:13 +00:00
patchback[bot]
7c04aaa48f [PR #7181/d6ebba1a backport][stable-7] cmd tests improvement (#7187)
cmd tests improvement (#7181)

* cmd tests improvement

* fix sanity

* remove commented line

* fixed class init code

(cherry picked from commit d6ebba1aea)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-09-01 11:28:04 +00:00
patchback[bot]
80113063ac [PR #7170/63030966 backport][stable-7] xfconf*: using yaml-specified unit tests (#7177)
xfconf*: using yaml-specified unit tests (#7170)

(cherry picked from commit 6303096648)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-08-30 06:16:17 +02:00
patchback[bot]
1b09e8168a [PR #7172/f3a02b3e backport][stable-7] CI: make sure EXTERNALLY-MANAGED is absent on Arch Linux (#7175)
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>
2023-08-30 06:15:51 +02:00
patchback[bot]
aadd48461c [PR #7154/8652fd95 backport][stable-7] Refactored unit tests for modules based on CmdRunner (#7168)
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>
2023-08-29 13:22:04 +02:00
patchback[bot]
d565a20013 [PR #7132/e7d8ef4c backport][stable-7] gitlab_project_variable/gitlab_group_variable: Add support for 'raw' option (#7166)
gitlab_project_variable/gitlab_group_variable: Add support for 'raw' option (#7132)

feat(gitlab_project_variable): Add support for 'raw' option

(cherry picked from commit e7d8ef4cf9)

Co-authored-by: Léo GATELLIER <26511053+lgatellier@users.noreply.github.com>
2023-08-29 13:05:58 +02:00
patchback[bot]
c69fb82ee0 [PR #7162/4c8c25bc backport][stable-7] keycloak_clientscope_type: fixed example (#7165)
keycloak_clientscope_type: fixed example (#7162)

(cherry picked from commit 4c8c25bc93)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-08-29 07:47:30 +02:00
patchback[bot]
cffc3dad11 [PR #7140/5fcb98cd backport][stable-7] redfish_info: Report Id in GetManagerInventory output (#7153)
redfish_info: Report Id in GetManagerInventory output (#7140)

(cherry picked from commit 5fcb98cd3f)

Co-authored-by: smiller248 <136365984+smiller248@users.noreply.github.com>
2023-08-25 21:07:09 +02:00
patchback[bot]
a27025946b [PR #7125/77214203 backport][stable-7] Fix inappropriate comparison on the length of a Collection (#7147)
Fix inappropriate comparison on the length of a Collection (#7125)

* Comment: Fixed inappropriate comparison on the length of a Collection. Added changlelog fragment file.

* Comment: Updated the scope of the changelog fragment based on feedback.

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

---------

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

Co-authored-by: Munawar <munawar.hafiz@gmail.com>
2023-08-23 06:14:03 +02:00
patchback[bot]
1825feb652 [PR #7135/d1d9895e backport][stable-7] minor typo on proxmox_kvm module documentation (#7142)
minor typo on proxmox_kvm module documentation (#7135)

chore(docs): minor typo

(cherry picked from commit d1d9895eb6)

Co-authored-by: Damien TOURDE <49169262+dtourde@users.noreply.github.com>
2023-08-21 22:00:45 +02:00
patchback[bot]
0c2d1eda44 [PR #6819/17dce5a2 backport][stable-7] Adding 'Links' to the parameter list for data retrieved from get_disk_inventory (#7141)
Adding 'Links' to the parameter list for data retrieved from get_disk_inventory (#6819)

* Adding 'Links' parameter to be retrieved from get_disk_inventory

* Adding changelog fragment

* Updating as per PR suggestions

* Updating to return volumes as a list of strings

* Updating code to retrieve only volumes under the Links parameter

* Updating changelog fragment

* Update changelogs/fragments/6819-redfish-utils-add-links-parameter-for-get_disk_inventory.yml

Agreed

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

---------

Co-authored-by: Kushal <t-s.kushal@hpe.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 17dce5a288)

Co-authored-by: TSKushal <44438079+TSKushal@users.noreply.github.com>
2023-08-21 21:50:39 +02:00
patchback[bot]
d617f6919f [PR #7119/eaf3926c backport][stable-7] nmap inventory plugin, add use_arp_ping option (#7134)
nmap inventory plugin, add use_arp_ping option (#7119)

* nmap inventory plugin, add use_arp_ping option

* Apply suggestions from code review

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

* Update plugins/inventory/nmap.py

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

---------

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

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2023-08-20 14:57:58 +02:00
patchback[bot]
b17cc09b07 [PR #7124/33998a5b backport][stable-7] snap: fix case when snap list is empty (#7128)
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>
2023-08-18 08:00:19 +02:00
Felix Fontein
ee7f44b09b Next expected release will be 7.4.0. 2023-08-15 07:51:00 +02:00
Felix Fontein
a357944fb0 Release 7.3.0. 2023-08-15 07:06:17 +02:00
Felix Fontein
5d7d973f6d Prepare 7.3.0 release. 2023-08-15 07:04:32 +02:00
patchback[bot]
f3a516b79d [PR #7113/6a558734 backport][stable-7] Add support for Redfish PowerCycle reset type (#7115)
Add support for Redfish PowerCycle reset type (#7113)

* Add support for Redfish PowerCycle reset type

* Add changelog frament

(cherry picked from commit 6a558734f7)

Co-authored-by: Scott Seekamp <sseekamp@coreweave.com>
2023-08-14 22:15:44 +02:00
patchback[bot]
d4eaef2d83 [PR #7102/55cfd27b backport][stable-7] freebsd: shutdown -p ... on freebsd to power off machine (#7112)
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>
2023-08-14 21:19:16 +02:00
patchback[bot]
235e55fa9f [PR #7099/bf728aad backport][stable-7] chroot: add disable_root_check option (#7111)
chroot: add `disable_root_check` option (#7099)

* Initial commit

* Update plugins/connection/chroot.py

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

* Add changelog fragment

* Update changelogs/fragments/7099-chroot-disable-root-check-option.yml

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

---------

Co-authored-by: Сашка724ая <git@sashok724.net>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit bf728aadfb)

Co-authored-by: Сашка724ая <github@sashok724.net>
2023-08-14 19:19:05 +00:00
patchback[bot]
c3baaa8cfa [PR #7075/f9f5c45c backport][stable-7] ejabberd_user: use CmdRunner (#7110)
ejabberd_user: use CmdRunner (#7075)

* ejabberd_user: use CmdRunner

* add changelog frag

* regain sanity

(cherry picked from commit f9f5c45c94)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-08-13 22:15:35 +02:00
patchback[bot]
d68f6fcfff [PR #7104/eafdf87b backport][stable-7] lxc: fix remote_addr default to inventory_hostname (#7109)
lxc: fix remote_addr default to inventory_hostname (#7104)

* lxc: fix remote_addr default to inventory_hostname

* Update changelogs/fragments/7104_fix_lxc_remoteaddr_default.yml

---------

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

Co-authored-by: Corubba <97832352+corubba@users.noreply.github.com>
2023-08-13 22:15:26 +02:00
patchback[bot]
70e4ae440c [PR #7103/5e27bbfd backport][stable-7] CI: FreeBSD 13.0 and 12.3 are no longer availabe, bump versions and disable since these versions are already tested with stable-2.15 (#7107)
CI: FreeBSD 13.0 and 12.3 are no longer availabe, bump versions and disable since these versions are already tested with stable-2.15 (#7103)

FreeBSD 13.0 and 12.3 are no longer availabe, bump versions and disable since these versions are already tested with stable-2.15.

(cherry picked from commit 5e27bbfdf6)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-08-13 20:21:44 +02:00
patchback[bot]
8b66bb9a02 [PR #7010/7496466f backport][stable-7] Update chroot.py - better documentation (#7101)
Update chroot.py - better documentation (#7010)

* Update chroot.py

Better informations about sudo and env.

* Update plugins/connection/chroot.py

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 7496466f9d)

Co-authored-by: Przemysław Sztoch <psztoch@finn.pl>
2023-08-12 19:35:50 +02:00
patchback[bot]
76fbb50270 [PR #7053/a0c67a88 backport][stable-7] lvol: Fix pct of origin (#7097)
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>
2023-08-12 11:39:59 +02:00
patchback[bot]
93971b292a [PR #6989/5988b9ac backport][stable-7] npm: changed to cmdrunner (#7096)
npm: changed to cmdrunner (#6989)

* npm: refactor to use CmdRunner

- initial commit, not working

* better handling of parameter "production"

* add changelog frag

* fixed command call and tests

* removed extraneous commented debug code

(cherry picked from commit 5988b9acea)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-08-12 10:26:38 +02:00
patchback[bot]
724bba79d5 [PR #7091/f7176df4 backport][stable-7] sorcery: update only specified grimoires (#7095)
sorcery: update only specified grimoires (#7091)

* sorcery: update only specified grimoires

* Update plugins/modules/sorcery.py

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

* Add a flag to omit listing new repositories before add/remove

* No need to append an empty string

---------

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

Co-authored-by: Vlad Glagolev <vaygr@users.noreply.github.com>
2023-08-12 10:13:45 +02:00
patchback[bot]
e44f43b4d2 [PR #7081/fe3eec01 backport][stable-7] Follow DMTF redfish deprecation on StorageControllers (#7093)
Follow DMTF redfish deprecation on StorageControllers (#7081)

* Get controller information from "Controllers" field instead of "StorageControllers" which is deprecated

* Add changelog fragment

* Changelog fragment writing guide formatting

* For consistency, get_disk_inventory and get_volume_inventory use Controllers key instead of StorageControllers to obtain controller name

---------

Co-authored-by: Pierre-yves FONTANIERE <pyf@cc.in2p3.fr>
(cherry picked from commit fe3eec0122)

Co-authored-by: Pierre-yves Fontaniere <pyfontan@cc.in2p3.fr>
2023-08-11 19:55:49 +02:00
patchback[bot]
f82422502b [PR #7061/e75dc746 backport][stable-7] bitwarden lookup fix get_field (#7090)
bitwarden lookup fix `get_field` (#7061)

* bitwarden lookup rewrite `get_field`

* add changelog fragment

* PEP8 add newline

* Update changelogs/fragments/7061-fix-bitwarden-get_field.yml

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

* Update plugins/lookup/bitwarden.py

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

* Update plugins/lookup/bitwarden.py

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

* Update plugins/lookup/bitwarden.py

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

---------

Co-authored-by: Simon <simonleary@umass.edu>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit e75dc74613)

Co-authored-by: simonLeary42 <71396965+simonLeary42@users.noreply.github.com>
2023-08-11 13:53:36 +02:00
patchback[bot]
5588ce3741 [PR #7067/e7a6412e backport][stable-7] Fix KeycloakAPI's missing http_agent, timeout, and validate_certs open_url() parameters (#7088)
Fix KeycloakAPI's missing http_agent, timeout, and validate_certs open_url() parameters (#7067)

* Fix KeycloakAPI's missing http_agent, timeout, and validate_certs open_url() parameters

* Add changelog fragment

* Update changelogs/fragments/7067-keycloak-api-paramerter-fix.yml

Following suggestion

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

---------

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

Co-authored-by: Loric Vandentempel <loricvdt@gmail.com>
2023-08-11 13:39:46 +02:00
patchback[bot]
719ecc9e85 [PR #7085/a8809401 backport][stable-7] Avoid direct type comparisons (#7086)
Avoid direct type comparisons (#7085)

Avoid direct type comparisons.

(cherry picked from commit a8809401ee)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-08-11 10:23:58 +02:00
patchback[bot]
1a801323a8 [PR #7049/2089769c backport][stable-7] [proxmox_vm_info] Return empty list when requested VM doesn't exist (#7079)
[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>
2023-08-09 16:54:35 +02:00
patchback[bot]
7ebb301930 [PR #7012/d7442558 backport][stable-7] Add grimoire management to sorcery module (#7078)
Add grimoire management to sorcery module (#7012)

* Add grimoire management to sorcery module

* Add changelog fragment

* Bump copyright year

* Separate update_cache and latest state

* Apply suggestions from code review

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

* Add note on latest state and cache_update link

* Unblock execution of multiple stages

* Update plugins/modules/sorcery.py

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

* Update Codex logic to match Sorcery

---------

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

Co-authored-by: Vlad Glagolev <vaygr@users.noreply.github.com>
2023-08-09 16:25:41 +02:00
patchback[bot]
fb5047b605 [PR #6931/91152cb1 backport][stable-7] Keycloak client secret (#7077)
Keycloak client secret (#6931)

* fixe missing secret at creation

* Update doc

* changelogs

* Default protocol only when creation

* Fix sanity test

* Add documentation

* Update plugins/modules/keycloak_client.py

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

---------

Co-authored-by: Andre Desrosiers <andre.desrosiers@ssss.gouv.qc.ca>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 91152cb123)

Co-authored-by: desand01 <desrosiers.a@hotmail.com>
2023-08-09 16:15:15 +02:00
patchback[bot]
b7977b8fa9 [PR #7019/4fda040e backport][stable-7] ipa_config: add user and group ojectclasses parameters (#7071)
ipa_config: add user and group ojectclasses parameters (#7019)

* ipa_config: add user and group ojectclasses parameters

* fix typo

* add changelog fragments and fix version_added

* fix changelog fragment permissions

* Update changelogs/fragments/7019-ipa_config-user-and-group-objectclasses.yml

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

---------

Co-authored-by: Dmitriy Usachev <dmitrii.usachev@hyperus.team>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 4fda040e9e)

Co-authored-by: Dmitriy Usachev <diman-110@list.ru>
2023-08-08 13:45:47 +02:00
patchback[bot]
bae1440425 [PR #7051/c6393cb2 backport][stable-7] ipa_config: add idp choice to ipauserauthtype (#7072)
ipa_config: add idp choice to ipauserauthtype (#7051)

* ipa_config: add idp choice to ipauserauthtype

* ipa_config: edit ipauserauthtype description

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

* Changelog Fragment - 7051

---------

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

Co-authored-by: Christer Warén <cwchristerw@gmail.com>
2023-08-08 13:45:35 +02:00
patchback[bot]
04f3dd2b56 [PR #7033/c1f2f126 backport][stable-7] ejabberd_user: bug fixes + tests (#7070)
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>
2023-08-08 13:45:25 +02:00
patchback[bot]
99e3965ece [PR #7036/d08924d7 backport][stable-7] Documentation to reflect newer Proxmox VE boot string format (#7068)
Documentation to reflect newer Proxmox VE boot string format (#7036)

Co-authored-by: jonathan lung <lungj@heresjono.com>
(cherry picked from commit d08924d759)

Co-authored-by: Jonathan Lung <lungj@users.noreply.github.com>
2023-08-08 13:45:10 +02:00
patchback[bot]
14625a214a [PR #6814/47865284 backport][stable-7] Adding DeleteVolumes functionality (#7066)
Adding DeleteVolumes functionality (#6814)

* Adding DeleteAllVolumes functionality

* Adding changelog fragment and sanity fix

* Sanity Fix

* Updating as per PR suggestions

* Sanity fix

* Adjust version_added.

---------

Co-authored-by: Kushal <t-s.kushal@hpe.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 478652843f)

Co-authored-by: TSKushal <44438079+TSKushal@users.noreply.github.com>
2023-08-05 20:52:55 +02:00
patchback[bot]
3c067aa2c3 [PR #7064/4b17fd42 backport][stable-7] Snap add test (#7065)
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>
2023-08-04 22:31:08 +02:00
patchback[bot]
01004bd27b [PR #7046/c7fa11d5 backport][stable-7] snap: Only treat --- as an info separator when it's preceded by newline (#7063)
snap: Only treat `---` as an info separator when it's preceded by newline (#7046)

* Only treat `---` as an info separator when it's preceded by newline

The code for splitting the output of `snap info` for multiple snaps
can't assume that `---` separates snaps any time it appears in the
output; it needs to treat that as the separator only when it's at the
start of a line. Otherwise it breaks if any snap uses `---` in its
description text, which, e.g., the `bw` snap does as of the date of
this commit.

Fixes #7045.

* Add changelog fragment

* Add a comment explaining why \n is necessary before ---

* Update changelogs/fragments/7046-snap-newline-before-separator.yml

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

---------

Co-authored-by: Jonathan Kamens <jik@jik5.kamens.us>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit c7fa11d576)

Co-authored-by: Jonathan Kamens <jik@kamens.us>
2023-08-04 08:43:53 +02:00
patchback[bot]
f8265ecc4e [PR #7043/d17ec06d backport][stable-7] ejabberd_user: deprecate parameter logging (#7058)
ejabberd_user: deprecate parameter logging (#7043)

* ejabberd_user: deprecate parameter logging

* add changelog frag

* Update plugins/modules/ejabberd_user.py

(cherry picked from commit d17ec06d2a)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-08-02 11:46:13 +02:00
patchback[bot]
2e355bef9f [PR #7055/fd9d9482 backport][stable-7] CI: ansible-core devel only supports Alpine 3.18 VMs, no longer Alpine 3.17 VMs (#7057)
CI: ansible-core devel only supports Alpine 3.18 VMs, no longer Alpine 3.17 VMs (#7055)

ansible-core devel only supports Alpine 3.18 VMs, no longer Alpine 3.17 VMs.

(cherry picked from commit fd9d948267)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-08-02 10:55:58 +02:00
Felix Fontein
e6f65634fe Revert "[stable-7] Revert new features to be able to do 7.2.1 release (#7042)"
This reverts commit 7cf834fb3c.
2023-07-31 16:29:37 +02:00
Felix Fontein
61314898ca The next expected release will be 7.3.0. 2023-07-31 16:29:32 +02:00
358 changed files with 11012 additions and 3129 deletions

View File

@@ -29,14 +29,14 @@ schedules:
always: true
branches:
include:
- stable-8
- stable-7
- stable-6
- cron: 0 11 * * 0
displayName: Weekly (old stable branches)
always: true
branches:
include:
- stable-5
- stable-6
variables:
- name: checkoutPath
@@ -73,6 +73,19 @@ stages:
- test: 3
- test: 4
- test: extra
- stage: Sanity_2_16
displayName: Sanity 2.16
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Test {0}
testFormat: 2.16/sanity/{0}
targets:
- test: 1
- test: 2
- test: 3
- test: 4
- stage: Sanity_2_15
displayName: Sanity 2.15
dependsOn: []
@@ -99,19 +112,6 @@ stages:
- test: 2
- test: 3
- test: 4
- stage: Sanity_2_13
displayName: Sanity 2.13
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Test {0}
testFormat: 2.13/sanity/{0}
targets:
- test: 1
- test: 2
- test: 3
- test: 4
### Units
- stage: Units_devel
displayName: Units devel
@@ -122,13 +122,24 @@ stages:
nameFormat: Python {0}
testFormat: devel/units/{0}/1
targets:
- test: 2.7
- test: 3.6
- test: 3.7
- test: 3.8
- test: 3.9
- test: '3.10'
- test: '3.11'
- test: '3.12'
- stage: Units_2_16
displayName: Units 2.16
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: 2.16/units/{0}/1
targets:
- test: 2.7
- test: 3.6
- test: "3.11"
- stage: Units_2_15
displayName: Units 2.15
dependsOn: []
@@ -150,17 +161,6 @@ stages:
testFormat: 2.14/units/{0}/1
targets:
- test: 3.9
- stage: Units_2_13
displayName: Units 2.13
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: 2.13/units/{0}/1
targets:
- test: 2.7
- test: 3.8
## Remote
- stage: Remote_devel_extra_vms
@@ -171,10 +171,10 @@ stages:
parameters:
testFormat: devel/{0}
targets:
- name: Alpine 3.17
test: alpine/3.17
# - name: Fedora 38
# test: fedora/38
- name: Alpine 3.18
test: alpine/3.18
# - name: Fedora 39
# test: fedora/39
- name: Ubuntu 22.04
test: ubuntu/22.04
groups:
@@ -189,12 +189,30 @@ stages:
targets:
- name: macOS 13.2
test: macos/13.2
- name: RHEL 9.3
test: rhel/9.3
- name: FreeBSD 13.2
test: freebsd/13.2
groups:
- 1
- 2
- 3
- stage: Remote_2_16
displayName: Remote 2.16
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: 2.16/{0}
targets:
#- name: macOS 13.2
# test: macos/13.2
- name: RHEL 9.2
test: rhel/9.2
- name: RHEL 8.8
test: rhel/8.8
- name: FreeBSD 13.2
test: freebsd/13.2
#- name: FreeBSD 13.2
# test: freebsd/13.2
groups:
- 1
- 2
@@ -213,10 +231,10 @@ stages:
test: rhel/8.7
- name: RHEL 7.9
test: rhel/7.9
- name: FreeBSD 13.1
test: freebsd/13.1
- name: FreeBSD 12.4
test: freebsd/12.4
# - name: FreeBSD 13.1
# test: freebsd/13.1
# - name: FreeBSD 12.4
# test: freebsd/12.4
groups:
- 1
- 2
@@ -231,26 +249,10 @@ stages:
targets:
- name: RHEL 9.0
test: rhel/9.0
- name: FreeBSD 12.3
test: freebsd/12.3
groups:
- 1
- 2
- 3
- stage: Remote_2_13
displayName: Remote 2.13
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: 2.13/{0}
targets:
- name: macOS 12.0
test: macos/12.0
- name: RHEL 8.5
test: rhel/8.5
- name: FreeBSD 13.0
test: freebsd/13.0
#- name: macOS 12.0
# test: macos/12.0
#- name: FreeBSD 12.4
# test: freebsd/12.4
groups:
- 1
- 2
@@ -265,10 +267,8 @@ stages:
parameters:
testFormat: devel/linux/{0}
targets:
- name: Fedora 38
test: fedora38
- name: openSUSE 15
test: opensuse15
- name: Fedora 39
test: fedora39
- name: Ubuntu 20.04
test: ubuntu2004
- name: Ubuntu 22.04
@@ -279,6 +279,22 @@ stages:
- 1
- 2
- 3
- stage: Docker_2_16
displayName: Docker 2.16
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: 2.16/linux/{0}
targets:
- name: Fedora 38
test: fedora38
- name: openSUSE 15
test: opensuse15
groups:
- 1
- 2
- 3
- stage: Docker_2_15
displayName: Docker 2.15
dependsOn: []
@@ -303,24 +319,6 @@ stages:
parameters:
testFormat: 2.14/linux/{0}
targets:
- name: Fedora 36
test: fedora36
groups:
- 1
- 2
- 3
- stage: Docker_2_13
displayName: Docker 2.13
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: 2.13/linux/{0}
targets:
- name: Fedora 35
test: fedora35
- name: openSUSE 15 py2
test: opensuse15py2
- name: Alpine 3
test: alpine3
groups:
@@ -343,8 +341,6 @@ stages:
test: debian-bookworm/3.11
- name: ArchLinux
test: archlinux/3.11
- name: CentOS Stream 8
test: centos-stream8/3.9
groups:
- 1
- 2
@@ -360,7 +356,19 @@ stages:
nameFormat: Python {0}
testFormat: devel/generic/{0}/1
targets:
- test: 2.7
- test: '3.7'
- test: '3.12'
- stage: Generic_2_16
displayName: Generic 2.16
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: 2.16/generic/{0}/1
targets:
- test: '2.7'
- test: '3.6'
- test: '3.11'
- stage: Generic_2_15
displayName: Generic 2.15
@@ -371,7 +379,7 @@ stages:
nameFormat: Python {0}
testFormat: 2.15/generic/{0}/1
targets:
- test: 3.9
- test: '3.9'
- stage: Generic_2_14
displayName: Generic 2.14
dependsOn: []
@@ -382,42 +390,32 @@ stages:
testFormat: 2.14/generic/{0}/1
targets:
- test: '3.10'
- stage: Generic_2_13
displayName: Generic 2.13
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: 2.13/generic/{0}/1
targets:
- test: 3.9
- stage: Summary
condition: succeededOrFailed()
dependsOn:
- Sanity_devel
- Sanity_2_13
- Sanity_2_14
- Sanity_2_16
- Sanity_2_15
- Sanity_2_14
- Units_devel
- Units_2_13
- Units_2_14
- Units_2_16
- Units_2_15
- Units_2_14
- Remote_devel_extra_vms
- Remote_devel
- Remote_2_13
- Remote_2_14
- Remote_2_16
- Remote_2_15
- Remote_2_14
- Docker_devel
- Docker_2_13
- Docker_2_14
- Docker_2_16
- Docker_2_15
- Docker_2_14
- Docker_community_devel
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
# - Generic_devel
# - Generic_2_13
# - Generic_2_14
# - Generic_2_16
# - Generic_2_15
# - Generic_2_14
jobs:
- template: templates/coverage.yml

33
.github/BOTMETA.yml vendored
View File

@@ -249,9 +249,11 @@ files:
labels: onepassword
maintainers: samdoran
$lookups/onepassword.py:
maintainers: azenk scottsb
ignore: scottsb
maintainers: azenk
$lookups/onepassword_raw.py:
maintainers: azenk scottsb
ignore: scottsb
maintainers: azenk
$lookups/passwordstore.py: {}
$lookups/random_pet.py:
maintainers: Akasurde
@@ -276,6 +278,8 @@ files:
$module_utils/gconftool2.py:
labels: gconftool2
maintainers: russoz
$module_utils/gio_mime.py:
maintainers: russoz
$module_utils/gitlab.py:
keywords: gitlab source_control
labels: gitlab
@@ -328,6 +332,9 @@ files:
$module_utils/scaleway.py:
labels: cloud scaleway
maintainers: $team_scaleway
$module_utils/snap.py:
labels: snap
maintainers: russoz
$module_utils/ssh.py:
maintainers: russoz
$module_utils/storage/hpe3par/hpe3par.py:
@@ -512,6 +519,8 @@ files:
$modules/gem.py:
labels: gem
maintainers: $team_ansible_core johanwiren
$modules/gio_mime.py:
maintainers: russoz
$modules/git_config.py:
maintainers: djmattyg007 mgedmin
$modules/github_:
@@ -633,6 +642,7 @@ files:
maintainers: bregman-arie
$modules/ipa_:
maintainers: $team_ipa
ignore: fxfitz
$modules/ipbase_info.py:
maintainers: dominikkukacka
$modules/ipa_pwpolicy.py:
@@ -669,7 +679,9 @@ files:
labels: jboss
maintainers: $team_jboss jhoekx
$modules/jenkins_build.py:
maintainers: brettmilford unnecessary-username
maintainers: brettmilford unnecessary-username juanmcasanova
$modules/jenkins_build_info.py:
maintainers: juanmcasanova
$modules/jenkins_job.py:
maintainers: sermilrod
$modules/jenkins_job_info.py:
@@ -696,6 +708,8 @@ files:
maintainers: mattock
$modules/keycloak_authz_permission.py:
maintainers: mattock
$modules/keycloak_authz_custom_policy.py:
maintainers: mattock
$modules/keycloak_authz_permission_info.py:
maintainers: mattock
$modules/keycloak_client_rolemapping.py:
@@ -716,6 +730,8 @@ files:
maintainers: kris2kris
$modules/keycloak_realm_info.py:
maintainers: fynncfchen
$modules/keycloak_realm_key.py:
maintainers: mattock
$modules/keycloak_role.py:
maintainers: laurpaum
$modules/keycloak_user.py:
@@ -937,7 +953,7 @@ files:
labels: pagerduty
maintainers: suprememoocow thaumos
$modules/pagerduty_alert.py:
maintainers: ApsOps
maintainers: ApsOps xshen1
$modules/pagerduty_change.py:
maintainers: adamvaughan
$modules/pagerduty_user.py:
@@ -980,6 +996,9 @@ files:
maintainers: $team_solaris dermute
$modules/pmem.py:
maintainers: mizumm
$modules/pnpm.py:
ignore: chrishoffman
maintainers: aretrosen
$modules/portage.py:
ignore: sayap
labels: portage
@@ -1195,6 +1214,8 @@ files:
ignore: ryansb
$modules/shutdown.py:
maintainers: nitzmahone samdoran aminvakil
$modules/simpleinit_msb.py:
maintainers: vaygr
$modules/sl_vm.py:
maintainers: mcltn
$modules/slack.py:
@@ -1207,7 +1228,7 @@ files:
maintainers: $team_solaris
$modules/snap.py:
labels: snap
maintainers: angristan vcarceler
maintainers: angristan vcarceler russoz
$modules/snap_alias.py:
labels: snap
maintainers: russoz
@@ -1413,7 +1434,7 @@ macros:
team_gitlab: Lunik Shaps marwatk waheedi zanssa scodeman metanovii sh0shin nejch lgatellier suukit
team_hpux: bcoca davx8342
team_huawei: QijunPan TommyLike edisonxiang freesky-edward hwDCN niuzhenguo xuxiaowei0512 yanzhangi zengchen1024 zhongjun2
team_ipa: Akasurde Nosmoht fxfitz justchris1
team_ipa: Akasurde Nosmoht justchris1
team_jboss: Wolfant jairojunior wbrefvem
team_keycloak: eikef ndclt mattock
team_linode: InTheCloudDan decentral1se displague rmcintosh Charliekenney23 LBGarber

View File

@@ -31,6 +31,7 @@ jobs:
ansible:
- '2.11'
- '2.12'
- '2.13'
# Ansible-test on various stable branches does not yet work well with cgroups v2.
# Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04
# image for these stable branches. The list of branches where this is necessary will
@@ -80,6 +81,10 @@ jobs:
python: '2.6'
- ansible: '2.12'
python: '3.8'
- ansible: '2.13'
python: '2.7'
- ansible: '2.13'
python: '3.8'
steps:
- name: >-
@@ -211,6 +216,48 @@ jobs:
# docker: default
# python: '3.8'
# target: azp/generic/1/
# 2.13
- ansible: '2.13'
docker: fedora35
python: ''
target: azp/posix/1/
- ansible: '2.13'
docker: fedora35
python: ''
target: azp/posix/2/
- ansible: '2.13'
docker: fedora35
python: ''
target: azp/posix/3/
- ansible: '2.13'
docker: opensuse15py2
python: ''
target: azp/posix/1/
- ansible: '2.13'
docker: opensuse15py2
python: ''
target: azp/posix/2/
- ansible: '2.13'
docker: opensuse15py2
python: ''
target: azp/posix/3/
- ansible: '2.13'
docker: alpine3
python: ''
target: azp/posix/1/
- ansible: '2.13'
docker: alpine3
python: ''
target: azp/posix/2/
- ansible: '2.13'
docker: alpine3
python: ''
target: azp/posix/3/
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
# - ansible: '2.13'
# docker: default
# python: '3.9'
# target: azp/generic/1/
steps:
- name: >-

View File

@@ -24,13 +24,13 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: python
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3

20
.github/workflows/import-galaxy.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
name: import-galaxy
'on':
# Run CI against all pushes (direct commits, also merged PRs) to main, and all Pull Requests
push:
branches:
- main
- stable-*
pull_request:
jobs:
import-galaxy:
permissions:
contents: read
name: Test to import built collection artifact with Galaxy importer
uses: ansible-community/github-action-test-galaxy-import/.github/workflows/test-galaxy-import.yml@main

View File

@@ -22,14 +22,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || '' }}
- name: Install dependencies
run: |
pip install reuse
- name: Check REUSE compliance
run: |
reuse lint
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v2

View File

@@ -6,6 +6,249 @@ Community General Release Notes
This changelog describes changes after version 6.0.0.
v7.5.4
======
Release Summary
---------------
Regular bugfix release.
Bugfixes
--------
- homebrew - detect already installed formulae and casks using JSON output from ``brew info`` (https://github.com/ansible-collections/community.general/issues/864).
- ipa_otptoken - the module expect ``ipatokendisabled`` as string but the ``ipatokendisabled`` value is returned as a boolean (https://github.com/ansible-collections/community.general/pull/7795).
- ldap - previously the order number (if present) was expected to follow an equals sign in the DN. This makes it so the order number string is identified correctly anywhere within the DN (https://github.com/ansible-collections/community.general/issues/7646).
- mssql_script - make the module work with Python 2 (https://github.com/ansible-collections/community.general/issues/7818, https://github.com/ansible-collections/community.general/pull/7821).
- nmcli - fix ``connection.slave-type`` wired to ``bond`` and not with parameter ``slave_type`` in case of connection type ``wifi`` (https://github.com/ansible-collections/community.general/issues/7389).
v7.5.3
======
Release Summary
---------------
Regular bugfix release.
Bugfixes
--------
- keycloak_identity_provider - ``mappers`` processing was not idempotent if the mappers configuration list had not been sorted by name (in ascending order). Fix resolves the issue by sorting mappers in the desired state using the same key which is used for obtaining existing state (https://github.com/ansible-collections/community.general/pull/7418).
- keycloak_identity_provider - it was not possible to reconfigure (add, remove) ``mappers`` once they were created initially. Removal was ignored, adding new ones resulted in dropping the pre-existing unmodified mappers. Fix resolves the issue by supplying correct input to the internal update call (https://github.com/ansible-collections/community.general/pull/7418).
- keycloak_user - when ``force`` is set, but user does not exist, do not try to delete it (https://github.com/ansible-collections/community.general/pull/7696).
- statusio_maintenance - fix error caused by incorrectly formed API data payload. Was raising "Failed to create maintenance HTTP Error 400 Bad Request" caused by bad data type for date/time and deprecated dict keys (https://github.com/ansible-collections/community.general/pull/7754).
v7.5.2
======
Release Summary
---------------
Regular bugfix release.
Minor Changes
-------------
- elastic callback plugin - close elastic client to not leak resources (https://github.com/ansible-collections/community.general/pull/7517).
Bugfixes
--------
- cloudflare_dns - fix Cloudflare lookup of SHFP records (https://github.com/ansible-collections/community.general/issues/7652).
- interface_files - also consider ``address_family`` when changing ``option=method`` (https://github.com/ansible-collections/community.general/issues/7610, https://github.com/ansible-collections/community.general/pull/7612).
- irc - replace ``ssl.wrap_socket`` that was removed from Python 3.12 with code for creating a proper SSL context (https://github.com/ansible-collections/community.general/pull/7542).
- keycloak_* - fix Keycloak API client to quote ``/`` properly (https://github.com/ansible-collections/community.general/pull/7641).
- keycloak_authz_permission - resource payload variable for scope-based permission was constructed as a string, when it needs to be a list, even for a single item (https://github.com/ansible-collections/community.general/issues/7151).
- log_entries callback plugin - replace ``ssl.wrap_socket`` that was removed from Python 3.12 with code for creating a proper SSL context (https://github.com/ansible-collections/community.general/pull/7542).
- lvol - test for output messages in both ``stdout`` and ``stderr`` (https://github.com/ansible-collections/community.general/pull/7601, https://github.com/ansible-collections/community.general/issues/7182).
- ocapi_utils, oci_utils, redfish_utils module utils - replace ``type()`` calls with ``isinstance()`` calls (https://github.com/ansible-collections/community.general/pull/7501).
- onepassword lookup plugin - field and section titles are now case insensitive when using op CLI version two or later. This matches the behavior of version one (https://github.com/ansible-collections/community.general/pull/7564).
- pipx module utils - change the CLI argument formatter for the ``pip_args`` parameter (https://github.com/ansible-collections/community.general/issues/7497, https://github.com/ansible-collections/community.general/pull/7506).
- redhat_subscription - use the D-Bus registration on RHEL 7 only on 7.4 and
greater; older versions of RHEL 7 do not have it
(https://github.com/ansible-collections/community.general/issues/7622,
https://github.com/ansible-collections/community.general/pull/7624).
- terraform - fix multiline string handling in complex variables (https://github.com/ansible-collections/community.general/pull/7535).
v7.5.1
======
Release Summary
---------------
Regular bugfix release.
Bugfixes
--------
- composer - fix impossible to run ``working_dir`` dependent commands. The module was throwing an error when trying to run a ``working_dir`` dependent command, because it tried to get the command help without passing the ``working_dir`` (https://github.com/ansible-collections/community.general/issues/3787).
- github_deploy_key - fix pagination behaviour causing a crash when only a single page of deploy keys exist (https://github.com/ansible-collections/community.general/pull/7375).
- gitlab_group_members - fix gitlab constants call in ``gitlab_group_members`` module (https://github.com/ansible-collections/community.general/issues/7467).
- gitlab_project_members - fix gitlab constants call in ``gitlab_project_members`` module (https://github.com/ansible-collections/community.general/issues/7467).
- gitlab_protected_branches - fix gitlab constants call in ``gitlab_protected_branches`` module (https://github.com/ansible-collections/community.general/issues/7467).
- gitlab_user - fix gitlab constants call in ``gitlab_user`` module (https://github.com/ansible-collections/community.general/issues/7467).
- kernel_blacklist - simplified the mechanism to update the file, fixing the error (https://github.com/ansible-collections/community.general/pull/7382, https://github.com/ansible-collections/community.general/issues/7362).
- memset module utils - make compatible with ansible-core 2.17 (https://github.com/ansible-collections/community.general/pull/7379).
- proxmox_pool_member - absent state for type VM did not delete VMs from the pools (https://github.com/ansible-collections/community.general/pull/7464).
- redfish_command - fix usage of message parsing in ``SimpleUpdate`` and ``MultipartHTTPPushUpdate`` commands to treat the lack of a ``MessageId`` as no message (https://github.com/ansible-collections/community.general/issues/7465, https://github.com/ansible-collections/community.general/pull/7471).
- redhat_subscription - use the right D-Bus options for the consumer type when
registering a RHEL system older than 9 or a RHEL 9 system older than 9.2
and using ``consumer_type``
(https://github.com/ansible-collections/community.general/pull/7378).
- selective callback plugin - fix length of task name lines in output always being 3 characters longer than desired (https://github.com/ansible-collections/community.general/pull/7374).
v7.5.0
======
Release Summary
---------------
Regular bugfix and feature release.
Please note that this is the last minor 7.x.0 release. Further releases
with major version 7 will be bugfix releases 7.5.y.
Minor Changes
-------------
- cargo - add option ``executable``, which allows user to specify path to the cargo binary (https://github.com/ansible-collections/community.general/pull/7352).
- cargo - add option ``locked`` which allows user to specify install the locked version of dependency instead of latest compatible version (https://github.com/ansible-collections/community.general/pull/6134).
- dig lookup plugin - add TCP option to enable the use of TCP connection during DNS lookup (https://github.com/ansible-collections/community.general/pull/7343).
- gitlab_group - add option ``force_delete`` (default: false) which allows delete group even if projects exists in it (https://github.com/ansible-collections/community.general/pull/7364).
- ini_file - add ``ignore_spaces`` option (https://github.com/ansible-collections/community.general/pull/7273).
- newrelic_deployment - add option ``app_name_exact_match``, which filters results for the exact app_name provided (https://github.com/ansible-collections/community.general/pull/7355).
- onepassword lookup plugin - introduce ``account_id`` option which allows specifying which account to use (https://github.com/ansible-collections/community.general/pull/7308).
- onepassword_raw lookup plugin - introduce ``account_id`` option which allows specifying which account to use (https://github.com/ansible-collections/community.general/pull/7308).
- parted - on resize, use ``--fix`` option if available (https://github.com/ansible-collections/community.general/pull/7304).
- pnpm - set correct version when state is latest or version is not mentioned. Resolves previous idempotency problem (https://github.com/ansible-collections/community.general/pull/7339).
- proxmox - add ``vmid`` (and ``taskid`` when possible) to return values (https://github.com/ansible-collections/community.general/pull/7263).
- random_string - added new ``ignore_similar_chars`` and ``similar_chars`` option to ignore certain chars (https://github.com/ansible-collections/community.general/pull/7242).
- redfish_command - add new option ``update_oem_params`` for the ``MultipartHTTPPushUpdate`` command (https://github.com/ansible-collections/community.general/issues/7331).
- redfish_config - add ``CreateVolume`` command to allow creation of volumes on servers (https://github.com/ansible-collections/community.general/pull/6813).
- redfish_config - adding ``SetSecureBoot`` command (https://github.com/ansible-collections/community.general/pull/7129).
- redfish_info - add support for ``GetBiosRegistries`` command (https://github.com/ansible-collections/community.general/pull/7144).
- redfish_info - adds ``LinkStatus`` to NIC inventory (https://github.com/ansible-collections/community.general/pull/7318).
- redis_info - refactor the redis_info module to use the redis module_utils enabling to pass TLS parameters to the Redis client (https://github.com/ansible-collections/community.general/pull/7267).
- supervisorctl - allow to stop matching running processes before removing them with ``stop_before_removing=true`` (https://github.com/ansible-collections/community.general/pull/7284).
Deprecated Features
-------------------
- The next major release, community.general 8.0.0, will drop support for ansible-core 2.11 and 2.12, which have been End of Life for some time now. This means that this collection no longer supports Python 2.6 on the target. Individual content might still work with unsupported ansible-core versions, but that can change at any time. Also please note that from now on, for every new major community.general release, we will drop support for all ansible-core versions that have been End of Life for more than a few weeks on the date of the major release (https://github.com/ansible-community/community-topics/discussions/271, https://github.com/ansible-collections/community.general/pull/7259).
- redfish_info, redfish_config, redfish_command - the default value ``10`` for the ``timeout`` option is deprecated and will change to ``60`` in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/7295).
Bugfixes
--------
- gitlab_group_variable - deleted all variables when used with ``purge=true`` due to missing ``raw`` property in KNOWN attributes (https://github.com/ansible-collections/community.general/issues/7250).
- gitlab_project_variable - deleted all variables when used with ``purge=true`` due to missing ``raw`` property in KNOWN attributes (https://github.com/ansible-collections/community.general/issues/7250).
- ldap_search - fix string normalization and the ``base64_attributes`` option on Python 3 (https://github.com/ansible-collections/community.general/issues/5704, https://github.com/ansible-collections/community.general/pull/7264).
- lxc connection plugin - properly evaluate options (https://github.com/ansible-collections/community.general/pull/7369).
- mail - skip headers containing equals characters due to missing ``maxsplit`` on header key/value parsing (https://github.com/ansible-collections/community.general/pull/7303).
- nmap inventory plugin - fix ``get_option`` calls (https://github.com/ansible-collections/community.general/pull/7323).
- onepassword - fix KeyError exception when trying to access value of a field that is not filled out in OnePassword item (https://github.com/ansible-collections/community.general/pull/7241).
- snap - change the change detection mechanism from "parsing installation" to "comparing end state with initial state" (https://github.com/ansible-collections/community.general/pull/7340, https://github.com/ansible-collections/community.general/issues/7265).
- terraform - prevents ``-backend-config`` option double encapsulating with ``shlex_quote`` function. (https://github.com/ansible-collections/community.general/pull/7301).
New Modules
-----------
- consul_role - Manipulate Consul roles
- gio_mime - Set default handler for MIME type, for applications using Gnome GIO
- keycloak_authz_custom_policy - Allows administration of Keycloak client custom Javascript policies via Keycloak API
- keycloak_realm_key - Allows administration of Keycloak realm keys via Keycloak API
- simpleinit_msb - Manage services on Source Mage GNU/Linux
v7.4.0
======
Release Summary
---------------
Bugfix and feature release.
Minor Changes
-------------
- cobbler inventory plugin - add ``exclude_mgmt_classes`` and ``include_mgmt_classes`` options to exclude or include hosts based on management classes (https://github.com/ansible-collections/community.general/pull/7184).
- cpanm - minor refactor when creating the ``CmdRunner`` object (https://github.com/ansible-collections/community.general/pull/7231).
- gitlab_group_variable - add support for ``raw`` variables suboption (https://github.com/ansible-collections/community.general/pull/7132).
- gitlab_project_variable - add support for ``raw`` variables suboption (https://github.com/ansible-collections/community.general/pull/7132).
- jenkins_build - add new ``detach`` option, which allows the module to exit successfully as long as the build is created (default functionality is still waiting for the build to end before exiting) (https://github.com/ansible-collections/community.general/pull/7204).
- jenkins_build - add new ``time_between_checks`` option, which allows to configure the wait time between requests to the Jenkins server (https://github.com/ansible-collections/community.general/pull/7204).
- make - allows ``params`` to be used without value (https://github.com/ansible-collections/community.general/pull/7180).
- nmap inventory plugin - now has a ``use_arp_ping`` option to allow the user to disable the default ARP ping query for a more reliable form (https://github.com/ansible-collections/community.general/pull/7119).
- pagerduty - adds in option to use v2 API for creating pagerduty incidents (https://github.com/ansible-collections/community.general/issues/6151)
- pritunl module utils - ensure ``validate_certs`` parameter is honoured in all methods (https://github.com/ansible-collections/community.general/pull/7156).
- redfish_info - report ``Id`` in the output of ``GetManagerInventory`` (https://github.com/ansible-collections/community.general/pull/7140).
- redfish_utils module utils - support ``Volumes`` in response for ``GetDiskInventory`` (https://github.com/ansible-collections/community.general/pull/6819).
- unixy callback plugin - add support for ``check_mode_markers`` option (https://github.com/ansible-collections/community.general/pull/7179).
Bugfixes
--------
- CmdRunner module utils - does not attempt to resolve path if executable is a relative or absolute path (https://github.com/ansible-collections/community.general/pull/7200).
- nmap inventory plugin - now uses ``get_option`` in all cases to get its configuration information (https://github.com/ansible-collections/community.general/pull/7119).
- nsupdate - fix a possible ``list index out of range`` exception (https://github.com/ansible-collections/community.general/issues/836).
- oci_utils module util - fix inappropriate logical comparison expressions and makes them simpler. The previous checks had logical short circuits (https://github.com/ansible-collections/community.general/pull/7125).
- pritunl module utils - fix incorrect URL parameter for orgnization add method (https://github.com/ansible-collections/community.general/pull/7161).
- snap - an exception was being raised when snap list was empty (https://github.com/ansible-collections/community.general/pull/7124, https://github.com/ansible-collections/community.general/issues/7120).
New Modules
-----------
- jenkins_build_info - Get information about Jenkins builds
- pnpm - Manage node.js packages with pnpm
v7.3.0
======
Release Summary
---------------
Feature and bugfix release.
Minor Changes
-------------
- chroot connection plugin - add ``disable_root_check`` option (https://github.com/ansible-collections/community.general/pull/7099).
- ejabberd_user - module now using ``CmdRunner`` to execute external command (https://github.com/ansible-collections/community.general/pull/7075).
- ipa_config - add module parameters to manage FreeIPA user and group objectclasses (https://github.com/ansible-collections/community.general/pull/7019).
- ipa_config - adds ``idp`` choice to ``ipauserauthtype`` parameter's choices (https://github.com/ansible-collections/community.general/pull/7051).
- npm - module now using ``CmdRunner`` to execute external commands (https://github.com/ansible-collections/community.general/pull/6989).
- proxmox_kvm - enabled force restart of VM, bringing the ``force`` parameter functionality in line with what is described in the docs (https://github.com/ansible-collections/community.general/pull/6914).
- proxmox_vm_info - ``node`` parameter is no longer required. Information can be obtained for the whole cluster (https://github.com/ansible-collections/community.general/pull/6976).
- proxmox_vm_info - non-existing provided by name/vmid VM would return empty results instead of failing (https://github.com/ansible-collections/community.general/pull/7049).
- redfish_config - add ``DeleteAllVolumes`` command to allow deletion of all volumes on servers (https://github.com/ansible-collections/community.general/pull/6814).
- redfish_utils - use ``Controllers`` key in redfish data to obtain Storage controllers properties (https://github.com/ansible-collections/community.general/pull/7081).
- redfish_utils module utils - add support for ``PowerCycle`` reset type for ``redfish_command`` responses feature (https://github.com/ansible-collections/community.general/issues/7083).
- redfish_utils module utils - add support for following ``@odata.nextLink`` pagination in ``software_inventory`` responses feature (https://github.com/ansible-collections/community.general/pull/7020).
- shutdown - use ``shutdown -p ...`` with FreeBSD to halt and power off machine (https://github.com/ansible-collections/community.general/pull/7102).
- sorcery - add grimoire (repository) management support (https://github.com/ansible-collections/community.general/pull/7012).
Deprecated Features
-------------------
- ejabberd_user - deprecate the parameter ``logging`` in favour of producing more detailed information in the module output (https://github.com/ansible-collections/community.general/pull/7043).
Bugfixes
--------
- bitwarden lookup plugin - the plugin made assumptions about the structure of a Bitwarden JSON object which may have been broken by an update in the Bitwarden API. Remove assumptions, and allow queries for general fields such as ``notes`` (https://github.com/ansible-collections/community.general/pull/7061).
- ejabberd_user - module was failing to detect whether user was already created and/or password was changed (https://github.com/ansible-collections/community.general/pull/7033).
- keycloak module util - fix missing ``http_agent``, ``timeout``, and ``validate_certs`` ``open_url()`` parameters (https://github.com/ansible-collections/community.general/pull/7067).
- keycloak_client inventory plugin - fix missing client secret (https://github.com/ansible-collections/community.general/pull/6931).
- lvol - add support for percentage of origin size specification when creating snapshot volumes (https://github.com/ansible-collections/community.general/issues/1630, https://github.com/ansible-collections/community.general/pull/7053).
- lxc connection plugin - now handles ``remote_addr`` defaulting to ``inventory_hostname`` correctly (https://github.com/ansible-collections/community.general/pull/7104).
- oci_utils module utils - avoid direct type comparisons (https://github.com/ansible-collections/community.general/pull/7085).
- proxmox_user_info - avoid direct type comparisons (https://github.com/ansible-collections/community.general/pull/7085).
- snap - fix crash when multiple snaps are specified and one has ``---`` in its description (https://github.com/ansible-collections/community.general/pull/7046).
- sorcery - fix interruption of the multi-stage process (https://github.com/ansible-collections/community.general/pull/7012).
- sorcery - fix queue generation before the whole system rebuild (https://github.com/ansible-collections/community.general/pull/7012).
- sorcery - latest state no longer triggers update_cache (https://github.com/ansible-collections/community.general/pull/7012).
v7.2.1
======
@@ -422,7 +665,7 @@ Deprecated Features
we have not heard about anyone using them in those setups. Hence, these
modules are deprecated, and will be removed in community.general 10.0.0
in case there are no reports about being still useful, and potentially
noone that steps up to maintain them
no one that steps up to maintain them
(https://github.com/ansible-collections/community.general/pull/6493).
Removed Features (previously deprecated)

View File

@@ -24,7 +24,7 @@ If you encounter abusive behavior violating the [Ansible Code of Conduct](https:
## Tested with Ansible
Tested with the current ansible-core 2.11, ansible-core 2.12, ansible-core 2.13, ansible-core 2.14, ansible-core 2.15 releases and the current development version of ansible-core. Ansible-core versions before 2.11.0 are not supported. This includes all ansible-base 2.10 and Ansible 2.9 releases.
Tested with the current ansible-core 2.11, ansible-core 2.12, ansible-core 2.13, ansible-core 2.14, ansible-core 2.15, ansible-core 2.16 releases and the current development version of ansible-core. Ansible-core versions before 2.11.0 are not supported. This includes all ansible-base 2.10 and Ansible 2.9 releases.
Parts of this collection will not work with ansible-core 2.11 on Python 3.12+.
@@ -34,13 +34,13 @@ Some modules and plugins require external libraries. Please check the requiremen
## Included content
Please check the included content on the [Ansible Galaxy page for this collection](https://galaxy.ansible.com/community/general) or the [documentation on the Ansible docs site](https://docs.ansible.com/ansible/latest/collections/community/general/).
Please check the included content on the [Ansible Galaxy page for this collection](https://galaxy.ansible.com/ui/repo/published/community/general/) or the [documentation on the Ansible docs site](https://docs.ansible.com/ansible/latest/collections/community/general/).
## Using this collection
This collection is shipped with the Ansible package. So if you have it installed, no more action is required.
If you have a minimal installation (only Ansible Core installed) or you want to use the latest version of the collection along with the whole Ansible package, you need to install the collection from [Ansible Galaxy](https://galaxy.ansible.com/community/general) manually with the `ansible-galaxy` command-line tool:
If you have a minimal installation (only Ansible Core installed) or you want to use the latest version of the collection along with the whole Ansible package, you need to install the collection from [Ansible Galaxy](https://galaxy.ansible.com/ui/repo/published/community/general/) manually with the `ansible-galaxy` command-line tool:
ansible-galaxy collection install community.general
@@ -57,7 +57,7 @@ Note that if you install the collection manually, it will not be upgraded automa
ansible-galaxy collection install community.general --upgrade
```
You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax where `X.Y.Z` can be any [available version](https://galaxy.ansible.com/community/general):
You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax where `X.Y.Z` can be any [available version](https://galaxy.ansible.com/ui/repo/published/community/general/):
```bash
ansible-galaxy collection install community.general:==X.Y.Z

View File

@@ -331,7 +331,7 @@ releases:
in case there are no reports about being still useful, and potentially
noone that steps up to maintain them
no one that steps up to maintain them
(https://github.com/ansible-collections/community.general/pull/6493).
@@ -1295,3 +1295,416 @@ releases:
- 6983-rundeck-fix-typerrror-on-404-api-response.yml
- 7.2.1.yml
release_date: '2023-07-31'
7.3.0:
changes:
bugfixes:
- bitwarden lookup plugin - the plugin made assumptions about the structure
of a Bitwarden JSON object which may have been broken by an update in the
Bitwarden API. Remove assumptions, and allow queries for general fields such
as ``notes`` (https://github.com/ansible-collections/community.general/pull/7061).
- ejabberd_user - module was failing to detect whether user was already created
and/or password was changed (https://github.com/ansible-collections/community.general/pull/7033).
- keycloak module util - fix missing ``http_agent``, ``timeout``, and ``validate_certs``
``open_url()`` parameters (https://github.com/ansible-collections/community.general/pull/7067).
- keycloak_client inventory plugin - fix missing client secret (https://github.com/ansible-collections/community.general/pull/6931).
- lvol - add support for percentage of origin size specification when creating
snapshot volumes (https://github.com/ansible-collections/community.general/issues/1630,
https://github.com/ansible-collections/community.general/pull/7053).
- lxc connection plugin - now handles ``remote_addr`` defaulting to ``inventory_hostname``
correctly (https://github.com/ansible-collections/community.general/pull/7104).
- oci_utils module utils - avoid direct type comparisons (https://github.com/ansible-collections/community.general/pull/7085).
- proxmox_user_info - avoid direct type comparisons (https://github.com/ansible-collections/community.general/pull/7085).
- snap - fix crash when multiple snaps are specified and one has ``---`` in
its description (https://github.com/ansible-collections/community.general/pull/7046).
- sorcery - fix interruption of the multi-stage process (https://github.com/ansible-collections/community.general/pull/7012).
- sorcery - fix queue generation before the whole system rebuild (https://github.com/ansible-collections/community.general/pull/7012).
- sorcery - latest state no longer triggers update_cache (https://github.com/ansible-collections/community.general/pull/7012).
deprecated_features:
- ejabberd_user - deprecate the parameter ``logging`` in favour of producing
more detailed information in the module output (https://github.com/ansible-collections/community.general/pull/7043).
minor_changes:
- chroot connection plugin - add ``disable_root_check`` option (https://github.com/ansible-collections/community.general/pull/7099).
- ejabberd_user - module now using ``CmdRunner`` to execute external command
(https://github.com/ansible-collections/community.general/pull/7075).
- ipa_config - add module parameters to manage FreeIPA user and group objectclasses
(https://github.com/ansible-collections/community.general/pull/7019).
- ipa_config - adds ``idp`` choice to ``ipauserauthtype`` parameter's choices
(https://github.com/ansible-collections/community.general/pull/7051).
- npm - module now using ``CmdRunner`` to execute external commands (https://github.com/ansible-collections/community.general/pull/6989).
- proxmox_kvm - enabled force restart of VM, bringing the ``force`` parameter
functionality in line with what is described in the docs (https://github.com/ansible-collections/community.general/pull/6914).
- proxmox_vm_info - ``node`` parameter is no longer required. Information can
be obtained for the whole cluster (https://github.com/ansible-collections/community.general/pull/6976).
- proxmox_vm_info - non-existing provided by name/vmid VM would return empty
results instead of failing (https://github.com/ansible-collections/community.general/pull/7049).
- redfish_config - add ``DeleteAllVolumes`` command to allow deletion of all
volumes on servers (https://github.com/ansible-collections/community.general/pull/6814).
- redfish_utils - use ``Controllers`` key in redfish data to obtain Storage
controllers properties (https://github.com/ansible-collections/community.general/pull/7081).
- redfish_utils module utils - add support for ``PowerCycle`` reset type for
``redfish_command`` responses feature (https://github.com/ansible-collections/community.general/issues/7083).
- redfish_utils module utils - add support for following ``@odata.nextLink``
pagination in ``software_inventory`` responses feature (https://github.com/ansible-collections/community.general/pull/7020).
- shutdown - use ``shutdown -p ...`` with FreeBSD to halt and power off machine
(https://github.com/ansible-collections/community.general/pull/7102).
- sorcery - add grimoire (repository) management support (https://github.com/ansible-collections/community.general/pull/7012).
release_summary: Feature and bugfix release.
fragments:
- 6814-redfish-config-add-delete-all-volumes.yml
- 6914-proxmox_kvm-enable-force-restart.yml
- 6931-keycloak_client-inventory-bugfix.yml
- 6976-proxmox-vm-info-not-require-node.yml
- 6989-npm-cmdrunner.yml
- 7.3.0.yml
- 7012-sorcery-grimoire-mgmt.yml
- 7019-ipa_config-user-and-group-objectclasses.yml
- 7020-redfish-utils-pagination.yml
- 7033-ejabberd-user-bugs.yml
- 7043-ejabberd-user-deprecate-logging.yml
- 7046-snap-newline-before-separator.yml
- 7049-proxmox-vm-info-empty-results.yml
- 7051-ipa-config-new-choice-idp-to-ipauserauthtype.yml
- 7061-fix-bitwarden-get_field.yml
- 7067-keycloak-api-paramerter-fix.yml
- 7075-ejabberd-user-cmdrunner.yml
- 7081-redfish-utils-fix-for-storagecontrollers-deprecated-key.yaml
- 7085-sanity.yml
- 7099-chroot-disable-root-check-option.yml
- 7102-freebsd-shutdown-p.yml
- 7104_fix_lxc_remoteaddr_default.yml
- 7113-redfish-utils-power-cycle.yml
- lvol-pct-of-origin.yml
release_date: '2023-08-15'
7.4.0:
changes:
bugfixes:
- CmdRunner module utils - does not attempt to resolve path if executable is
a relative or absolute path (https://github.com/ansible-collections/community.general/pull/7200).
- nmap inventory plugin - now uses ``get_option`` in all cases to get its configuration
information (https://github.com/ansible-collections/community.general/pull/7119).
- nsupdate - fix a possible ``list index out of range`` exception (https://github.com/ansible-collections/community.general/issues/836).
- oci_utils module util - fix inappropriate logical comparison expressions and
makes them simpler. The previous checks had logical short circuits (https://github.com/ansible-collections/community.general/pull/7125).
- pritunl module utils - fix incorrect URL parameter for orgnization add method
(https://github.com/ansible-collections/community.general/pull/7161).
- snap - an exception was being raised when snap list was empty (https://github.com/ansible-collections/community.general/pull/7124,
https://github.com/ansible-collections/community.general/issues/7120).
minor_changes:
- cobbler inventory plugin - add ``exclude_mgmt_classes`` and ``include_mgmt_classes``
options to exclude or include hosts based on management classes (https://github.com/ansible-collections/community.general/pull/7184).
- cpanm - minor refactor when creating the ``CmdRunner`` object (https://github.com/ansible-collections/community.general/pull/7231).
- gitlab_group_variable - add support for ``raw`` variables suboption (https://github.com/ansible-collections/community.general/pull/7132).
- gitlab_project_variable - add support for ``raw`` variables suboption (https://github.com/ansible-collections/community.general/pull/7132).
- jenkins_build - add new ``detach`` option, which allows the module to exit
successfully as long as the build is created (default functionality is still
waiting for the build to end before exiting) (https://github.com/ansible-collections/community.general/pull/7204).
- jenkins_build - add new ``time_between_checks`` option, which allows to configure
the wait time between requests to the Jenkins server (https://github.com/ansible-collections/community.general/pull/7204).
- make - allows ``params`` to be used without value (https://github.com/ansible-collections/community.general/pull/7180).
- nmap inventory plugin - now has a ``use_arp_ping`` option to allow the user
to disable the default ARP ping query for a more reliable form (https://github.com/ansible-collections/community.general/pull/7119).
- pagerduty - adds in option to use v2 API for creating pagerduty incidents
(https://github.com/ansible-collections/community.general/issues/6151)
- pritunl module utils - ensure ``validate_certs`` parameter is honoured in
all methods (https://github.com/ansible-collections/community.general/pull/7156).
- redfish_info - report ``Id`` in the output of ``GetManagerInventory`` (https://github.com/ansible-collections/community.general/pull/7140).
- redfish_utils module utils - support ``Volumes`` in response for ``GetDiskInventory``
(https://github.com/ansible-collections/community.general/pull/6819).
- unixy callback plugin - add support for ``check_mode_markers`` option (https://github.com/ansible-collections/community.general/pull/7179).
release_summary: Bugfix and feature release.
fragments:
- 6819-redfish-utils-add-links-parameter-for-get_disk_inventory.yml
- 7.4.0.yml
- 7118-nmap_inv_plugin_no_arp_option.yml
- 7124-snap-empty-list.yml
- 7125-fix-inappropriate-comparison.yml
- 7132-gitlab-raw-variables.yml
- 7140-id-getmanagerinv-output.yml
- 7156-ensure-validate-certs-parameter-is-honoured.yml
- 7161-fix-incorrect-post-parameter.yml
- 7179-unixy-support-checkmode-markers.yml
- 7180-make_params_without_value.yml
- 7184-cobbler-mgmt-classes.yml
- 7200-cmd-runner-abs-path.yml
- 7219-fix-nsupdate-cname.yaml
- 7231-cpanm-adjustments.yml
- improvements-to-jenkins-build-module.yml
- update-v2-pagerduty-alert.yml
modules:
- description: Get information about Jenkins builds
name: jenkins_build_info
namespace: ''
- description: Manage node.js packages with pnpm
name: pnpm
namespace: ''
release_date: '2023-09-11'
7.5.0:
changes:
bugfixes:
- gitlab_group_variable - deleted all variables when used with ``purge=true``
due to missing ``raw`` property in KNOWN attributes (https://github.com/ansible-collections/community.general/issues/7250).
- gitlab_project_variable - deleted all variables when used with ``purge=true``
due to missing ``raw`` property in KNOWN attributes (https://github.com/ansible-collections/community.general/issues/7250).
- ldap_search - fix string normalization and the ``base64_attributes`` option
on Python 3 (https://github.com/ansible-collections/community.general/issues/5704,
https://github.com/ansible-collections/community.general/pull/7264).
- lxc connection plugin - properly evaluate options (https://github.com/ansible-collections/community.general/pull/7369).
- mail - skip headers containing equals characters due to missing ``maxsplit``
on header key/value parsing (https://github.com/ansible-collections/community.general/pull/7303).
- nmap inventory plugin - fix ``get_option`` calls (https://github.com/ansible-collections/community.general/pull/7323).
- onepassword - fix KeyError exception when trying to access value of a field
that is not filled out in OnePassword item (https://github.com/ansible-collections/community.general/pull/7241).
- snap - change the change detection mechanism from "parsing installation" to
"comparing end state with initial state" (https://github.com/ansible-collections/community.general/pull/7340,
https://github.com/ansible-collections/community.general/issues/7265).
- terraform - prevents ``-backend-config`` option double encapsulating with
``shlex_quote`` function. (https://github.com/ansible-collections/community.general/pull/7301).
deprecated_features:
- The next major release, community.general 8.0.0, will drop support for ansible-core
2.11 and 2.12, which have been End of Life for some time now. This means that
this collection no longer supports Python 2.6 on the target. Individual content
might still work with unsupported ansible-core versions, but that can change
at any time. Also please note that from now on, for every new major community.general
release, we will drop support for all ansible-core versions that have been
End of Life for more than a few weeks on the date of the major release (https://github.com/ansible-community/community-topics/discussions/271,
https://github.com/ansible-collections/community.general/pull/7259).
- redfish_info, redfish_config, redfish_command - the default value ``10`` for
the ``timeout`` option is deprecated and will change to ``60`` in community.general
9.0.0 (https://github.com/ansible-collections/community.general/pull/7295).
minor_changes:
- cargo - add option ``executable``, which allows user to specify path to the
cargo binary (https://github.com/ansible-collections/community.general/pull/7352).
- cargo - add option ``locked`` which allows user to specify install the locked
version of dependency instead of latest compatible version (https://github.com/ansible-collections/community.general/pull/6134).
- dig lookup plugin - add TCP option to enable the use of TCP connection during
DNS lookup (https://github.com/ansible-collections/community.general/pull/7343).
- 'gitlab_group - add option ``force_delete`` (default: false) which allows
delete group even if projects exists in it (https://github.com/ansible-collections/community.general/pull/7364).'
- ini_file - add ``ignore_spaces`` option (https://github.com/ansible-collections/community.general/pull/7273).
- newrelic_deployment - add option ``app_name_exact_match``, which filters results
for the exact app_name provided (https://github.com/ansible-collections/community.general/pull/7355).
- onepassword lookup plugin - introduce ``account_id`` option which allows specifying
which account to use (https://github.com/ansible-collections/community.general/pull/7308).
- onepassword_raw lookup plugin - introduce ``account_id`` option which allows
specifying which account to use (https://github.com/ansible-collections/community.general/pull/7308).
- parted - on resize, use ``--fix`` option if available (https://github.com/ansible-collections/community.general/pull/7304).
- pnpm - set correct version when state is latest or version is not mentioned.
Resolves previous idempotency problem (https://github.com/ansible-collections/community.general/pull/7339).
- proxmox - add ``vmid`` (and ``taskid`` when possible) to return values (https://github.com/ansible-collections/community.general/pull/7263).
- random_string - added new ``ignore_similar_chars`` and ``similar_chars`` option
to ignore certain chars (https://github.com/ansible-collections/community.general/pull/7242).
- redfish_command - add new option ``update_oem_params`` for the ``MultipartHTTPPushUpdate``
command (https://github.com/ansible-collections/community.general/issues/7331).
- redfish_config - add ``CreateVolume`` command to allow creation of volumes
on servers (https://github.com/ansible-collections/community.general/pull/6813).
- redfish_config - adding ``SetSecureBoot`` command (https://github.com/ansible-collections/community.general/pull/7129).
- redfish_info - add support for ``GetBiosRegistries`` command (https://github.com/ansible-collections/community.general/pull/7144).
- redfish_info - adds ``LinkStatus`` to NIC inventory (https://github.com/ansible-collections/community.general/pull/7318).
- redis_info - refactor the redis_info module to use the redis module_utils
enabling to pass TLS parameters to the Redis client (https://github.com/ansible-collections/community.general/pull/7267).
- supervisorctl - allow to stop matching running processes before removing them
with ``stop_before_removing=true`` (https://github.com/ansible-collections/community.general/pull/7284).
release_summary: 'Regular bugfix and feature release.
Please note that this is the last minor 7.x.0 release. Further releases
with major version 7 will be bugfix releases 7.5.y.
'
fragments:
- 6134-add-locked-option-for-cargo.yml
- 6813-redfish-config-add-create-volume.yml
- 7.5.0.yml
- 7129-adding_set_secure_boot_command_to_redfish_config.yml
- 7144-add-getbiosregistry-command-to-redfish-info.yml
- 7241-prevent-key-error-when-value-does-not-exist.yml
- 7242_ignore_similar_chars.yml
- 7251-gitlab-variables-deleteing-all-variables.yml
- 7263-proxmox-return-vmid-and-taskid.yaml
- 7264-ldap_search-strings.yml
- 7267-redis_info.yml
- 7273-ini_file_ignore_spaces.yml
- 7284-supervisorctl-stop-before-remove.yaml
- 7295-adding_deprecation_for_timeout_in_redfish_info_config_command.yml
- 7301-fix-backend-config-string-encapsulation.yml
- 7303-mail-incorrect-header-parsing.yml
- 7304-prevent-parted-warnings.yml
- 7308-onepassword-multi-acc.yml
- 7318-add-linkstatus-attribute-to-nic-inventory.yml
- 7323-nmap.yml
- 7330-redfish-utils-oem-params.yml
- 7339-pnpm-correct-version-when-state-latest.yml
- 7340-snap-fix.yml
- 7343-dig-tcp-option.yml
- 7352-add-executable-option-for-cargo.yml
- 7355-newrelic-deployment-add-exact-name.yml
- 7364-add-option-force-gitlab-group.yml
- 7369-fix-lxc-options.yml
- deprecate-ansible-core-2.11-2.12.yml
modules:
- description: Manipulate Consul roles
name: consul_role
namespace: ''
- description: Set default handler for MIME type, for applications using Gnome
GIO
name: gio_mime
namespace: ''
- description: Allows administration of Keycloak client custom Javascript policies
via Keycloak API
name: keycloak_authz_custom_policy
namespace: ''
- description: Allows administration of Keycloak realm keys via Keycloak API
name: keycloak_realm_key
namespace: ''
- description: Manage services on Source Mage GNU/Linux
name: simpleinit_msb
namespace: ''
release_date: '2023-10-09'
7.5.1:
changes:
bugfixes:
- composer - fix impossible to run ``working_dir`` dependent commands. The module
was throwing an error when trying to run a ``working_dir`` dependent command,
because it tried to get the command help without passing the ``working_dir``
(https://github.com/ansible-collections/community.general/issues/3787).
- github_deploy_key - fix pagination behaviour causing a crash when only a single
page of deploy keys exist (https://github.com/ansible-collections/community.general/pull/7375).
- gitlab_group_members - fix gitlab constants call in ``gitlab_group_members``
module (https://github.com/ansible-collections/community.general/issues/7467).
- gitlab_project_members - fix gitlab constants call in ``gitlab_project_members``
module (https://github.com/ansible-collections/community.general/issues/7467).
- gitlab_protected_branches - fix gitlab constants call in ``gitlab_protected_branches``
module (https://github.com/ansible-collections/community.general/issues/7467).
- gitlab_user - fix gitlab constants call in ``gitlab_user`` module (https://github.com/ansible-collections/community.general/issues/7467).
- kernel_blacklist - simplified the mechanism to update the file, fixing the
error (https://github.com/ansible-collections/community.general/pull/7382,
https://github.com/ansible-collections/community.general/issues/7362).
- memset module utils - make compatible with ansible-core 2.17 (https://github.com/ansible-collections/community.general/pull/7379).
- proxmox_pool_member - absent state for type VM did not delete VMs from the
pools (https://github.com/ansible-collections/community.general/pull/7464).
- redfish_command - fix usage of message parsing in ``SimpleUpdate`` and ``MultipartHTTPPushUpdate``
commands to treat the lack of a ``MessageId`` as no message (https://github.com/ansible-collections/community.general/issues/7465,
https://github.com/ansible-collections/community.general/pull/7471).
- 'redhat_subscription - use the right D-Bus options for the consumer type when
registering a RHEL system older than 9 or a RHEL 9 system older than 9.2
and using ``consumer_type``
(https://github.com/ansible-collections/community.general/pull/7378).
'
- selective callback plugin - fix length of task name lines in output always
being 3 characters longer than desired (https://github.com/ansible-collections/community.general/pull/7374).
release_summary: Regular bugfix release.
fragments:
- 3787-pass-composer-working-dir.yml
- 7.5.1.yml
- 7374-fix-selective-callback-taskname-length.yml
- 7375-fix-github-deploy-key-pagination.yml
- 7378-redhat_subscription-dbus-consumer-type.yaml
- 7379-url.yml
- 7382-kernel-blacklist-bugfix.yml
- 7464-fix-vm-removal-in-proxmox_pool_member.yml
- 7465-redfish-firmware-update-message-id-hardening.yml
- 7467-fix-gitlab-constants-calls.yml
release_date: '2023-11-06'
7.5.2:
changes:
bugfixes:
- cloudflare_dns - fix Cloudflare lookup of SHFP records (https://github.com/ansible-collections/community.general/issues/7652).
- interface_files - also consider ``address_family`` when changing ``option=method``
(https://github.com/ansible-collections/community.general/issues/7610, https://github.com/ansible-collections/community.general/pull/7612).
- irc - replace ``ssl.wrap_socket`` that was removed from Python 3.12 with code
for creating a proper SSL context (https://github.com/ansible-collections/community.general/pull/7542).
- keycloak_* - fix Keycloak API client to quote ``/`` properly (https://github.com/ansible-collections/community.general/pull/7641).
- keycloak_authz_permission - resource payload variable for scope-based permission
was constructed as a string, when it needs to be a list, even for a single
item (https://github.com/ansible-collections/community.general/issues/7151).
- log_entries callback plugin - replace ``ssl.wrap_socket`` that was removed
from Python 3.12 with code for creating a proper SSL context (https://github.com/ansible-collections/community.general/pull/7542).
- lvol - test for output messages in both ``stdout`` and ``stderr`` (https://github.com/ansible-collections/community.general/pull/7601,
https://github.com/ansible-collections/community.general/issues/7182).
- ocapi_utils, oci_utils, redfish_utils module utils - replace ``type()`` calls
with ``isinstance()`` calls (https://github.com/ansible-collections/community.general/pull/7501).
- onepassword lookup plugin - field and section titles are now case insensitive
when using op CLI version two or later. This matches the behavior of version
one (https://github.com/ansible-collections/community.general/pull/7564).
- pipx module utils - change the CLI argument formatter for the ``pip_args``
parameter (https://github.com/ansible-collections/community.general/issues/7497,
https://github.com/ansible-collections/community.general/pull/7506).
- 'redhat_subscription - use the D-Bus registration on RHEL 7 only on 7.4 and
greater; older versions of RHEL 7 do not have it
(https://github.com/ansible-collections/community.general/issues/7622,
https://github.com/ansible-collections/community.general/pull/7624).
'
- terraform - fix multiline string handling in complex variables (https://github.com/ansible-collections/community.general/pull/7535).
minor_changes:
- elastic callback plugin - close elastic client to not leak resources (https://github.com/ansible-collections/community.general/pull/7517).
release_summary: Regular bugfix release.
fragments:
- 000-redhat_subscription-dbus-on-7.4-plus.yaml
- 7.5.2.yml
- 7151-fix-keycloak_authz_permission-incorrect-resource-payload.yml
- 7501-type.yml
- 7506-pipx-pipargs.yml
- 7517-elastic-close-client.yaml
- 7535-terraform-fix-multiline-string-handling-in-complex-variables.yml
- 7542-irc-logentries-ssl.yml
- 7564-onepassword-lookup-case-insensitive.yaml
- 7601-lvol-fix.yml
- 7612-interface_file-method.yml
- 7641-fix-keycloak-api-client-to-quote-properly.yml
- 7653-fix-cloudflare-lookup.yml
release_date: '2023-12-04'
7.5.3:
changes:
bugfixes:
- keycloak_identity_provider - ``mappers`` processing was not idempotent if
the mappers configuration list had not been sorted by name (in ascending order).
Fix resolves the issue by sorting mappers in the desired state using the same
key which is used for obtaining existing state (https://github.com/ansible-collections/community.general/pull/7418).
- keycloak_identity_provider - it was not possible to reconfigure (add, remove)
``mappers`` once they were created initially. Removal was ignored, adding
new ones resulted in dropping the pre-existing unmodified mappers. Fix resolves
the issue by supplying correct input to the internal update call (https://github.com/ansible-collections/community.general/pull/7418).
- keycloak_user - when ``force`` is set, but user does not exist, do not try
to delete it (https://github.com/ansible-collections/community.general/pull/7696).
- statusio_maintenance - fix error caused by incorrectly formed API data payload.
Was raising "Failed to create maintenance HTTP Error 400 Bad Request" caused
by bad data type for date/time and deprecated dict keys (https://github.com/ansible-collections/community.general/pull/7754).
release_summary: Regular bugfix release.
fragments:
- 7.5.3.yml
- 7418-kc_identity_provider-mapper-reconfiguration-fixes.yml
- 7696-avoid-attempt-to-delete-non-existing-user.yml
- 7754-fixed-payload-format.yml
release_date: '2024-01-01'
7.5.4:
changes:
bugfixes:
- homebrew - detect already installed formulae and casks using JSON output from
``brew info`` (https://github.com/ansible-collections/community.general/issues/864).
- ipa_otptoken - the module expect ``ipatokendisabled`` as string but the ``ipatokendisabled``
value is returned as a boolean (https://github.com/ansible-collections/community.general/pull/7795).
- ldap - previously the order number (if present) was expected to follow an
equals sign in the DN. This makes it so the order number string is identified
correctly anywhere within the DN (https://github.com/ansible-collections/community.general/issues/7646).
- mssql_script - make the module work with Python 2 (https://github.com/ansible-collections/community.general/issues/7818,
https://github.com/ansible-collections/community.general/pull/7821).
- nmcli - fix ``connection.slave-type`` wired to ``bond`` and not with parameter
``slave_type`` in case of connection type ``wifi`` (https://github.com/ansible-collections/community.general/issues/7389).
release_summary: Regular bugfix release.
fragments:
- 7.5.4.yml
- 7389-nmcli-issue-with-creating-a-wifi-bridge-slave.yml
- 7646-fix-order-number-detection-in-dn.yml
- 7797-ipa-fix-otp-idempotency.yml
- 7821-mssql_script-py2.yml
- 7870-homebrew-cask-installed-detection.yml
release_date: '2024-01-29'

View File

@@ -6,7 +6,7 @@
Counting elements in a sequence
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The ``community.general.counter`` filter plugin allows you to count (hashable) elements in a sequence. Elements are returned as dictionary keys and their counts are stored as dictionary values.
The :ansplugin:`community.general.counter filter plugin <community.general.counter#filter>` allows you to count (hashable) elements in a sequence. Elements are returned as dictionary keys and their counts are stored as dictionary values.
.. code-block:: yaml+jinja

View File

@@ -6,7 +6,7 @@
Dictionaries
^^^^^^^^^^^^
You can use the ``dict_kv`` filter to create a single-entry dictionary with ``value | community.general.dict_kv(key)``:
You can use the :ansplugin:`community.general.dict_kv filter <community.general.dict_kv#filter>` to create a single-entry dictionary with ``value | community.general.dict_kv(key)``:
.. code-block:: yaml+jinja
@@ -58,7 +58,7 @@ This produces:
.. versionadded:: 2.0.0
If you need to convert a list of key-value pairs to a dictionary, you can use the ``dict`` function. Unfortunately, this function cannot be used with ``map``. For this, the ``community.general.dict`` filter can be used:
If you need to convert a list of key-value pairs to a dictionary, you can use the ``dict`` function. Unfortunately, this function cannot be used with ``map``. For this, the :ansplugin:`community.general.dict filter <community.general.dict#filter>` can be used:
.. code-block:: yaml+jinja

View File

@@ -6,7 +6,7 @@
Grouping
^^^^^^^^
If you have a list of dictionaries, the Jinja2 ``groupby`` filter allows to group the list by an attribute. This results in a list of ``(grouper, list)`` namedtuples, where ``list`` contains all dictionaries where the selected attribute equals ``grouper``. If you know that for every ``grouper``, there will be a most one entry in that list, you can use the ``community.general.groupby_as_dict`` filter to convert the original list into a dictionary which maps ``grouper`` to the corresponding dictionary.
If you have a list of dictionaries, the Jinja2 ``groupby`` filter allows to group the list by an attribute. This results in a list of ``(grouper, list)`` namedtuples, where ``list`` contains all dictionaries where the selected attribute equals ``grouper``. If you know that for every ``grouper``, there will be a most one entry in that list, you can use the :ansplugin:`community.general.groupby_as_dict filter <community.general.groupby_as_dict#filter>` to convert the original list into a dictionary which maps ``grouper`` to the corresponding dictionary.
One example is ``ansible_facts.mounts``, which is a list of dictionaries where each has one ``device`` element to indicate the device which is mounted. Therefore, ``ansible_facts.mounts | community.general.groupby_as_dict('device')`` is a dictionary mapping a device to the mount information:

View File

@@ -6,7 +6,7 @@
Merging lists of dictionaries
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you have two or more lists of dictionaries and want to combine them into a list of merged dictionaries, where the dictionaries are merged by an attribute, you can use the ``lists_mergeby`` filter.
If you have two or more lists of dictionaries and want to combine them into a list of merged dictionaries, where the dictionaries are merged by an attribute, you can use the :ansplugin:`community.general.lists_mergeby filter <community.general.lists_mergeby#filter>`.
.. note:: The output of the examples in this section use the YAML callback plugin. Quoting: "Ansible output that can be quite a bit easier to read than the default JSON formatting." See :ref:`the documentation for the community.general.yaml callback plugin <ansible_collections.community.general.yaml_callback>`.
@@ -76,15 +76,15 @@ This produces the same result as in the previous example:
name: meh
The filter also accepts two optional parameters: ``recursive`` and ``list_merge``. These parameters are only supported when used with ansible-base 2.10 or ansible-core, but not with Ansible 2.9. This is available since community.general 4.4.0.
The filter also accepts two optional parameters: :ansopt:`community.general.lists_mergeby#filter:recursive` and :ansopt:`community.general.lists_mergeby#filter:list_merge`. This is available since community.general 4.4.0.
**recursive**
Is a boolean, default to ``False``. Should the ``community.general.lists_mergeby`` recursively merge nested hashes. Note: It does not depend on the value of the ``hash_behaviour`` setting in ``ansible.cfg``.
Is a boolean, default to ``false``. Should the :ansplugin:`community.general.lists_mergeby#filter` filter recursively merge nested hashes. Note: It does not depend on the value of the ``hash_behaviour`` setting in ``ansible.cfg``.
**list_merge**
Is a string, its possible values are ``replace`` (default), ``keep``, ``append``, ``prepend``, ``append_rp`` or ``prepend_rp``. It modifies the behaviour of ``community.general.lists_mergeby`` when the hashes to merge contain arrays/lists.
Is a string, its possible values are :ansval:`replace` (default), :ansval:`keep`, :ansval:`append`, :ansval:`prepend`, :ansval:`append_rp` or :ansval:`prepend_rp`. It modifies the behaviour of :ansplugin:`community.general.lists_mergeby#filter` when the hashes to merge contain arrays/lists.
The examples below set ``recursive=true`` and display the differences among all six options of ``list_merge``. Functionality of the parameters is exactly the same as in the filter ``combine``. See :ref:`Combining hashes/dictionaries <combine_filter>` to learn details about these options.
The examples below set :ansopt:`community.general.lists_mergeby#filter:recursive=true` and display the differences among all six options of :ansopt:`community.general.lists_mergeby#filter:list_merge`. Functionality of the parameters is exactly the same as in the filter :ansplugin:`ansible.builtin.combine#filter`. See :ref:`Combining hashes/dictionaries <combine_filter>` to learn details about these options.
Let us use the lists below in the following examples
@@ -110,7 +110,7 @@ Let us use the lists below in the following examples
- name: myname02
param01: [3, 4, 4, {key: value}]
Example ``list_merge=replace`` (default):
Example :ansopt:`community.general.lists_mergeby#filter:list_merge=replace` (default):
.. code-block:: yaml+jinja
@@ -137,7 +137,7 @@ This produces:
- 4
- key: value
Example ``list_merge=keep``:
Example :ansopt:`community.general.lists_mergeby#filter:list_merge=keep`:
.. code-block:: yaml+jinja
@@ -165,7 +165,7 @@ This produces:
- 2
- 3
Example ``list_merge=append``:
Example :ansopt:`community.general.lists_mergeby#filter:list_merge=append`:
.. code-block:: yaml+jinja
@@ -198,7 +198,7 @@ This produces:
- 4
- key: value
Example ``list_merge=prepend``:
Example :ansopt:`community.general.lists_mergeby#filter:list_merge=prepend`:
.. code-block:: yaml+jinja
@@ -231,7 +231,7 @@ This produces:
- 2
- 3
Example ``list_merge=append_rp``:
Example :ansopt:`community.general.lists_mergeby#filter:list_merge=append_rp`:
.. code-block:: yaml+jinja
@@ -263,7 +263,7 @@ This produces:
- 4
- key: value
Example ``list_merge=prepend_rp``:
Example :ansopt:`community.general.lists_mergeby#filter:list_merge=prepend_rp`:
.. code-block:: yaml+jinja

View File

@@ -9,7 +9,7 @@ Conversions
Parsing CSV files
^^^^^^^^^^^^^^^^^
Ansible offers the :ref:`community.general.read_csv module <ansible_collections.community.general.read_csv_module>` to read CSV files. Sometimes you need to convert strings to CSV files instead. For this, the ``from_csv`` filter exists.
Ansible offers the :ansplugin:`community.general.read_csv module <community.general.read_csv#module>` to read CSV files. Sometimes you need to convert strings to CSV files instead. For this, the :ansplugin:`community.general.from_csv filter <community.general.from_csv#filter>` exists.
.. code-block:: yaml+jinja
@@ -42,7 +42,7 @@ This produces:
]
}
The ``from_csv`` filter has several keyword arguments to control its behavior:
The :ansplugin:`community.general.from_csv filter <community.general.from_csv#filter>` has several keyword arguments to control its behavior:
:dialect: Dialect of the CSV file. Default is ``excel``. Other possible choices are ``excel-tab`` and ``unix``. If one of ``delimiter``, ``skipinitialspace`` or ``strict`` is specified, ``dialect`` is ignored.
:fieldnames: A set of column names to use. If not provided, the first line of the CSV is assumed to contain the column names.
@@ -55,7 +55,7 @@ The ``from_csv`` filter has several keyword arguments to control its behavior:
Converting to JSON
^^^^^^^^^^^^^^^^^^
`JC <https://pypi.org/project/jc/>`_ is a CLI tool and Python library which allows to interpret output of various CLI programs as JSON. It is also available as a filter in community.general. This filter needs the `jc Python library <https://pypi.org/project/jc/>`_ installed on the controller.
`JC <https://pypi.org/project/jc/>`_ is a CLI tool and Python library which allows to interpret output of various CLI programs as JSON. It is also available as a filter in community.general, called :ansplugin:`community.general.jc#filter`. This filter needs the `jc Python library <https://pypi.org/project/jc/>`_ installed on the controller.
.. code-block:: yaml+jinja

View File

@@ -11,7 +11,7 @@ The following filters allow to create identifiers.
Hashids
^^^^^^^
`Hashids <https://hashids.org/>`_ allow to convert sequences of integers to short unique string identifiers. This filter needs the `hashids Python library <https://pypi.org/project/hashids/>`_ installed on the controller.
`Hashids <https://hashids.org/>`_ allow to convert sequences of integers to short unique string identifiers. The :ansplugin:`community.general.hashids_encode#filter` and :ansplugin:`community.general.hashids_decode#filter` filters need the `hashids Python library <https://pypi.org/project/hashids/>`_ installed on the controller.
.. code-block:: yaml+jinja
@@ -52,7 +52,7 @@ The hashids filters accept keyword arguments to allow fine-tuning the hashids ge
Random MACs
^^^^^^^^^^^
You can use the ``random_mac`` filter to complete a partial `MAC address <https://en.wikipedia.org/wiki/MAC_address>`_ to a random 6-byte MAC address.
You can use the :ansplugin:`community.general.random_mac filter <community.general.random_mac#filter>` to complete a partial `MAC address <https://en.wikipedia.org/wiki/MAC_address>`_ to a random 6-byte MAC address.
.. code-block:: yaml+jinja

View File

@@ -6,14 +6,4 @@
Paths
-----
The ``path_join`` filter has been added in ansible-base 2.10. If you want to use this filter, but also need to support Ansible 2.9, you can use ``community.general``'s ``path_join`` shim, ``community.general.path_join``. This filter redirects to ``path_join`` for ansible-base 2.10 and ansible-core 2.11 or newer, and re-implements the filter for Ansible 2.9.
.. code-block:: yaml+jinja
# ansible-base 2.10 or newer:
path: {{ ('/etc', path, 'subdir', file) | path_join }}
# Also works with Ansible 2.9:
path: {{ ('/etc', path, 'subdir', file) | community.general.path_join }}
.. versionadded:: 3.0.0
The :ansplugin:`ansible.builtin.path_join filter <ansible.builtin.path_join#filter>` has been added in ansible-base 2.10. Community.general 3.0.0 and newer contains an alias ``community.general.path_join`` for this filter that could be used on Ansible 2.9 as well. Since community.general no longer supports Ansible 2.9, this is now a simple redirect to :ansplugin:`ansible.builtin.path_join filter <ansible.builtin.path_join#filter>`.

View File

@@ -8,7 +8,7 @@
Selecting JSON data: JSON queries
---------------------------------
To select a single element or a data subset from a complex data structure in JSON format (for example, Ansible facts), use the ``json_query`` filter. The ``json_query`` filter lets you query a complex JSON structure and iterate over it using a loop structure.
To select a single element or a data subset from a complex data structure in JSON format (for example, Ansible facts), use the :ansplugin:`community.general.json_query filter <community.general.json_query#filter>`. The :ansplugin:`community.general.json_query#filter` filter lets you query a complex JSON structure and iterate over it using a loop structure.
.. note:: You must manually install the **jmespath** dependency on the Ansible controller before using this filter. This filter is built upon **jmespath**, and you can use the same syntax. For examples, see `jmespath examples <http://jmespath.org/examples.html>`_.
@@ -146,4 +146,4 @@ To extract ports from all clusters with name containing 'server1':
vars:
server_name_query: "domain.server[?contains(name,'server1')].port"
.. note:: while using ``starts_with`` and ``contains``, you have to use `` to_json | from_json `` filter for correct parsing of data structure.
.. note:: while using ``starts_with`` and ``contains``, you have to use ``to_json | from_json`` filter for correct parsing of data structure.

View File

@@ -6,9 +6,9 @@
Working with times
------------------
The ``to_time_unit`` filter allows to convert times from a human-readable string to a unit. For example, ``'4h 30min 12second' | community.general.to_time_unit('hour')`` gives the number of hours that correspond to 4 hours, 30 minutes and 12 seconds.
The :ansplugin:`community.general.to_time_unit filter <community.general.to_time_unit#filter>` allows to convert times from a human-readable string to a unit. For example, ``'4h 30min 12second' | community.general.to_time_unit('hour')`` gives the number of hours that correspond to 4 hours, 30 minutes and 12 seconds.
There are shorthands to directly convert to various units, like ``to_hours``, ``to_minutes``, ``to_seconds``, and so on. The following table lists all units that can be used:
There are shorthands to directly convert to various units, like :ansplugin:`community.general.to_hours#filter`, :ansplugin:`community.general.to_minutes#filter`, :ansplugin:`community.general.to_seconds#filter`, and so on. The following table lists all units that can be used:
.. list-table:: Units
:widths: 25 25 25 25
@@ -21,37 +21,37 @@ There are shorthands to directly convert to various units, like ``to_hours``, ``
* - Millisecond
- 1/1000 second
- ``ms``, ``millisecond``, ``milliseconds``, ``msec``, ``msecs``, ``msecond``, ``mseconds``
- ``to_milliseconds``
- :ansplugin:`community.general.to_milliseconds#filter`
* - Second
- 1 second
- ``s``, ``sec``, ``secs``, ``second``, ``seconds``
- ``to_seconds``
- :ansplugin:`community.general.to_seconds#filter`
* - Minute
- 60 seconds
- ``m``, ``min``, ``mins``, ``minute``, ``minutes``
- ``to_minutes``
- :ansplugin:`community.general.to_minutes#filter`
* - Hour
- 60*60 seconds
- ``h``, ``hour``, ``hours``
- ``to_hours``
- :ansplugin:`community.general.to_hours#filter`
* - Day
- 24*60*60 seconds
- ``d``, ``day``, ``days``
- ``to_days``
- :ansplugin:`community.general.to_days#filter`
* - Week
- 7*24*60*60 seconds
- ``w``, ``week``, ``weeks``
- ``to_weeks``
- :ansplugin:`community.general.to_weeks#filter`
* - Month
- 30*24*60*60 seconds
- ``mo``, ``month``, ``months``
- ``to_months``
- :ansplugin:`community.general.to_months#filter`
* - Year
- 365*24*60*60 seconds
- ``y``, ``year``, ``years``
- ``to_years``
- :ansplugin:`community.general.to_years#filter`
Note that months and years are using a simplified representation: a month is 30 days, and a year is 365 days. If you need different definitions of months or years, you can pass them as keyword arguments. For example, if you want a year to be 365.25 days, and a month to be 30.5 days, you can write ``'11months 4' | community.general.to_years(year=365.25, month=30.5)``. These keyword arguments can be specified to ``to_time_unit`` and to all shorthand filters.
Note that months and years are using a simplified representation: a month is 30 days, and a year is 365 days. If you need different definitions of months or years, you can pass them as keyword arguments. For example, if you want a year to be 365.25 days, and a month to be 30.5 days, you can write ``'11months 4' | community.general.to_years(year=365.25, month=30.5)``. These keyword arguments can be specified to :ansplugin:`community.general.to_time_unit#filter` and to all shorthand filters.
.. code-block:: yaml+jinja

View File

@@ -6,9 +6,9 @@
Working with Unicode
---------------------
`Unicode <https://unicode.org/main.html>`_ makes it possible to produce two strings which may be visually equivalent, but are comprised of distinctly different characters/character sequences. To address this ``Unicode`` defines `normalization forms <https://unicode.org/reports/tr15/>`_ which avoid these distinctions by choosing a unique character sequence for a given visual representation.
`Unicode <https://unicode.org/main.html>`_ makes it possible to produce two strings which may be visually equivalent, but are comprised of distinctly different characters/character sequences. To address this Unicode defines `normalization forms <https://unicode.org/reports/tr15/>`_ which avoid these distinctions by choosing a unique character sequence for a given visual representation.
You can use the ``community.general.unicode_normalize`` filter to normalize ``Unicode`` strings within your playbooks.
You can use the :ansplugin:`community.general.unicode_normalize filter <community.general.unicode_normalize#filter>` to normalize Unicode strings within your playbooks.
.. code-block:: yaml+jinja
@@ -28,7 +28,7 @@ This produces:
"msg": true
}
The ``community.general.unicode_normalize`` filter accepts a keyword argument to select the ``Unicode`` form used to normalize the input string.
The :ansplugin:`community.general.unicode_normalize filter <community.general.unicode_normalize#filter>` accepts a keyword argument :ansopt:`community.general.unicode_normalize#filter:form` to select the Unicode form used to normalize the input string.
:form: One of ``'NFC'`` (default), ``'NFD'``, ``'NFKC'``, or ``'NFKD'``. See the `Unicode reference <https://unicode.org/reports/tr15/>`_ for more information.

View File

@@ -6,7 +6,7 @@
Working with versions
---------------------
If you need to sort a list of version numbers, the Jinja ``sort`` filter is problematic. Since it sorts lexicographically, ``2.10`` will come before ``2.9``. To treat version numbers correctly, you can use the ``version_sort`` filter:
If you need to sort a list of version numbers, the Jinja ``sort`` filter is problematic. Since it sorts lexicographically, ``2.10`` will come before ``2.9``. To treat version numbers correctly, you can use the :ansplugin:`community.general.version_sort filter <community.general.version_sort#filter>`:
.. code-block:: yaml+jinja

View File

@@ -15,7 +15,7 @@ The :ref:`community.general collection <plugins_in_community.general>` offers cu
Feature Tests
-------------
The ``a_module`` test allows to check whether a given string refers to an existing module or action plugin. This can be useful in roles, which can use this to ensure that required modules are present ahead of time.
The :ansplugin:`community.general.a_module test <community.general.a_module#test>` allows to check whether a given string refers to an existing module or action plugin. This can be useful in roles, which can use this to ensure that required modules are present ahead of time.
.. code-block:: yaml+jinja

View File

@@ -5,7 +5,7 @@
namespace: community
name: general
version: 7.2.1
version: 7.5.4
readme: README.md
authors:
- Ansible (https://github.com/ansible)

View File

@@ -44,7 +44,7 @@ class ActionModule(ActionBase):
def _async_result(self, async_status_args, task_vars, timeout):
'''
Retrieve results of the asynchonous task, and display them in place of
Retrieve results of the asynchronous task, and display them in place of
the async wrapper results (those with the ansible_job_id key).
'''
async_status = self._task.copy()

View File

@@ -45,7 +45,7 @@ class ActionModule(ActionBase):
SHUTDOWN_COMMAND_ARGS = {
'alpine': '',
'void': '-h +{delay_min} "{message}"',
'freebsd': '-h +{delay_sec}s "{message}"',
'freebsd': '-p +{delay_sec}s "{message}"',
'linux': DEFAULT_SHUTDOWN_COMMAND_ARGS,
'macosx': '-h +{delay_min} "{message}"',
'openbsd': '-h +{delay_min} "{message}"',

View File

@@ -150,7 +150,7 @@ class CacheModule(BaseCacheModule):
# format: "localhost:26379;localhost2:26379;0:changeme"
connections = uri.split(';')
connection_args = connections.pop(-1)
if len(connection_args) > 0: # hanle if no db nr is given
if len(connection_args) > 0: # handle if no db nr is given
connection_args = connection_args.split(':')
kw['db'] = connection_args.pop(0)
try:

View File

@@ -84,6 +84,7 @@ import time
import uuid
from collections import OrderedDict
from contextlib import closing
from os.path import basename
from ansible.errors import AnsibleError, AnsibleRuntimeError
@@ -201,24 +202,25 @@ class ElasticSource(object):
apm_cli = self.init_apm_client(apm_server_url, apm_service_name, apm_verify_server_cert, apm_secret_token, apm_api_key)
if apm_cli:
instrument() # Only call this once, as early as possible.
if traceparent:
parent = trace_parent_from_string(traceparent)
apm_cli.begin_transaction("Session", trace_parent=parent, start=parent_start_time)
else:
apm_cli.begin_transaction("Session", start=parent_start_time)
# Populate trace metadata attributes
if self.ansible_version is not None:
label(ansible_version=self.ansible_version)
label(ansible_session=self.session, ansible_host_name=self.host, ansible_host_user=self.user)
if self.ip_address is not None:
label(ansible_host_ip=self.ip_address)
with closing(apm_cli):
instrument() # Only call this once, as early as possible.
if traceparent:
parent = trace_parent_from_string(traceparent)
apm_cli.begin_transaction("Session", trace_parent=parent, start=parent_start_time)
else:
apm_cli.begin_transaction("Session", start=parent_start_time)
# Populate trace metadata attributes
if self.ansible_version is not None:
label(ansible_version=self.ansible_version)
label(ansible_session=self.session, ansible_host_name=self.host, ansible_host_user=self.user)
if self.ip_address is not None:
label(ansible_host_ip=self.ip_address)
for task_data in tasks:
for host_uuid, host_data in task_data.host_data.items():
self.create_span_data(apm_cli, task_data, host_data)
for task_data in tasks:
for host_uuid, host_data in task_data.host_data.items():
self.create_span_data(apm_cli, task_data, host_data)
apm_cli.end_transaction(name=__name__, result=status, duration=end_time - parent_start_time)
apm_cli.end_transaction(name=__name__, result=status, duration=end_time - parent_start_time)
def create_span_data(self, apm_cli, task_data, host_data):
""" create the span with the given TaskData and HostData """

View File

@@ -18,7 +18,7 @@ DOCUMENTATION = '''
requirements:
- whitelisting in configuration
- certifi (Python library)
- flatdict (Python library), if you want to use the 'flatten' option
- flatdict (Python library), if you want to use the O(flatten) option
options:
api:
description: URI to the Logentries API.
@@ -90,9 +90,9 @@ examples: >
api = data.logentries.com
port = 10000
tls_port = 20000
use_tls = no
use_tls = true
token = dd21fc88-f00a-43ff-b977-e3a4233c53af
flatten = False
flatten = false
'''
import os
@@ -196,15 +196,11 @@ else:
class TLSSocketAppender(PlainTextSocketAppender):
def open_connection(self):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock = ssl.wrap_socket(
context = ssl.create_default_context(
purpose=ssl.Purpose.SERVER_AUTH,
cafile=certifi.where(), )
sock = context.wrap_socket(
sock=sock,
keyfile=None,
certfile=None,
server_side=False,
cert_reqs=ssl.CERT_REQUIRED,
ssl_version=getattr(
ssl, 'PROTOCOL_TLSv1_2', ssl.PROTOCOL_TLSv1),
ca_certs=certifi.where(),
do_handshake_on_connect=True,
suppress_ragged_eofs=True, )
sock.connect((self.LE_API, self.LE_TLS_PORT))

View File

@@ -14,7 +14,7 @@ DOCUMENTATION = '''
short_description: Post task results to a Nagios server through nrdp
description:
- This callback send playbook result to Nagios.
- Nagios shall use NRDP to recive passive events.
- Nagios shall use NRDP to receive passive events.
- The passive check is sent to a dedicated host/service for Ansible.
options:
url:

View File

@@ -15,7 +15,7 @@ DOCUMENTATION = '''
- set as main display callback
short_description: Don't display stuff to screen
description:
- This callback prevents outputing events to screen.
- This callback prevents outputting events to screen.
'''
from ansible.plugins.callback import CallbackBase
@@ -24,7 +24,7 @@ from ansible.plugins.callback import CallbackBase
class CallbackModule(CallbackBase):
'''
This callback wont print messages to stdout when new callback events are received.
This callback won't print messages to stdout when new callback events are received.
'''
CALLBACK_VERSION = 2.0

View File

@@ -115,8 +115,8 @@ class CallbackModule(CallbackBase):
line_length = 120
if self.last_skipped:
print()
msg = colorize("# {0} {1}".format(task_name,
'*' * (line_length - len(task_name))), 'bold')
line = "# {0} ".format(task_name)
msg = colorize("{0}{1}".format(line, '*' * (line_length - len(line))), 'bold')
print(msg)
def _indent_text(self, text, indent_level):

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Allyson Bowles <@akatch>
# Copyright (c) 2023, Al Bowles <@akatch>
# Copyright (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -11,7 +11,7 @@ __metaclass__ = type
DOCUMENTATION = '''
name: unixy
type: stdout
author: Allyson Bowles (@akatch)
author: Al Bowles (@akatch)
short_description: condensed Ansible output
description:
- Consolidated Ansible output in the style of LINUX/UNIX startup logs.
@@ -40,7 +40,6 @@ class CallbackModule(CallbackModule_default):
- Only display task names if the task runs on at least one host
- Add option to display all hostnames on a single line in the appropriate result color (failures may have a separate line)
- Consolidate stats display
- Display whether run is in --check mode
- Don't show play name if no hosts found
'''
@@ -92,19 +91,31 @@ class CallbackModule(CallbackModule_default):
def v2_playbook_on_task_start(self, task, is_conditional):
self._get_task_display_name(task)
if self.task_display_name is not None:
self._display.display("%s..." % self.task_display_name)
if task.check_mode and self.get_option('check_mode_markers'):
self._display.display("%s (check mode)..." % self.task_display_name)
else:
self._display.display("%s..." % self.task_display_name)
def v2_playbook_on_handler_task_start(self, task):
self._get_task_display_name(task)
if self.task_display_name is not None:
self._display.display("%s (via handler)... " % self.task_display_name)
if task.check_mode and self.get_option('check_mode_markers'):
self._display.display("%s (via handler in check mode)... " % self.task_display_name)
else:
self._display.display("%s (via handler)... " % self.task_display_name)
def v2_playbook_on_play_start(self, play):
name = play.get_name().strip()
if name and play.hosts:
msg = u"\n- %s on hosts: %s -" % (name, ",".join(play.hosts))
if play.check_mode and self.get_option('check_mode_markers'):
if name and play.hosts:
msg = u"\n- %s (in check mode) on hosts: %s -" % (name, ",".join(play.hosts))
else:
msg = u"- check mode -"
else:
msg = u"---"
if name and play.hosts:
msg = u"\n- %s on hosts: %s -" % (name, ",".join(play.hosts))
else:
msg = u"---"
self._display.display(msg)
@@ -227,8 +238,10 @@ class CallbackModule(CallbackModule_default):
self._display.display(" Ran out of hosts!", color=C.COLOR_ERROR)
def v2_playbook_on_start(self, playbook):
# TODO display whether this run is happening in check mode
self._display.display("Executing playbook %s" % basename(playbook._file_name))
if context.CLIARGS['check'] and self.get_option('check_mode_markers'):
self._display.display("Executing playbook %s in check mode" % basename(playbook._file_name))
else:
self._display.display("Executing playbook %s" % basename(playbook._file_name))
# show CLI arguments
if self._display.verbosity > 3:

View File

@@ -46,11 +46,26 @@ DOCUMENTATION = '''
vars:
- name: ansible_chroot_exe
default: chroot
disable_root_check:
description:
- Do not check that the user is not root.
ini:
- section: chroot_connection
key: disable_root_check
env:
- name: ANSIBLE_CHROOT_DISABLE_ROOT_CHECK
vars:
- name: ansible_chroot_disable_root_check
default: false
type: bool
version_added: 7.3.0
'''
EXAMPLES = r"""
# Static inventory file
# Plugin requires root privileges for chroot, -E preserves your env (and location of ~/.ansible):
# sudo -E ansible-playbook ...
#
# Static inventory file
# [chroots]
# /path/to/debootstrap
# /path/to/feboostrap
@@ -100,11 +115,7 @@ class Connection(ConnectionBase):
self.chroot = self._play_context.remote_addr
if os.geteuid() != 0:
raise AnsibleError("chroot connection requires running as root")
# we're running as root on the local system so do some
# trivial checks for ensuring 'host' is actually a chroot'able dir
# do some trivial checks for ensuring 'host' is actually a chroot'able dir
if not os.path.isdir(self.chroot):
raise AnsibleError("%s is not a directory" % self.chroot)
@@ -118,6 +129,11 @@ class Connection(ConnectionBase):
def _connect(self):
""" connect to the chroot """
if not self.get_option('disable_root_check') and os.geteuid() != 0:
raise AnsibleError(
"chroot connection requires running as root. "
"You can override this check with the `disable_root_check` option.")
if os.path.isabs(self.get_option('chroot_exe')):
self.chroot_cmd = self.get_option('chroot_exe')
else:

View File

@@ -70,7 +70,7 @@ class Connection(ConnectionBase):
if in_data:
raise AnsibleError("Internal Error: this module does not support optimized module pipelining")
# totally ignores privlege escalation
# totally ignores privilege escalation
display.vvv("EXEC %s" % cmd, host=self.host)
p = self.client.command.run(cmd)[self.host]
return p[0], p[1], p[2]

View File

@@ -19,6 +19,7 @@ DOCUMENTATION = '''
- Container identifier
default: inventory_hostname
vars:
- name: inventory_hostname
- name: ansible_host
- name: ansible_lxc_host
executable:
@@ -59,7 +60,7 @@ class Connection(ConnectionBase):
def __init__(self, play_context, new_stdin, *args, **kwargs):
super(Connection, self).__init__(play_context, new_stdin, *args, **kwargs)
self.container_name = self._play_context.remote_addr
self.container_name = None
self.container = None
def _connect(self):
@@ -67,12 +68,14 @@ class Connection(ConnectionBase):
super(Connection, self)._connect()
if not HAS_LIBLXC:
msg = "lxc bindings for python2 are not installed"
msg = "lxc python bindings are not installed"
raise errors.AnsibleError(msg)
if self.container:
return
self.container_name = self.get_option('remote_addr')
self._display.vvv("THIS IS A LOCAL LXC DIR", host=self.container_name)
self.container = _lxc.Container(self.container_name)
if self.container.state == "STOPPED":
@@ -117,7 +120,7 @@ class Connection(ConnectionBase):
super(Connection, self).exec_command(cmd, in_data=in_data, sudoable=sudoable)
# python2-lxc needs bytes. python3-lxc needs text.
executable = to_native(self._play_context.executable, errors='surrogate_or_strict')
executable = to_native(self.get_option('executable'), errors='surrogate_or_strict')
local_cmd = [executable, '-c', to_native(cmd, errors='surrogate_or_strict')]
read_stdout, write_stdout = None, None

View File

@@ -10,9 +10,9 @@ __metaclass__ = type
DOCUMENTATION = '''
author: Matt Clay (@mattclay) <matt@mystile.com>
name: lxd
short_description: Run tasks in lxc containers via lxc CLI
short_description: Run tasks in LXD instances via C(lxc) CLI
description:
- Run commands or put/fetch files to an existing lxc container using lxc CLI
- Run commands or put/fetch files to an existing instance using C(lxc) CLI.
options:
remote_addr:
description:
@@ -24,7 +24,7 @@ DOCUMENTATION = '''
- name: ansible_lxd_host
executable:
description:
- shell to use for execution inside container
- Shell to use for execution inside instance.
default: /bin/sh
vars:
- name: ansible_executable
@@ -69,7 +69,7 @@ class Connection(ConnectionBase):
raise AnsibleError("lxc command not found in PATH")
if self._play_context.remote_user is not None and self._play_context.remote_user != 'root':
self._display.warning('lxd does not support remote_user, using container default: root')
self._display.warning('lxd does not support remote_user, using default: root')
def _connect(self):
"""connect to lxd (nothing to do here) """

View File

@@ -47,6 +47,6 @@ options:
type: str
token:
description:
- ACL token for authentification.
- ACL token for authentication.
type: str
'''

View File

@@ -56,7 +56,7 @@ EXAMPLES = '''
- name: Parse a CSV file's contents
ansible.builtin.debug:
msg: >-
{{ csv_data | community.genera.from_csv(dialect='unix') }}
{{ csv_data | community.general.from_csv(dialect='unix') }}
vars:
csv_data: |
Column 1,Value

View File

@@ -42,6 +42,12 @@ DOCUMENTATION = '''
description: Fallback to cached results if connection to cobbler fails.
type: boolean
default: false
exclude_mgmt_classes:
description: Management classes to exclude from inventory.
type: list
default: []
elements: str
version_added: 7.4.0
exclude_profiles:
description:
- Profiles to exclude from inventory.
@@ -49,6 +55,12 @@ DOCUMENTATION = '''
type: list
default: []
elements: str
include_mgmt_classes:
description: Management classes to include from inventory.
type: list
default: []
elements: str
version_added: 7.4.0
include_profiles:
description:
- Profiles to include from inventory.
@@ -216,6 +228,8 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
self.cache_key = self.get_cache_key(path)
self.use_cache = cache and self.get_option('cache')
self.exclude_mgmt_classes = self.get_option('exclude_mgmt_classes')
self.include_mgmt_classes = self.get_option('include_mgmt_classes')
self.exclude_profiles = self.get_option('exclude_profiles')
self.include_profiles = self.get_option('include_profiles')
self.group_by = self.get_option('group_by')
@@ -265,9 +279,16 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
hostname = host['hostname'] # None
interfaces = host['interfaces']
if self._exclude_profile(host['profile']):
self.display.vvvv('Excluding host %s in profile %s\n' % (host['name'], host['profile']))
continue
if set(host['mgmt_classes']) & set(self.include_mgmt_classes):
self.display.vvvv('Including host %s in mgmt_classes %s\n' % (host['name'], host['mgmt_classes']))
else:
if self._exclude_profile(host['profile']):
self.display.vvvv('Excluding host %s in profile %s\n' % (host['name'], host['profile']))
continue
if set(host['mgmt_classes']) & set(self.exclude_mgmt_classes):
self.display.vvvv('Excluding host %s in mgmt_classes %s\n' % (host['name'], host['mgmt_classes']))
continue
# hostname is often empty for non-static IP hosts
if hostname == '':

View File

@@ -47,7 +47,7 @@ DOCUMENTATION = r'''
- You need to set this password on the lxd server before
running this module using the following command
C(lxc config set core.trust_password <some random password>)
See U(https://www.stgraber.org/2016/04/18/lxd-api-direct-interaction/).
See U(https://documentation.ubuntu.com/lxd/en/latest/authentication/#adding-client-certificates-using-a-trust-password).
- If O(trust_password) is set, this module send a request for authentication before sending any requests.
type: str
state:
@@ -70,7 +70,7 @@ DOCUMENTATION = r'''
version_added: 4.2.0
prefered_instance_network_interface:
description:
- If an instance has multiple network interfaces, select which one is the prefered as pattern.
- If an instance has multiple network interfaces, select which one is the preferred as pattern.
- Combined with the first number that can be found e.g. 'eth' + 0.
- The option has been renamed from O(prefered_container_network_interface) to O(prefered_instance_network_interface)
in community.general 3.8.0. The old name still works as an alias.
@@ -80,7 +80,7 @@ DOCUMENTATION = r'''
- prefered_container_network_interface
prefered_instance_network_family:
description:
- If an instance has multiple network interfaces, which one is the prefered by family.
- If an instance has multiple network interfaces, which one is the preferred by family.
- Specify V(inet) for IPv4 and V(inet6) for IPv6.
type: str
default: inet
@@ -359,7 +359,7 @@ class InventoryModule(BaseInventoryPlugin):
Kwargs:
None
Source:
https://github.com/lxc/lxd/blob/master/doc/rest-api.md
https://documentation.ubuntu.com/lxd/en/latest/rest-api/
Raises:
None
Returns:
@@ -376,7 +376,7 @@ class InventoryModule(BaseInventoryPlugin):
def get_instance_data(self, names):
"""Create Inventory of the instance
Iterate through the different branches of the instances and collect Informations.
Iterate through the different branches of the instances and collect Information.
Args:
list(names): List of instance names
@@ -398,7 +398,7 @@ class InventoryModule(BaseInventoryPlugin):
def get_network_data(self, names):
"""Create Inventory of the instance
Iterate through the different branches of the instances and collect Informations.
Iterate through the different branches of the instances and collect Information.
Args:
list(names): List of instance names
@@ -451,12 +451,12 @@ class InventoryModule(BaseInventoryPlugin):
return network_configuration
def get_prefered_instance_network_interface(self, instance_name):
"""Helper to get the prefered interface of thr instance
"""Helper to get the preferred interface of thr instance
Helper to get the prefered interface provide by neme pattern from 'prefered_instance_network_interface'.
Helper to get the preferred interface provide by neme pattern from 'prefered_instance_network_interface'.
Args:
str(containe_name): name of instance
str(instance_name): name of instance
Kwargs:
None
Raises:
@@ -481,7 +481,7 @@ class InventoryModule(BaseInventoryPlugin):
Helper to get the VLAN_ID from the instance
Args:
str(containe_name): name of instance
str(instance_name): name of instance
Kwargs:
None
Raises:
@@ -563,7 +563,7 @@ class InventoryModule(BaseInventoryPlugin):
else:
path[instance_name][key] = value
except KeyError as err:
raise AnsibleParserError("Unable to store Informations: {0}".format(to_native(err)))
raise AnsibleParserError("Unable to store Information: {0}".format(to_native(err)))
def extract_information_from_instance_configs(self):
"""Process configuration information
@@ -683,7 +683,7 @@ class InventoryModule(BaseInventoryPlugin):
continue
# add instance
self.inventory.add_host(instance_name)
# add network informations
# add network information
self.build_inventory_network(instance_name)
# add os
v = self._get_data_entry('inventory/{0}/os'.format(instance_name))

View File

@@ -85,6 +85,11 @@ DOCUMENTATION = '''
type: boolean
default: false
version_added: 6.1.0
use_arp_ping:
description: Whether to always (V(true)) use the quick ARP ping or (V(false)) a slower but more reliable method.
type: boolean
default: true
version_added: 7.4.0
notes:
- At least one of ipv4 or ipv6 is required to be True, both can be True, but they cannot both be False.
- 'TODO: add OS fingerprinting'
@@ -196,40 +201,43 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
# setup command
cmd = [self._nmap]
if self._options['sudo']:
if self.get_option('sudo'):
cmd.insert(0, 'sudo')
if self._options['port']:
if self.get_option('port'):
cmd.append('-p')
cmd.append(self._options['port'])
cmd.append(self.get_option('port'))
if not self._options['ports']:
if not self.get_option('ports'):
cmd.append('-sP')
if self._options['ipv4'] and not self._options['ipv6']:
if self.get_option('ipv4') and not self.get_option('ipv6'):
cmd.append('-4')
elif self._options['ipv6'] and not self._options['ipv4']:
elif self.get_option('ipv6') and not self.get_option('ipv4'):
cmd.append('-6')
elif not self._options['ipv6'] and not self._options['ipv4']:
elif not self.get_option('ipv6') and not self.get_option('ipv4'):
raise AnsibleParserError('One of ipv4 or ipv6 must be enabled for this plugin')
if self._options['exclude']:
if self.get_option('exclude'):
cmd.append('--exclude')
cmd.append(','.join(self._options['exclude']))
cmd.append(','.join(self.get_option('exclude')))
if self._options['dns_resolve']:
if self.get_option('dns_resolve'):
cmd.append('-n')
if self._options['udp_scan']:
if self.get_option('udp_scan'):
cmd.append('-sU')
if self._options['icmp_timestamp']:
if self.get_option('icmp_timestamp'):
cmd.append('-PP')
if self._options['open']:
if self.get_option('open'):
cmd.append('--open')
cmd.append(self._options['address'])
if not self.get_option('use_arp_ping'):
cmd.append('--disable-arp-ping')
cmd.append(self.get_option('address'))
try:
# execute
p = Popen(cmd, stdout=PIPE, stderr=PIPE)

View File

@@ -102,7 +102,7 @@ DOCUMENTATION = '''
type: bool
qemu_extended_statuses:
description:
- Requires O(want_facts) to be set to V(true) to function. This will allow you to differentiate betweend C(paused) and C(prelaunch)
- Requires O(want_facts) to be set to V(true) to function. This will allow you to differentiate between C(paused) and C(prelaunch)
statuses of the QEMU VMs.
- This introduces multiple groups [prefixed with O(group_prefix)] C(prelaunch) and C(paused).
default: false

View File

@@ -25,7 +25,10 @@ DOCUMENTATION = """
type: list
elements: str
search:
description: Field to retrieve, for example V(name) or V(id).
description:
- Field to retrieve, for example V(name) or V(id).
- If set to V(id), only zero or one element can be returned.
Use the Jinja C(first) filter to get the only list element.
type: str
default: name
version_added: 5.7.0
@@ -39,27 +42,27 @@ DOCUMENTATION = """
"""
EXAMPLES = """
- name: "Get 'password' from Bitwarden record named 'a_test'"
- name: "Get 'password' from all Bitwarden records named 'a_test'"
ansible.builtin.debug:
msg: >-
{{ lookup('community.general.bitwarden', 'a_test', field='password') }}
- name: "Get 'password' from Bitwarden record with id 'bafba515-af11-47e6-abe3-af1200cd18b2'"
- name: "Get 'password' from Bitwarden record with ID 'bafba515-af11-47e6-abe3-af1200cd18b2'"
ansible.builtin.debug:
msg: >-
{{ lookup('community.general.bitwarden', 'bafba515-af11-47e6-abe3-af1200cd18b2', search='id', field='password') }}
{{ lookup('community.general.bitwarden', 'bafba515-af11-47e6-abe3-af1200cd18b2', search='id', field='password') | first }}
- name: "Get 'password' from Bitwarden record named 'a_test' from collection"
- name: "Get 'password' from all Bitwarden records named 'a_test' from collection"
ansible.builtin.debug:
msg: >-
{{ lookup('community.general.bitwarden', 'a_test', field='password', collection_id='bafba515-af11-47e6-abe3-af1200cd18b2') }}
- name: "Get full Bitwarden record named 'a_test'"
- name: "Get list of all full Bitwarden records named 'a_test'"
ansible.builtin.debug:
msg: >-
{{ lookup('community.general.bitwarden', 'a_test') }}
- name: "Get custom field 'api_key' from Bitwarden record named 'a_test'"
- name: "Get custom field 'api_key' from all Bitwarden records named 'a_test'"
ansible.builtin.debug:
msg: >-
{{ lookup('community.general.bitwarden', 'a_test', field='api_key') }}
@@ -67,9 +70,12 @@ EXAMPLES = """
RETURN = """
_raw:
description: List of requested field or JSON object of list of matches.
description:
- A one-element list that contains a list of requested fields or JSON objects of matches.
- If you use C(query), you get a list of lists. If you use C(lookup) without C(wantlist=true),
this always gets reduced to a list of field values or JSON objects.
type: list
elements: raw
elements: list
"""
from subprocess import Popen, PIPE
@@ -132,20 +138,29 @@ class Bitwarden(object):
If field is None, return the whole record for each match.
"""
matches = self._get_matches(search_value, search_field, collection_id)
if field in ['autofillOnPageLoad', 'password', 'passwordRevisionDate', 'totp', 'uris', 'username']:
return [match['login'][field] for match in matches]
elif not field:
if not field:
return matches
else:
custom_field_matches = []
for match in matches:
field_matches = []
for match in matches:
# if there are no custom fields, then `match` has no key 'fields'
if 'fields' in match:
custom_field_found = False
for custom_field in match['fields']:
if custom_field['name'] == field:
custom_field_matches.append(custom_field['value'])
if matches and not custom_field_matches:
raise AnsibleError("Custom field {field} does not exist in {search_value}".format(field=field, search_value=search_value))
return custom_field_matches
if field == custom_field['name']:
field_matches.append(custom_field['value'])
custom_field_found = True
break
if custom_field_found:
continue
if 'login' in match and field in match['login']:
field_matches.append(match['login'][field])
continue
if field in match:
field_matches.append(match[field])
continue
if matches and not field_matches:
raise AnsibleError("field {field} does not exist in {search_value}".format(field=field, search_value=search_value))
return field_matches
class LookupModule(LookupBase):

View File

@@ -70,6 +70,11 @@ DOCUMENTATION = '''
- "Class."
type: str
default: 'IN'
tcp:
description: Use TCP to lookup DNS records.
default: false
type: bool
version_added: 7.5.0
notes:
- ALL is not a record per-se, merely the listed fields are available for any record results you retrieve in the form of a dictionary.
- While the 'dig' lookup plugin supports anything which dnspython supports out of the box, only a subset can be converted into a dictionary.
@@ -329,6 +334,7 @@ class LookupModule(LookupBase):
flat = self.get_option('flat')
fail_on_error = self.get_option('fail_on_error')
real_empty = self.get_option('real_empty')
tcp = self.get_option('tcp')
try:
rdclass = dns.rdataclass.from_text(self.get_option('class'))
except Exception as e:
@@ -375,6 +381,8 @@ class LookupModule(LookupBase):
fail_on_error = boolean(arg)
elif opt == 'real_empty':
real_empty = boolean(arg)
elif opt == 'tcp':
tcp = boolean(arg)
continue
@@ -408,7 +416,7 @@ class LookupModule(LookupBase):
for domain in domains:
try:
answers = myres.query(domain, qtype, rdclass=rdclass)
answers = myres.query(domain, qtype, rdclass=rdclass, tcp=tcp)
for rdata in answers:
s = rdata.to_text()
if qtype.upper() == 'TXT':

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Scott Buchanan <sbuchanan@ri.pn>
# Copyright (c) 2018, Scott Buchanan <scott@buchanan.works>
# Copyright (c) 2016, Andrew Zenk <azenk@umn.edu> (lastpass.py used as starting point)
# Copyright (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
@@ -38,6 +38,10 @@ DOCUMENTATION = '''
type: str
subdomain:
description: The 1Password subdomain to authenticate against.
account_id:
description: The account ID to target.
type: str
version_added: 7.5.0
username:
description: The username used to sign in.
secret_key:
@@ -55,6 +59,7 @@ DOCUMENTATION = '''
performed an initial sign in (meaning C(~/.op/config), C(~/.config/op/config) or C(~/.config/.op/config) exists), then only the
C(master_password) is required. You may optionally specify O(subdomain) in this scenario, otherwise the last used subdomain will be used by C(op).
- This lookup can perform an initial login by providing O(subdomain), O(username), O(secret_key), and O(master_password).
- Can target a specific account by providing the O(account_id).
- Due to the B(very) sensitive nature of these credentials, it is B(highly) recommended that you only pass in the minimal credentials
needed at any given time. Also, store these credentials in an Ansible Vault using a key that is equal to or greater in strength
to the 1Password master password.
@@ -93,6 +98,12 @@ EXAMPLES = """
master_password=vault_master_password,
username='tweety@acme.com',
secret_key=vault_secret_key)
- name: Retrieve password from specific account
ansible.builtin.debug:
var: lookup('community.general.onepassword',
'HAL 9000',
account_id='abc123')
"""
RETURN = """
@@ -116,16 +127,34 @@ from ansible.module_utils.six import with_metaclass
from ansible_collections.community.general.plugins.module_utils.onepassword import OnePasswordConfig
def _lower_if_possible(value):
"""Return the lower case version value, otherwise return the value"""
try:
return value.lower()
except AttributeError:
return value
class OnePassCLIBase(with_metaclass(abc.ABCMeta, object)):
bin = "op"
def __init__(self, subdomain=None, domain="1password.com", username=None, secret_key=None, master_password=None, service_account_token=None):
def __init__(
self,
subdomain=None,
domain="1password.com",
username=None,
secret_key=None,
master_password=None,
service_account_token=None,
account_id=None,
):
self.subdomain = subdomain
self.domain = domain
self.username = username
self.master_password = master_password
self.secret_key = secret_key
self.service_account_token = service_account_token
self.account_id = account_id
self._path = None
self._version = None
@@ -293,7 +322,9 @@ class OnePassCLIv1(OnePassCLIBase):
def assert_logged_in(self):
args = ["get", "account"]
if self.subdomain:
if self.account_id:
args.extend(["--account", self.account_id])
elif self.subdomain:
account = "{subdomain}.{domain}".format(subdomain=self.subdomain, domain=self.domain)
args.extend(["--account", account])
@@ -326,6 +357,10 @@ class OnePassCLIv1(OnePassCLIBase):
def get_raw(self, item_id, vault=None, token=None):
args = ["get", "item", item_id]
if self.account_id:
args.extend(["--account", self.account_id])
if vault is not None:
args += ["--vault={0}".format(vault)]
@@ -453,6 +488,7 @@ class OnePassCLIv2(OnePassCLIBase):
}
"""
data = json.loads(data_json)
field_name = _lower_if_possible(field_name)
for field in data.get("fields", []):
if section_title is None:
# If the field name exists in the section, return that value
@@ -461,24 +497,26 @@ class OnePassCLIv2(OnePassCLIBase):
# If the field name doesn't exist in the section, match on the value of "label"
# then "id" and return "value"
if field.get("label") == field_name:
return field["value"]
if field.get("label", "").lower() == field_name:
return field.get("value", "")
if field.get("id") == field_name:
return field["value"]
if field.get("id", "").lower() == field_name:
return field.get("value", "")
# Look at the section data and get an indentifier. The value of 'id' is either a unique ID
# Look at the section data and get an identifier. The value of 'id' is either a unique ID
# or a human-readable string. If a 'label' field exists, prefer that since
# it is the value visible in the 1Password UI when both 'id' and 'label' exist.
section = field.get("section", {})
current_section_title = section.get("label", section.get("id"))
section_title = _lower_if_possible(section_title)
current_section_title = section.get("label", section.get("id", "")).lower()
if section_title == current_section_title:
# In the correct section. Check "label" then "id" for the desired field_name
if field.get("label") == field_name:
return field["value"]
return field.get("value", "")
if field.get("id") == field_name:
return field["value"]
return field.get("value", "")
return ""
@@ -502,7 +540,9 @@ class OnePassCLIv2(OnePassCLIBase):
# an interactive prompt. Only run 'op account get' after first listing accounts to see
# if there are any previously configured accounts.
args = ["account", "get"]
if self.subdomain:
if self.account_id:
args.extend(["--account", self.account_id])
elif self.subdomain:
account = "{subdomain}.{domain}".format(subdomain=self.subdomain, domain=self.domain)
args.extend(["--account", account])
@@ -533,6 +573,10 @@ class OnePassCLIv2(OnePassCLIBase):
def get_raw(self, item_id, vault=None, token=None):
args = ["item", "get", item_id, "--format", "json"]
if self.account_id:
args.extend(["--account", self.account_id])
if vault is not None:
args += ["--vault={0}".format(vault)]
@@ -559,13 +603,14 @@ class OnePassCLIv2(OnePassCLIBase):
class OnePass(object):
def __init__(self, subdomain=None, domain="1password.com", username=None, secret_key=None, master_password=None,
service_account_token=None):
service_account_token=None, account_id=None):
self.subdomain = subdomain
self.domain = domain
self.username = username
self.secret_key = secret_key
self.master_password = master_password
self.service_account_token = service_account_token
self.account_id = account_id
self.logged_in = False
self.token = None
@@ -578,7 +623,7 @@ class OnePass(object):
for cls in OnePassCLIBase.__subclasses__():
if cls.supports_version == version.split(".")[0]:
try:
return cls(self.subdomain, self.domain, self.username, self.secret_key, self.master_password, self.service_account_token)
return cls(self.subdomain, self.domain, self.username, self.secret_key, self.master_password, self.service_account_token, self.account_id)
except TypeError as e:
raise AnsibleLookupError(e)
@@ -642,8 +687,9 @@ class LookupModule(LookupBase):
secret_key = self.get_option("secret_key")
master_password = self.get_option("master_password")
service_account_token = self.get_option("service_account_token")
account_id = self.get_option("account_id")
op = OnePass(subdomain, domain, username, secret_key, master_password, service_account_token)
op = OnePass(subdomain, domain, username, secret_key, master_password, service_account_token, account_id)
op.assert_logged_in()
values = []

View File

@@ -35,6 +35,10 @@ DOCUMENTATION = '''
version_added: 6.0.0
default: '1password.com'
type: str
account_id:
description: The account ID to target.
type: str
version_added: 7.5.0
username:
description: The username used to sign in.
secret_key:
@@ -52,6 +56,7 @@ DOCUMENTATION = '''
performed an initial sign in (meaning C(~/.op/config exists)), then only the O(master_password) is required.
You may optionally specify O(subdomain) in this scenario, otherwise the last used subdomain will be used by C(op).
- This lookup can perform an initial login by providing O(subdomain), O(username), O(secret_key), and O(master_password).
- Can target a specific account by providing the O(account_id).
- Due to the B(very) sensitive nature of these credentials, it is B(highly) recommended that you only pass in the minimal credentials
needed at any given time. Also, store these credentials in an Ansible Vault using a key that is equal to or greater in strength
to the 1Password master password.
@@ -96,8 +101,9 @@ class LookupModule(LookupBase):
secret_key = self.get_option("secret_key")
master_password = self.get_option("master_password")
service_account_token = self.get_option("service_account_token")
account_id = self.get_option("account_id")
op = OnePass(subdomain, domain, username, secret_key, master_password, service_account_token)
op = OnePass(subdomain, domain, username, secret_key, master_password, service_account_token, account_id)
op.assert_logged_in()
values = []

View File

@@ -72,7 +72,7 @@ DOCUMENTATION = r"""
type: int
override_special:
description:
- Overide a list of special characters to use in the string.
- Override a list of special characters to use in the string.
- If set O(min_special) should be set to a non-default value.
type: str
override_all:
@@ -80,6 +80,19 @@ DOCUMENTATION = r"""
- Override all values of O(numbers), O(upper), O(lower), and O(special) with
the given list of characters.
type: str
ignore_similar_chars:
description:
- Ignore similar characters, such as V(l) and V(1), or V(O) and V(0).
- These characters can be configured in O(similar_chars).
default: false
type: bool
version_added: 7.5.0
similar_chars:
description:
- Override a list of characters not to be use in the string.
default: "il1LoO0"
type: str
version_added: 7.5.0
base64:
description:
- Returns base64 encoded string.
@@ -103,7 +116,7 @@ EXAMPLES = r"""
var: lookup('community.general.random_string', base64=True)
# Example result: ['NHZ6eWN5Qk0=']
- name: Generate a random string with 1 lower, 1 upper, 1 number and 1 special char (atleast)
- name: Generate a random string with 1 lower, 1 upper, 1 number and 1 special char (at least)
ansible.builtin.debug:
var: lookup('community.general.random_string', min_lower=1, min_upper=1, min_special=1, min_numeric=1)
# Example result: ['&Qw2|E[-']
@@ -173,9 +186,17 @@ class LookupModule(LookupBase):
length = self.get_option("length")
base64_flag = self.get_option("base64")
override_all = self.get_option("override_all")
ignore_similar_chars = self.get_option("ignore_similar_chars")
similar_chars = self.get_option("similar_chars")
values = ""
available_chars_set = ""
if ignore_similar_chars:
number_chars = "".join([sc for sc in number_chars if sc not in similar_chars])
lower_chars = "".join([sc for sc in lower_chars if sc not in similar_chars])
upper_chars = "".join([sc for sc in upper_chars if sc not in similar_chars])
special_chars = "".join([sc for sc in special_chars if sc not in similar_chars])
if override_all:
# Override all the values
available_chars_set = override_all

View File

@@ -6,6 +6,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import os
from functools import wraps
from ansible.module_utils.common.collections import is_sequence
@@ -204,12 +205,17 @@ class CmdRunner(object):
environ_update = {}
self.environ_update = environ_update
self.command[0] = module.get_bin_path(self.command[0], opt_dirs=path_prefix, required=True)
_cmd = self.command[0]
self.command[0] = _cmd if (os.path.isabs(_cmd) or '/' in _cmd) else module.get_bin_path(_cmd, opt_dirs=path_prefix, required=True)
for mod_param_name, spec in iteritems(module.argument_spec):
if mod_param_name not in self.arg_formats:
self.arg_formats[mod_param_name] = _Format.as_default_type(spec.get('type', 'str'), mod_param_name)
@property
def binary(self):
return self.command[0]
def __call__(self, args_order=None, output_process=None, ignore_value_none=True, check_mode_skip=False, check_mode_return=None, **kwargs):
if output_process is None:
output_process = _process_as_is

View File

@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2022, Håkon Lerring
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
def get_consul_url(configuration):
return '%s://%s:%s/v1' % (configuration.scheme,
configuration.host, configuration.port)
def get_auth_headers(configuration):
if configuration.token is None:
return {}
else:
return {'X-Consul-Token': configuration.token}
class RequestError(Exception):
pass
def handle_consul_response_error(response):
if 400 <= response.status_code < 600:
raise RequestError('%d %s' % (response.status_code, response.content))

View File

@@ -39,7 +39,7 @@ except ImportError:
LIBCLOUD_IMP_ERR = traceback.format_exc()
HAS_LIBCLOUD = False
# MCP 2.x version patten for location (datacenter) names.
# MCP 2.x version pattern for location (datacenter) names.
#
# Note that this is not a totally reliable way of determining MCP version.
# Unfortunately, libcloud's NodeLocation currently makes no provision for extended properties.

View File

@@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2022, Alexei Znamensky <russoz@gmail.com>
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible_collections.community.general.plugins.module_utils.cmd_runner import CmdRunner, cmd_runner_fmt
def gio_mime_runner(module, **kwargs):
return CmdRunner(
module,
command=['gio', 'mime'],
arg_formats=dict(
mime_type=cmd_runner_fmt.as_list(),
handler=cmd_runner_fmt.as_list(),
),
**kwargs
)
def gio_mime_get(runner, mime_type):
def process(rc, out, err):
if err.startswith("No default applications for"):
return None
out = out.splitlines()[0]
return out.split()[-1]
with runner("mime_type", output_process=process) as ctx:
return ctx.run(mime_type=mime_type)

View File

@@ -116,7 +116,7 @@ def gitlab_authentication(module):
def filter_returned_variables(gitlab_variables):
# pop properties we don't know
existing_variables = [dict(x.attributes) for x in gitlab_variables]
KNOWN = ['key', 'value', 'masked', 'protected', 'variable_type', 'environment_scope']
KNOWN = ['key', 'value', 'masked', 'protected', 'variable_type', 'environment_scope', 'raw']
for item in existing_variables:
for key in list(item.keys()):
if key not in KNOWN:
@@ -135,6 +135,7 @@ def vars_to_variables(vars, module):
"value": str(value),
"masked": False,
"protected": False,
"raw": False,
"variable_type": "env_var",
}
)
@@ -145,6 +146,7 @@ def vars_to_variables(vars, module):
"value": value.get('value'),
"masked": value.get('masked'),
"protected": value.get('protected'),
"raw": value.get('raw'),
"variable_type": value.get('variable_type'),
}

View File

@@ -203,7 +203,7 @@ class Config(object):
if url == "":
raise HwcClientException(
0, "Can not find the enpoint for %s" % service_type)
0, "Cannot find the endpoint for %s" % service_type)
if url[-1] != "/":
url += "/"
@@ -351,7 +351,7 @@ def wait_to_finish(target, pending, refresh, timeout, min_interval=1, delay=3):
if pending and status not in pending:
raise HwcModuleException(
"unexpect status(%s) occurred" % status)
"unexpected status(%s) occurred" % status)
if not is_last_time:
wait *= 2
@@ -362,7 +362,7 @@ def wait_to_finish(target, pending, refresh, timeout, min_interval=1, delay=3):
time.sleep(wait)
raise HwcModuleException("asycn wait timeout after %d seconds" % timeout)
raise HwcModuleException("async wait timeout after %d seconds" % timeout)
def navigate_value(data, index, array_index=None):

View File

@@ -116,6 +116,9 @@ URL_AUTHZ_PERMISSIONS = "{url}/admin/realms/{realm}/clients/{client_id}/authz/re
URL_AUTHZ_RESOURCES = "{url}/admin/realms/{realm}/clients/{client_id}/authz/resource-server/resource"
URL_AUTHZ_CUSTOM_POLICY = "{url}/admin/realms/{realm}/clients/{client_id}/authz/resource-server/policy/{policy_type}"
URL_AUTHZ_CUSTOM_POLICIES = "{url}/admin/realms/{realm}/clients/{client_id}/authz/resource-server/policy"
def keycloak_argument_spec():
"""
@@ -541,7 +544,7 @@ class KeycloakAPI(object):
return None
def get_client_group_available_rolemappings(self, gid, cid, realm="master"):
""" Fetch the available role of a client in a specified goup on the Keycloak server.
""" Fetch the available role of a client in a specified group on the Keycloak server.
:param gid: ID of the group from which to obtain the rolemappings.
:param cid: ID of the client from which to obtain the rolemappings.
@@ -624,7 +627,7 @@ class KeycloakAPI(object):
% (rid, realm, str(e)))
def add_group_rolemapping(self, gid, cid, role_rep, realm="master"):
""" Fetch the composite role of a client in a specified goup on the Keycloak server.
""" Fetch the composite role of a client in a specified group on the Keycloak server.
:param gid: ID of the group from which to obtain the rolemappings.
:param cid: ID of the client from which to obtain the rolemappings.
@@ -777,7 +780,8 @@ class KeycloakAPI(object):
users_url += '?username=%s&exact=true' % username
try:
userrep = None
users = json.loads(to_native(open_url(users_url, method='GET', headers=self.restheaders, timeout=self.connection_timeout,
users = json.loads(to_native(open_url(users_url, method='GET', http_agent=self.http_agent, headers=self.restheaders,
timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
for user in users:
if user['username'] == username:
@@ -803,7 +807,8 @@ class KeycloakAPI(object):
service_account_user_url = URL_CLIENT_SERVICE_ACCOUNT_USER.format(url=self.baseurl, realm=realm, id=cid)
try:
return json.loads(to_native(open_url(service_account_user_url, method='GET', headers=self.restheaders, timeout=self.connection_timeout,
return json.loads(to_native(open_url(service_account_user_url, method='GET', http_agent=self.http_agent, headers=self.restheaders,
timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except ValueError as e:
self.module.fail_json(msg='API returned incorrect JSON when trying to obtain the service-account-user for realm %s and client_id %s: %s'
@@ -1233,7 +1238,7 @@ class KeycloakAPI(object):
:param realm: Realm in which the clientscope resides.
:param client_id: The client in which the clientscope resides.
:return The optinal clientscopes of this realm or client
:return The optional clientscopes of this realm or client
"""
url = URL_OPTIONAL_CLIENTSCOPES if client_id is None else URL_CLIENT_OPTIONAL_CLIENTSCOPES
return self._get_clientscopes_of_type(realm, url, 'optional', client_id)
@@ -1246,7 +1251,7 @@ class KeycloakAPI(object):
:param realm: Realm in which the clientscope resides.
:param url_template the template for the right type
:param scope_type this can be either optinal or default
:param scope_type this can be either optional or default
:param client_id: The client in which the clientscope resides.
:return The clientscopes of the specified type of this realm
"""
@@ -1268,7 +1273,7 @@ class KeycloakAPI(object):
def _decide_url_type_clientscope(self, client_id=None, scope_type="default"):
"""Decides which url to use.
:param scope_type this can be either optinal or default
:param scope_type this can be either optional or default
:param client_id: The client in which the clientscope resides.
"""
if client_id is None:
@@ -1347,7 +1352,8 @@ class KeycloakAPI(object):
clientsecret_url = URL_CLIENTSECRET.format(url=self.baseurl, realm=realm, id=id)
try:
return json.loads(to_native(open_url(clientsecret_url, method='POST', headers=self.restheaders, timeout=self.connection_timeout,
return json.loads(to_native(open_url(clientsecret_url, method='POST', http_agent=self.http_agent, headers=self.restheaders,
timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except HTTPError as e:
@@ -1370,7 +1376,8 @@ class KeycloakAPI(object):
clientsecret_url = URL_CLIENTSECRET.format(url=self.baseurl, realm=realm, id=id)
try:
return json.loads(to_native(open_url(clientsecret_url, method='GET', headers=self.restheaders, timeout=self.connection_timeout,
return json.loads(to_native(open_url(clientsecret_url, method='GET', http_agent=self.http_agent, headers=self.restheaders,
timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except HTTPError as e:
@@ -1513,7 +1520,7 @@ class KeycloakAPI(object):
def get_subgroup_direct_parent(self, parents, realm="master", children_to_resolve=None):
""" Get keycloak direct parent group API object for a given chain of parents.
To succesfully work the API for subgroups we actually dont need
To successfully work the API for subgroups we actually don't need
to "walk the whole tree" for nested groups but only need to know
the ID for the direct predecessor of current subgroup. This
method will guarantee us this information getting there with
@@ -1672,7 +1679,7 @@ class KeycloakAPI(object):
:param name: Name of the role to fetch.
:param realm: Realm in which the role resides; default 'master'.
"""
role_url = URL_REALM_ROLE.format(url=self.baseurl, realm=realm, name=quote(name))
role_url = URL_REALM_ROLE.format(url=self.baseurl, realm=realm, name=quote(name, safe=''))
try:
return json.loads(to_native(open_url(role_url, method="GET", http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
@@ -1709,7 +1716,7 @@ class KeycloakAPI(object):
:param rolerep: A RoleRepresentation of the updated role.
:return HTTPResponse object on success
"""
role_url = URL_REALM_ROLE.format(url=self.baseurl, realm=realm, name=quote(rolerep['name']))
role_url = URL_REALM_ROLE.format(url=self.baseurl, realm=realm, name=quote(rolerep['name']), safe='')
try:
composites = None
if "composites" in rolerep:
@@ -1730,9 +1737,9 @@ class KeycloakAPI(object):
if clientid is not None:
client = self.get_client_by_clientid(client_id=clientid, realm=realm)
cid = client['id']
composite_url = URL_CLIENT_ROLE_COMPOSITES.format(url=self.baseurl, realm=realm, id=cid, name=quote(rolerep["name"]))
composite_url = URL_CLIENT_ROLE_COMPOSITES.format(url=self.baseurl, realm=realm, id=cid, name=quote(rolerep["name"], safe=''))
else:
composite_url = URL_REALM_ROLE_COMPOSITES.format(url=self.baseurl, realm=realm, name=quote(rolerep["name"]))
composite_url = URL_REALM_ROLE_COMPOSITES.format(url=self.baseurl, realm=realm, name=quote(rolerep["name"], safe=''))
# Get existing composites
return json.loads(to_native(open_url(
composite_url,
@@ -1751,9 +1758,9 @@ class KeycloakAPI(object):
if clientid is not None:
client = self.get_client_by_clientid(client_id=clientid, realm=realm)
cid = client['id']
composite_url = URL_CLIENT_ROLE_COMPOSITES.format(url=self.baseurl, realm=realm, id=cid, name=quote(rolerep["name"]))
composite_url = URL_CLIENT_ROLE_COMPOSITES.format(url=self.baseurl, realm=realm, id=cid, name=quote(rolerep["name"], safe=''))
else:
composite_url = URL_REALM_ROLE_COMPOSITES.format(url=self.baseurl, realm=realm, name=quote(rolerep["name"]))
composite_url = URL_REALM_ROLE_COMPOSITES.format(url=self.baseurl, realm=realm, name=quote(rolerep["name"], safe=''))
# Get existing composites
# create new composites
return open_url(composite_url, method='POST', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
@@ -1768,9 +1775,9 @@ class KeycloakAPI(object):
if clientid is not None:
client = self.get_client_by_clientid(client_id=clientid, realm=realm)
cid = client['id']
composite_url = URL_CLIENT_ROLE_COMPOSITES.format(url=self.baseurl, realm=realm, id=cid, name=quote(rolerep["name"]))
composite_url = URL_CLIENT_ROLE_COMPOSITES.format(url=self.baseurl, realm=realm, id=cid, name=quote(rolerep["name"], safe=''))
else:
composite_url = URL_REALM_ROLE_COMPOSITES.format(url=self.baseurl, realm=realm, name=quote(rolerep["name"]))
composite_url = URL_REALM_ROLE_COMPOSITES.format(url=self.baseurl, realm=realm, name=quote(rolerep["name"], safe=''))
# Get existing composites
# create new composites
return open_url(composite_url, method='DELETE', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
@@ -1835,7 +1842,7 @@ class KeycloakAPI(object):
:param name: The name of the role.
:param realm: The realm in which this role resides, default "master".
"""
role_url = URL_REALM_ROLE.format(url=self.baseurl, realm=realm, name=quote(name))
role_url = URL_REALM_ROLE.format(url=self.baseurl, realm=realm, name=quote(name, safe=''))
try:
return open_url(role_url, method='DELETE', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs)
@@ -1879,7 +1886,7 @@ class KeycloakAPI(object):
if cid is None:
self.module.fail_json(msg='Could not find client %s in realm %s'
% (clientid, realm))
role_url = URL_CLIENT_ROLE.format(url=self.baseurl, realm=realm, id=cid, name=quote(name))
role_url = URL_CLIENT_ROLE.format(url=self.baseurl, realm=realm, id=cid, name=quote(name, safe=''))
try:
return json.loads(to_native(open_url(role_url, method="GET", http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
@@ -1943,7 +1950,7 @@ class KeycloakAPI(object):
if cid is None:
self.module.fail_json(msg='Could not find client %s in realm %s'
% (clientid, realm))
role_url = URL_CLIENT_ROLE.format(url=self.baseurl, realm=realm, id=cid, name=quote(rolerep['name']))
role_url = URL_CLIENT_ROLE.format(url=self.baseurl, realm=realm, id=cid, name=quote(rolerep['name'], safe=''))
try:
composites = None
if "composites" in rolerep:
@@ -1969,7 +1976,7 @@ class KeycloakAPI(object):
if cid is None:
self.module.fail_json(msg='Could not find client %s in realm %s'
% (clientid, realm))
role_url = URL_CLIENT_ROLE.format(url=self.baseurl, realm=realm, id=cid, name=quote(name))
role_url = URL_CLIENT_ROLE.format(url=self.baseurl, realm=realm, id=cid, name=quote(name, safe=''))
try:
return open_url(role_url, method='DELETE', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs)
@@ -2029,7 +2036,7 @@ class KeycloakAPI(object):
URL_AUTHENTICATION_FLOW_COPY.format(
url=self.baseurl,
realm=realm,
copyfrom=quote(config["copyFrom"])),
copyfrom=quote(config["copyFrom"], safe='')),
method='POST',
http_agent=self.http_agent, headers=self.restheaders,
data=json.dumps(new_name),
@@ -2103,7 +2110,7 @@ class KeycloakAPI(object):
URL_AUTHENTICATION_FLOW_EXECUTIONS.format(
url=self.baseurl,
realm=realm,
flowalias=quote(flowAlias)),
flowalias=quote(flowAlias, safe='')),
method='PUT',
http_agent=self.http_agent, headers=self.restheaders,
data=json.dumps(updatedExec),
@@ -2152,7 +2159,7 @@ class KeycloakAPI(object):
URL_AUTHENTICATION_FLOW_EXECUTIONS_FLOW.format(
url=self.baseurl,
realm=realm,
flowalias=quote(flowAlias)),
flowalias=quote(flowAlias, safe='')),
method='POST',
http_agent=self.http_agent, headers=self.restheaders,
data=json.dumps(newSubFlow),
@@ -2176,7 +2183,7 @@ class KeycloakAPI(object):
URL_AUTHENTICATION_FLOW_EXECUTIONS_EXECUTION.format(
url=self.baseurl,
realm=realm,
flowalias=quote(flowAlias)),
flowalias=quote(flowAlias, safe='')),
method='POST',
http_agent=self.http_agent, headers=self.restheaders,
data=json.dumps(newExec),
@@ -2236,7 +2243,7 @@ class KeycloakAPI(object):
URL_AUTHENTICATION_FLOW_EXECUTIONS.format(
url=self.baseurl,
realm=realm,
flowalias=quote(config["alias"])),
flowalias=quote(config["alias"], safe='')),
method='GET',
http_agent=self.http_agent, headers=self.restheaders,
timeout=self.connection_timeout,
@@ -2329,7 +2336,7 @@ class KeycloakAPI(object):
return open_url(
URL_AUTHENTICATION_REQUIRED_ACTIONS_ALIAS.format(
url=self.baseurl,
alias=quote(alias),
alias=quote(alias, safe=''),
realm=realm
),
method='PUT',
@@ -2356,7 +2363,7 @@ class KeycloakAPI(object):
return open_url(
URL_AUTHENTICATION_REQUIRED_ACTIONS_ALIAS.format(
url=self.baseurl,
alias=quote(alias),
alias=quote(alias, safe=''),
realm=realm
),
method='DELETE',
@@ -2623,7 +2630,7 @@ class KeycloakAPI(object):
def get_authz_authorization_scope_by_name(self, name, client_id, realm):
url = URL_AUTHZ_AUTHORIZATION_SCOPES.format(url=self.baseurl, client_id=client_id, realm=realm)
search_url = "%s/search?name=%s" % (url, quote(name))
search_url = "%s/search?name=%s" % (url, quote(name, safe=''))
try:
return json.loads(to_native(open_url(search_url, method='GET', http_agent=self.http_agent, headers=self.restheaders,
@@ -2678,7 +2685,9 @@ class KeycloakAPI(object):
open_url(
user_url,
method='GET',
headers=self.restheaders))
http_agent=self.http_agent, headers=self.restheaders,
timeout=self.connection_timeout,
validate_certs=self.validate_certs))
return userrep
except Exception as e:
self.module.fail_json(msg='Could not get user %s in realm %s: %s'
@@ -2700,8 +2709,10 @@ class KeycloakAPI(object):
realm=realm)
open_url(users_url,
method='POST',
headers=self.restheaders,
data=json.dumps(userrep))
http_agent=self.http_agent, headers=self.restheaders,
data=json.dumps(userrep),
timeout=self.connection_timeout,
validate_certs=self.validate_certs)
created_user = self.get_user_by_username(
username=userrep['username'],
realm=realm)
@@ -2744,8 +2755,10 @@ class KeycloakAPI(object):
open_url(
user_url,
method='PUT',
headers=self.restheaders,
data=json.dumps(userrep))
http_agent=self.http_agent, headers=self.restheaders,
data=json.dumps(userrep),
timeout=self.connection_timeout,
validate_certs=self.validate_certs)
updated_user = self.get_user_by_id(
user_id=userrep['id'],
realm=realm)
@@ -2769,7 +2782,9 @@ class KeycloakAPI(object):
return open_url(
user_url,
method='DELETE',
headers=self.restheaders)
http_agent=self.http_agent, headers=self.restheaders,
timeout=self.connection_timeout,
validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not delete user %s in realm %s: %s'
% (user_id, realm, str(e)))
@@ -2791,7 +2806,9 @@ class KeycloakAPI(object):
open_url(
user_groups_url,
method='GET',
headers=self.restheaders))
http_agent=self.http_agent, headers=self.restheaders,
timeout=self.connection_timeout,
validate_certs=self.validate_certs))
for user_group in user_groups:
groups.append(user_group["name"])
return groups
@@ -2816,7 +2833,9 @@ class KeycloakAPI(object):
return open_url(
user_group_url,
method='PUT',
headers=self.restheaders)
http_agent=self.http_agent, headers=self.restheaders,
timeout=self.connection_timeout,
validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not add user %s in group %s in realm %s: %s'
% (user_id, group_id, realm, str(e)))
@@ -2838,7 +2857,9 @@ class KeycloakAPI(object):
return open_url(
user_group_url,
method='DELETE',
headers=self.restheaders)
http_agent=self.http_agent, headers=self.restheaders,
timeout=self.connection_timeout,
validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not remove user %s from group %s in realm %s: %s'
% (user_id, group_id, realm, str(e)))
@@ -2858,7 +2879,7 @@ class KeycloakAPI(object):
groups_to_add_and_remove = self.extract_groups_to_add_to_and_remove_from_user(groups)
# If group membership need to be changed
if not is_struct_included(groups_to_add_and_remove['add'], user_existing_groups):
# Get available goups in the realm
# Get available groups in the realm
realm_groups = self.get_groups(realm=realm)
for realm_group in realm_groups:
if "name" in realm_group and realm_group["name"] in groups_to_add_and_remove['add']:
@@ -2904,6 +2925,27 @@ class KeycloakAPI(object):
list_of_groups.append(group_dict)
return list_of_groups
def create_authz_custom_policy(self, policy_type, payload, client_id, realm):
"""Create a custom policy for a Keycloak client"""
url = URL_AUTHZ_CUSTOM_POLICY.format(url=self.baseurl, policy_type=policy_type, client_id=client_id, realm=realm)
try:
return open_url(url, method='POST', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(payload), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not create permission %s for client %s in realm %s: %s' % (payload['name'], client_id, realm, str(e)))
def remove_authz_custom_policy(self, policy_id, client_id, realm):
"""Remove a custom policy from a Keycloak client"""
url = URL_AUTHZ_CUSTOM_POLICIES.format(url=self.baseurl, client_id=client_id, realm=realm)
delete_url = "%s/%s" % (url, policy_id)
try:
return open_url(delete_url, method='DELETE', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not delete custom policy %s for client %s in realm %s: %s' % (id, client_id, realm, str(e)))
def get_authz_permission_by_name(self, name, client_id, realm):
"""Get authorization permission by name"""
url = URL_AUTHZ_POLICIES.format(url=self.baseurl, client_id=client_id, realm=realm)

View File

@@ -139,5 +139,7 @@ class LdapGeneric(object):
def _xorder_dn(self):
# match X_ORDERed DNs
regex = r"\w+=\{\d+\}.+"
return re.match(regex, self.module.params['dn']) is not None
regex = r".+\{\d+\}.+"
explode_dn = ldap.dn.explode_dn(self.module.params['dn'])
return re.match(regex, explode_dn[0]) is not None

View File

@@ -14,8 +14,9 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.module_utils.six.moves.urllib.parse import urlencode
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
from ansible.module_utils.basic import json
import ansible.module_utils.six.moves.urllib.error as urllib_error
class Response(object):
@@ -78,7 +79,7 @@ def memset_api_call(api_key, api_method, payload=None):
msg = "Memset API returned an error ({0}, {1})." . format(response.json()['error_type'], response.json()['error'])
except urllib_error.URLError as e:
has_failed = True
msg = "An URLError occured ({0})." . format(type(e))
msg = "An URLError occurred ({0})." . format(type(e))
response.stderr = "{0}" . format(e)
if msg is None:

View File

@@ -79,7 +79,7 @@ def _post_pritunl_organization(
api_secret=api_secret,
base_url=base_url,
method="POST",
path="/organization/%s",
path="/organization",
headers={"Content-Type": "application/json"},
data=json.dumps(organization_data),
validate_certs=validate_certs,
@@ -220,7 +220,7 @@ def post_pritunl_organization(
api_secret=api_secret,
base_url=base_url,
organization_data={"name": organization_name},
validate_certs=True,
validate_certs=validate_certs,
)
if response.getcode() != 200:
@@ -248,7 +248,7 @@ def post_pritunl_user(
base_url=base_url,
organization_id=organization_id,
user_data=user_data,
validate_certs=True,
validate_certs=validate_certs,
)
if response.getcode() != 200:
@@ -267,7 +267,7 @@ def post_pritunl_user(
organization_id=organization_id,
user_data=user_data,
user_id=user_id,
validate_certs=True,
validate_certs=validate_certs,
)
if response.getcode() != 200:
@@ -287,7 +287,7 @@ def delete_pritunl_organization(
api_secret=api_secret,
base_url=base_url,
organization_id=organization_id,
validate_certs=True,
validate_certs=validate_certs,
)
if response.getcode() != 200:
@@ -307,7 +307,7 @@ def delete_pritunl_user(
base_url=base_url,
organization_id=organization_id,
user_id=user_id,
validate_certs=True,
validate_certs=validate_certs,
)
if response.getcode() != 200:
@@ -331,7 +331,7 @@ def pritunl_auth_request(
):
"""
Send an API call to a Pritunl server.
Taken from https://pritunl.com/api and adaped work with Ansible open_url
Taken from https://pritunl.com/api and adapted to work with Ansible open_url
"""
auth_timestamp = str(int(time.time()))
auth_nonce = uuid.uuid4().hex

View File

@@ -432,7 +432,7 @@ class OcapiUtils(object):
else:
return response
details = response["data"]["Status"].get("Details")
if type(details) is str:
if isinstance(details, str):
details = [details]
health_list = response["data"]["Status"]["Health"]
return_value = {

View File

@@ -434,7 +434,7 @@ def check_and_update_attributes(
target_instance, attr_name, input_value, existing_value, changed
):
"""
This function checks the difference between two resource attributes of literal types and sets the attrbute
This function checks the difference between two resource attributes of literal types and sets the attribute
value in the target instance type holding the attribute.
:param target_instance: The instance which contains the attribute whose values to be compared
:param attr_name: Name of the attribute whose value required to be compared
@@ -561,7 +561,7 @@ def are_lists_equal(s, t):
if s is None and t is None:
return True
if (s is None and len(t) >= 0) or (t is None and len(s) >= 0) or (len(s) != len(t)):
if s is None or t is None or (len(s) != len(t)):
return False
if len(s) == 0:
@@ -570,7 +570,7 @@ def are_lists_equal(s, t):
s = to_dict(s)
t = to_dict(t)
if type(s[0]) == dict:
if isinstance(s[0], dict):
# Handle list of dicts. Dictionary returned by the API may have additional keys. For example, a get call on
# service gateway has an attribute `services` which is a list of `ServiceIdResponseDetails`. This has a key
# `service_name` which is not provided in the list of `services` by a user while making an update call; only
@@ -604,9 +604,9 @@ def get_attr_to_update(get_fn, kwargs_get, module, update_attributes):
user_provided_attr_value = module.params.get(attr, None)
unequal_list_attr = (
type(resources_attr_value) == list or type(user_provided_attr_value) == list
isinstance(resources_attr_value, list) or isinstance(user_provided_attr_value, list)
) and not are_lists_equal(user_provided_attr_value, resources_attr_value)
unequal_attr = type(resources_attr_value) != list and to_dict(
unequal_attr = not isinstance(resources_attr_value, list) and to_dict(
resources_attr_value
) != to_dict(user_provided_attr_value)
if unequal_list_attr or unequal_attr:
@@ -785,7 +785,7 @@ def _get_attributes_to_consider(exclude_attributes, model, module):
attributes_to_consider = list(model.attribute_map)
if "freeform_tags" in attributes_to_consider:
attributes_to_consider.remove("freeform_tags")
# Temporarily removing node_count as the exisiting resource does not reflect it
# Temporarily removing node_count as the existing resource does not reflect it
if "node_count" in attributes_to_consider:
attributes_to_consider.remove("node_count")
_debug("attributes to consider: {0}".format(attributes_to_consider))
@@ -936,9 +936,9 @@ def tuplize(d):
list_of_tuples = []
key_list = sorted(list(d.keys()))
for key in key_list:
if type(d[key]) == list:
if isinstance(d[key], list):
# Convert a value which is itself a list of dict to a list of tuples.
if d[key] and type(d[key][0]) == dict:
if d[key] and isinstance(d[key][0], dict):
sub_tuples = []
for sub_dict in d[key]:
sub_tuples.append(tuplize(sub_dict))
@@ -948,7 +948,7 @@ def tuplize(d):
list_of_tuples.append((sub_tuples is None, key, sub_tuples))
else:
list_of_tuples.append((d[key] is None, key, d[key]))
elif type(d[key]) == dict:
elif isinstance(d[key], dict):
tupled_value = tuplize(d[key])
list_of_tuples.append((tupled_value is None, key, tupled_value))
else:
@@ -969,13 +969,13 @@ def sort_dictionary(d):
"""
sorted_d = {}
for key in d:
if type(d[key]) == list:
if d[key] and type(d[key][0]) == dict:
if isinstance(d[key], list):
if d[key] and isinstance(d[key][0], dict):
sorted_value = sort_list_of_dictionary(d[key])
sorted_d[key] = sorted_value
else:
sorted_d[key] = sorted(d[key])
elif type(d[key]) == dict:
elif isinstance(d[key], dict):
sorted_d[key] = sort_dictionary(d[key])
else:
sorted_d[key] = d[key]
@@ -1026,10 +1026,7 @@ def check_if_user_value_matches_resources_attr(
return
if (
resources_value_for_attr is None
and len(user_provided_value_for_attr) >= 0
or user_provided_value_for_attr is None
and len(resources_value_for_attr) >= 0
resources_value_for_attr is None or user_provided_value_for_attr is None
):
res[0] = False
return
@@ -1044,7 +1041,7 @@ def check_if_user_value_matches_resources_attr(
if (
user_provided_value_for_attr
and type(user_provided_value_for_attr[0]) == dict
and isinstance(user_provided_value_for_attr[0], dict)
):
# Process a list of dict
sorted_user_provided_value_for_attr = sort_list_of_dictionary(
@@ -1532,7 +1529,7 @@ def delete_and_wait(
result[resource_type] = resource
return result
# oci.wait_until() returns an instance of oci.util.Sentinel in case the resource is not found.
if type(wait_response) is not Sentinel:
if not isinstance(wait_response, Sentinel):
resource = to_dict(wait_response.data)
else:
resource["lifecycle_state"] = "DELETED"
@@ -1547,7 +1544,7 @@ def delete_and_wait(
except ServiceError as ex:
# DNS API throws a 400 InvalidParameter when a zone id is provided for zone_name_or_id and if the zone
# resource is not available, instead of the expected 404. So working around this for now.
if type(client) == oci.dns.DnsClient:
if isinstance(client, oci.dns.DnsClient):
if ex.status == 400 and ex.code == "InvalidParameter":
_debug(
"Resource {0} with {1} already deleted. So returning changed=False".format(
@@ -1774,7 +1771,7 @@ def update_class_type_attr_difference(
):
"""
Checks the difference and updates an attribute which is represented by a class
instance. Not aplicable if the attribute type is a primitive value.
instance. Not applicable if the attribute type is a primitive value.
For example, if a class name is A with an attribute x, then if A.x = X(), then only
this method works.
:param update_class_details The instance which should be updated if there is change in
@@ -1936,7 +1933,7 @@ def get_target_resource_from_list(
module, list_resource_fn, target_resource_id=None, **kwargs
):
"""
Returns a resource filtered by identifer from a list of resources. This method should be
Returns a resource filtered by identifier from a list of resources. This method should be
used as an alternative of 'get resource' method when 'get resource' is nor provided by
resource api. This method returns a wrapper of response object but that should not be
used as an input to 'wait_until' utility as this is only a partial wrapper of response object.

View File

@@ -42,7 +42,7 @@ def pipx_runner(module, command, **kwargs):
system_site_packages=fmt.as_bool("--system-site-packages"),
_list=fmt.as_fixed(['list', '--include-injected', '--json']),
editable=fmt.as_bool("--editable"),
pip_args=fmt.as_opt_val('--pip-args'),
pip_args=fmt.as_opt_eq_val('--pip-args'),
),
environ_update={'USE_EMOJI': '0'},
check_rc=True,

View File

@@ -10,6 +10,8 @@ import json
import os
import random
import string
import gzip
from io import BytesIO
from ansible.module_utils.urls import open_url
from ansible.module_utils.common.text.converters import to_native
from ansible.module_utils.common.text.converters import to_text
@@ -128,8 +130,10 @@ class RedfishUtils(object):
return resp
# The following functions are to send GET/POST/PATCH/DELETE requests
def get_request(self, uri):
def get_request(self, uri, override_headers=None):
req_headers = dict(GET_HEADERS)
if override_headers:
req_headers.update(override_headers)
username, password, basic_auth = self._auth_params(req_headers)
try:
# Service root is an unauthenticated resource; remove credentials
@@ -141,8 +145,13 @@ class RedfishUtils(object):
force_basic_auth=basic_auth, validate_certs=False,
follow_redirects='all',
use_proxy=True, timeout=self.timeout)
data = json.loads(to_native(resp.read()))
headers = dict((k.lower(), v) for (k, v) in resp.info().items())
if override_headers:
resp = gzip.open(BytesIO(resp.read()), 'rt', encoding='utf-8')
data = json.loads(to_native(resp.read()))
headers = req_headers
else:
data = json.loads(to_native(resp.read()))
headers = dict((k.lower(), v) for (k, v) in resp.info().items())
except HTTPError as e:
msg = self._get_extended_message(e)
return {'ret': False,
@@ -318,7 +327,7 @@ class RedfishUtils(object):
found in ansible.module_utils.urls, but it takes files and encodes them
as Base64 strings, which is not expected by Redfish services. It also
adds escaping of certain bytes in the payload, such as inserting '\r'
any time it finds a standlone '\n', which corrupts the image payload
any time it finds a standalone '\n', which corrupts the image payload
send to the service. This implementation is simplified to Redfish's
usage and doesn't necessarily represent an exhaustive method of
building multipart requests.
@@ -717,7 +726,8 @@ class RedfishUtils(object):
properties = ['CacheSummary', 'FirmwareVersion', 'Identifiers',
'Location', 'Manufacturer', 'Model', 'Name', 'Id',
'PartNumber', 'SerialNumber', 'SpeedGbps', 'Status']
key = "StorageControllers"
key = "Controllers"
deprecated_key = "StorageControllers"
# Find Storage service
response = self.get_request(self.root_uri + systems_uri)
@@ -745,7 +755,30 @@ class RedfishUtils(object):
data = response['data']
if key in data:
controller_list = data[key]
controllers_uri = data[key][u'@odata.id']
response = self.get_request(self.root_uri + controllers_uri)
if response['ret'] is False:
return response
result['ret'] = True
data = response['data']
if data[u'Members']:
for controller_member in data[u'Members']:
controller_member_uri = controller_member[u'@odata.id']
response = self.get_request(self.root_uri + controller_member_uri)
if response['ret'] is False:
return response
result['ret'] = True
data = response['data']
controller_result = {}
for property in properties:
if property in data:
controller_result[property] = data[property]
controller_results.append(controller_result)
elif deprecated_key in data:
controller_list = data[deprecated_key]
for controller in controller_list:
controller_result = {}
for property in properties:
@@ -767,7 +800,7 @@ class RedfishUtils(object):
properties = ['BlockSizeBytes', 'CapableSpeedGbs', 'CapacityBytes',
'EncryptionAbility', 'EncryptionStatus',
'FailurePredicted', 'HotspareType', 'Id', 'Identifiers',
'Manufacturer', 'MediaType', 'Model', 'Name',
'Links', 'Manufacturer', 'MediaType', 'Model', 'Name',
'PartNumber', 'PhysicalLocation', 'Protocol', 'Revision',
'RotationSpeedRPM', 'SerialNumber', 'Status']
@@ -800,7 +833,25 @@ class RedfishUtils(object):
return response
data = response['data']
controller_name = 'Controller 1'
if 'StorageControllers' in data:
if 'Controllers' in data:
controllers_uri = data['Controllers'][u'@odata.id']
response = self.get_request(self.root_uri + controllers_uri)
if response['ret'] is False:
return response
result['ret'] = True
cdata = response['data']
if cdata[u'Members']:
controller_member_uri = cdata[u'Members'][0][u'@odata.id']
response = self.get_request(self.root_uri + controller_member_uri)
if response['ret'] is False:
return response
result['ret'] = True
cdata = response['data']
controller_name = cdata['Name']
elif 'StorageControllers' in data:
sc = data['StorageControllers']
if sc:
if 'Name' in sc[0]:
@@ -819,7 +870,12 @@ class RedfishUtils(object):
for property in properties:
if property in data:
if data[property] is not None:
drive_result[property] = data[property]
if property == "Links":
if "Volumes" in data["Links"].keys():
volumes = [v["@odata.id"] for v in data["Links"]["Volumes"]]
drive_result["Volumes"] = volumes
else:
drive_result[property] = data[property]
drive_results.append(drive_result)
drives = {'Controller': controller_name,
'Drives': drive_results}
@@ -904,15 +960,7 @@ class RedfishUtils(object):
return response
data = response['data']
controller_name = 'Controller %s' % str(idx)
if 'StorageControllers' in data:
sc = data['StorageControllers']
if sc:
if 'Name' in sc[0]:
controller_name = sc[0]['Name']
else:
sc_id = sc[0].get('Id', '1')
controller_name = 'Controller %s' % sc_id
elif 'Controllers' in data:
if 'Controllers' in data:
response = self.get_request(self.root_uri + data['Controllers'][u'@odata.id'])
if response['ret'] is False:
return response
@@ -930,6 +978,14 @@ class RedfishUtils(object):
else:
controller_id = member_data.get('Id', '1')
controller_name = 'Controller %s' % controller_id
elif 'StorageControllers' in data:
sc = data['StorageControllers']
if sc:
if 'Name' in sc[0]:
controller_name = sc[0]['Name']
else:
sc_id = sc[0].get('Id', '1')
controller_name = 'Controller %s' % sc_id
volume_results = []
volume_list = []
if 'Volumes' in data:
@@ -1032,7 +1088,12 @@ class RedfishUtils(object):
# command should be PowerOn, PowerForceOff, etc.
if not command.startswith('Power'):
return {'ret': False, 'msg': 'Invalid Command (%s)' % command}
reset_type = command[5:]
# Commands (except PowerCycle) will be stripped of the 'Power' prefix
if command == 'PowerCycle':
reset_type = command
else:
reset_type = command[5:]
# map Reboot to a ResetType that does a reboot
if reset_type == 'Reboot':
@@ -1499,29 +1560,37 @@ class RedfishUtils(object):
def _software_inventory(self, uri):
result = {}
response = self.get_request(self.root_uri + uri)
if response['ret'] is False:
return response
result['ret'] = True
data = response['data']
result['entries'] = []
for member in data[u'Members']:
uri = self.root_uri + member[u'@odata.id']
# Get details for each software or firmware member
response = self.get_request(uri)
while uri:
response = self.get_request(self.root_uri + uri)
if response['ret'] is False:
return response
result['ret'] = True
data = response['data']
software = {}
# Get these standard properties if present
for key in ['Name', 'Id', 'Status', 'Version', 'Updateable',
'SoftwareId', 'LowestSupportedVersion', 'Manufacturer',
'ReleaseDate']:
if key in data:
software[key] = data.get(key)
result['entries'].append(software)
if data.get('Members@odata.nextLink'):
uri = data.get('Members@odata.nextLink')
else:
uri = None
for member in data[u'Members']:
fw_uri = self.root_uri + member[u'@odata.id']
# Get details for each software or firmware member
response = self.get_request(fw_uri)
if response['ret'] is False:
return response
result['ret'] = True
data = response['data']
software = {}
# Get these standard properties if present
for key in ['Name', 'Id', 'Status', 'Version', 'Updateable',
'SoftwareId', 'LowestSupportedVersion', 'Manufacturer',
'ReleaseDate']:
if key in data:
software[key] = data.get(key)
result['entries'].append(software)
return result
def get_firmware_inventory(self):
@@ -1589,7 +1658,10 @@ class RedfishUtils(object):
# Scan the messages to see if next steps are needed
for message in operation_results['messages']:
message_id = message['MessageId']
message_id = message.get('MessageId')
if message_id is None:
# While this is invalid, treat the lack of a MessageId as "no message"
continue
if message_id.startswith('Update.1.') and message_id.endswith('.OperationTransitionedToJob'):
# Operation rerouted to a job; update the status and handle
@@ -1685,6 +1757,7 @@ class RedfishUtils(object):
image_file = update_opts.get('update_image_file')
targets = update_opts.get('update_targets')
apply_time = update_opts.get('update_apply_time')
oem_params = update_opts.get('update_oem_params')
# Ensure the image file is provided
if not image_file:
@@ -1715,6 +1788,8 @@ class RedfishUtils(object):
payload["Targets"] = targets
if apply_time:
payload["@Redfish.OperationApplyTime"] = apply_time
if oem_params:
payload["Oem"] = oem_params
multipart_payload = {
'UpdateParameters': {'content': json.dumps(payload), 'mime_type': 'application/json'},
'UpdateFile': {'filename': image_file, 'content': image_payload, 'mime_type': 'application/octet-stream'}
@@ -2400,7 +2475,7 @@ class RedfishUtils(object):
result = {}
properties = ['Name', 'Id', 'Description', 'FQDN', 'IPv4Addresses', 'IPv6Addresses',
'NameServers', 'MACAddress', 'PermanentMACAddress',
'SpeedMbps', 'MTUSize', 'AutoNeg', 'Status']
'SpeedMbps', 'MTUSize', 'AutoNeg', 'Status', 'LinkStatus']
response = self.get_request(self.root_uri + resource_uri)
if response['ret'] is False:
return response
@@ -3289,7 +3364,7 @@ class RedfishUtils(object):
result = {}
inventory = {}
# Get these entries, but does not fail if not found
properties = ['FirmwareVersion', 'ManagerType', 'Manufacturer', 'Model',
properties = ['Id', 'FirmwareVersion', 'ManagerType', 'Manufacturer', 'Model',
'PartNumber', 'PowerState', 'SerialNumber', 'Status', 'UUID']
response = self.get_request(self.root_uri + manager_uri)
@@ -3372,6 +3447,25 @@ class RedfishUtils(object):
return self.patch_request(self.root_uri + secure_boot_url, body, check_pyld=True)
def set_secure_boot(self, secure_boot_enable):
# This function enable Secure Boot on an OOB controller
response = self.get_request(self.root_uri + self.systems_uri)
if response["ret"] is False:
return response
server_details = response["data"]
secure_boot_url = server_details["SecureBoot"]["@odata.id"]
response = self.get_request(self.root_uri + secure_boot_url)
if response["ret"] is False:
return response
body = {}
body["SecureBootEnable"] = secure_boot_enable
return self.patch_request(self.root_uri + secure_boot_url, body, check_pyld=True)
def get_hpe_thermal_config(self):
result = {}
key = "Thermal"
@@ -3403,3 +3497,238 @@ class RedfishUtils(object):
fan_percent_min_config = hpe.get('FanPercentMinimum')
result["fan_percent_min"] = fan_percent_min_config
return result
def delete_volumes(self, storage_subsystem_id, volume_ids):
# Find the Storage resource from the requested ComputerSystem resource
response = self.get_request(self.root_uri + self.systems_uri)
if response['ret'] is False:
return response
data = response['data']
storage_uri = data.get('Storage', {}).get('@odata.id')
if storage_uri is None:
return {'ret': False, 'msg': 'Storage resource not found'}
# Get Storage Collection
response = self.get_request(self.root_uri + storage_uri)
if response['ret'] is False:
return response
data = response['data']
# Collect Storage Subsystems
self.storage_subsystems_uris = [i['@odata.id'] for i in response['data'].get('Members', [])]
if not self.storage_subsystems_uris:
return {
'ret': False,
'msg': "StorageCollection's Members array is either empty or missing"}
# Matching Storage Subsystem ID with user input
self.storage_subsystem_uri = ""
for storage_subsystem_uri in self.storage_subsystems_uris:
if storage_subsystem_uri.split("/")[-2] == storage_subsystem_id:
self.storage_subsystem_uri = storage_subsystem_uri
if not self.storage_subsystem_uri:
return {
'ret': False,
'msg': "Provided Storage Subsystem ID %s does not exist on the server" % storage_subsystem_id}
# Get Volume Collection
response = self.get_request(self.root_uri + self.storage_subsystem_uri)
if response['ret'] is False:
return response
data = response['data']
response = self.get_request(self.root_uri + data['Volumes']['@odata.id'])
if response['ret'] is False:
return response
data = response['data']
# Collect Volumes
self.volume_uris = [i['@odata.id'] for i in response['data'].get('Members', [])]
if not self.volume_uris:
return {
'ret': True, 'changed': False,
'msg': "VolumeCollection's Members array is either empty or missing"}
# Delete each volume
for volume in self.volume_uris:
if volume.split("/")[-1] in volume_ids:
response = self.delete_request(self.root_uri + volume)
if response['ret'] is False:
return response
return {'ret': True, 'changed': True,
'msg': "The following volumes were deleted: %s" % str(volume_ids)}
def create_volume(self, volume_details, storage_subsystem_id):
# Find the Storage resource from the requested ComputerSystem resource
response = self.get_request(self.root_uri + self.systems_uri)
if response['ret'] is False:
return response
data = response['data']
storage_uri = data.get('Storage', {}).get('@odata.id')
if storage_uri is None:
return {'ret': False, 'msg': 'Storage resource not found'}
# Get Storage Collection
response = self.get_request(self.root_uri + storage_uri)
if response['ret'] is False:
return response
data = response['data']
# Collect Storage Subsystems
self.storage_subsystems_uris = [i['@odata.id'] for i in response['data'].get('Members', [])]
if not self.storage_subsystems_uris:
return {
'ret': False,
'msg': "StorageCollection's Members array is either empty or missing"}
# Matching Storage Subsystem ID with user input
self.storage_subsystem_uri = ""
for storage_subsystem_uri in self.storage_subsystems_uris:
if storage_subsystem_uri.split("/")[-2] == storage_subsystem_id:
self.storage_subsystem_uri = storage_subsystem_uri
if not self.storage_subsystem_uri:
return {
'ret': False,
'msg': "Provided Storage Subsystem ID %s does not exist on the server" % storage_subsystem_id}
# Validate input parameters
required_parameters = ['RAIDType', 'Drives', 'CapacityBytes']
allowed_parameters = ['DisplayName', 'InitializeMethod', 'MediaSpanCount',
'Name', 'ReadCachePolicy', 'StripSizeBytes', 'VolumeUsage', 'WriteCachePolicy']
for parameter in required_parameters:
if not volume_details.get(parameter):
return {
'ret': False,
'msg': "%s are required parameter to create a volume" % str(required_parameters)}
# Navigate to the volume uri of the correct storage subsystem
response = self.get_request(self.root_uri + self.storage_subsystem_uri)
if response['ret'] is False:
return response
data = response['data']
# Deleting any volumes of RAIDType None present on the Storage Subsystem
response = self.get_request(self.root_uri + data['Volumes']['@odata.id'])
if response['ret'] is False:
return response
volume_data = response['data']
if "Members" in volume_data:
for member in volume_data["Members"]:
response = self.get_request(self.root_uri + member['@odata.id'])
if response['ret'] is False:
return response
member_data = response['data']
if member_data["RAIDType"] == "None":
response = self.delete_request(self.root_uri + member['@odata.id'])
if response['ret'] is False:
return response
# Construct payload and issue POST command to create volume
volume_details["Links"] = {}
volume_details["Links"]["Drives"] = []
for drive in volume_details["Drives"]:
volume_details["Links"]["Drives"].append({"@odata.id": drive})
del volume_details["Drives"]
payload = volume_details
response = self.post_request(self.root_uri + data['Volumes']['@odata.id'], payload)
if response['ret'] is False:
return response
return {'ret': True, 'changed': True,
'msg': "Volume Created"}
def get_bios_registries(self):
# Get /redfish/v1
response = self.get_request(self.root_uri + self.systems_uri)
if not response["ret"]:
return response
server_details = response["data"]
# Get Registries URI
if "Bios" not in server_details:
msg = "Getting BIOS URI failed, Key 'Bios' not found in /redfish/v1/Systems/1/ response: %s"
return {
"ret": False,
"msg": msg % str(server_details)
}
bios_uri = server_details["Bios"]["@odata.id"]
bios_resp = self.get_request(self.root_uri + bios_uri)
if not bios_resp["ret"]:
return bios_resp
bios_data = bios_resp["data"]
attribute_registry = bios_data["AttributeRegistry"]
reg_uri = self.root_uri + self.service_root + "Registries/" + attribute_registry
reg_resp = self.get_request(reg_uri)
if not reg_resp["ret"]:
return reg_resp
reg_data = reg_resp["data"]
# Get BIOS attribute registry URI
lst = []
# Get the location URI
response = self.check_location_uri(reg_data, reg_uri)
if not response["ret"]:
return response
rsp_data, rsp_uri = response["rsp_data"], response["rsp_uri"]
if "RegistryEntries" not in rsp_data:
return {
"msg": "'RegistryEntries' not present in %s response, %s" % (rsp_uri, str(rsp_data)),
"ret": False
}
return {
"bios_registry": rsp_data,
"bios_registry_uri": rsp_uri,
"ret": True
}
def check_location_uri(self, resp_data, resp_uri):
# Get the location URI response
# return {"msg": self.creds, "ret": False}
vendor = self._get_vendor()['Vendor']
rsp_uri = ""
for loc in resp_data['Location']:
if loc['Language'] == "en":
rsp_uri = loc['Uri']
if vendor == 'HPE':
# WORKAROUND
# HPE systems with iLO 4 will have BIOS Attribute Registries location URI as a dictionary with key 'extref'
# Hence adding condition to fetch the Uri
if isinstance(loc['Uri'], dict) and "extref" in loc['Uri'].keys():
rsp_uri = loc['Uri']['extref']
if not rsp_uri:
msg = "Language 'en' not found in BIOS Attribute Registries location, URI: %s, response: %s"
return {
"ret": False,
"msg": msg % (resp_uri, str(resp_data))
}
res = self.get_request(self.root_uri + rsp_uri)
if res['ret'] is False:
# WORKAROUND
# HPE systems with iLO 4 or iLO5 compresses (gzip) for some URIs
# Hence adding encoding to the header
if vendor == 'HPE':
override_headers = {"Accept-Encoding": "gzip"}
res = self.get_request(self.root_uri + rsp_uri, override_headers=override_headers)
if res['ret']:
return {
"ret": True,
"rsp_data": res["data"],
"rsp_uri": rsp_uri
}
return res

View File

@@ -303,7 +303,7 @@ class Scaleway(object):
wait_timeout = self.module.params["wait_timeout"]
wait_sleep_time = self.module.params["wait_sleep_time"]
# Prevent requesting the ressource status too soon
# Prevent requesting the resource status too soon
time.sleep(wait_sleep_time)
start = datetime.datetime.utcnow()

View File

@@ -49,7 +49,7 @@ class _Variable(object):
output (bool, optional): flag indicating whether the variable should be in the output of the module. Defaults to None.
diff (bool, optional): flag indicating whether to generate diff mode output for this variable. Defaults to None.
change (bool, optional): flag indicating whether to track if changes happened to this variable. Defaults to None.
fact (bool, optional): flag indicating whether the varaiable should be exposed as a fact of the module. Defaults to None.
fact (bool, optional): flag indicating whether the variable should be exposed as a fact of the module. Defaults to None.
initial_value (any, optional): initial value of the variable, to be used with `change`. Defaults to NOTHING.
verbosity (int, optional): level of verbosity in which this variable is reported by the module as `output`, `fact` or `diff`. Defaults to None.
"""
@@ -127,7 +127,7 @@ class VarDict(object):
output (bool, optional): flag indicating whether the variable should be in the output of the module. Defaults to None.
diff (bool, optional): flag indicating whether to generate diff mode output for this variable. Defaults to None.
change (bool, optional): flag indicating whether to track if changes happened to this variable. Defaults to None.
fact (bool, optional): flag indicating whether the varaiable should be exposed as a fact of the module. Defaults to None.
fact (bool, optional): flag indicating whether the variable should be exposed as a fact of the module. Defaults to None.
initial_value (any, optional): initial value of the variable, to be used with `change`. Defaults to NOTHING.
verbosity (int, optional): level of verbosity in which this variable is reported by the module as `output`, `fact` or `diff`. Defaults to None.
"""

View File

@@ -182,7 +182,7 @@ class WdcRedfishUtils(RedfishUtils):
:param str bundle_uri: HTTP URI of the firmware bundle.
:return: Firmware version number contained in the bundle, and whether or not the bundle is multi-tenant.
Either value will be None if unable to deterine.
Either value will be None if unable to determine.
:rtype: str or None, bool or None
"""
bundle_temp_filename = fetch_file(module=self.module,

View File

@@ -204,7 +204,7 @@ def main():
":" + module.params['action'] + ":" + module.params['command']
# If current entry exists or fields are different(if the entry does not
# exists, then the entry wil be created
# exists, then the entry will be created
if (not current_entry['exist']) or (
module.params['runlevel'] != current_entry['runlevel'] or
module.params['action'] != current_entry['action'] or

View File

@@ -154,7 +154,7 @@ def _get_ctl_binary(module):
if ctl_binary is not None:
return ctl_binary
module.fail_json(msg="Neither of apache2ctl nor apachctl found. At least one apache control binary is necessary.")
module.fail_json(msg="Neither of apache2ctl nor apachectl found. At least one apache control binary is necessary.")
def _module_is_enabled(module):

View File

@@ -25,6 +25,12 @@ attributes:
diff_mode:
support: none
options:
executable:
description:
- Path to the C(cargo) installed in the system.
- If not specified, the module will look C(cargo) in E(PATH).
type: path
version_added: 7.5.0
name:
description:
- The name of a Rust package to install.
@@ -44,6 +50,14 @@ options:
try to install all of them in this version.
type: str
required: false
locked:
description:
- Install with locked dependencies.
- This is only used when installing packages.
required: false
type: bool
default: false
version_added: 7.5.0
state:
description:
- The state of the Rust package.
@@ -52,7 +66,7 @@ options:
default: present
choices: [ "present", "absent", "latest" ]
requirements:
- cargo installed in bin path (recommended /usr/local/bin)
- cargo installed
"""
EXAMPLES = r"""
@@ -60,6 +74,11 @@ EXAMPLES = r"""
community.general.cargo:
name: ludusavi
- name: Install "ludusavi" Rust package with locked dependencies
community.general.cargo:
name: ludusavi
locked: true
- name: Install "ludusavi" Rust package in version 0.10.0
community.general.cargo:
name: ludusavi
@@ -90,12 +109,12 @@ from ansible.module_utils.basic import AnsibleModule
class Cargo(object):
def __init__(self, module, **kwargs):
self.module = module
self.executable = [kwargs["executable"] or module.get_bin_path("cargo", True)]
self.name = kwargs["name"]
self.path = kwargs["path"]
self.state = kwargs["state"]
self.version = kwargs["version"]
self.executable = [module.get_bin_path("cargo", True)]
self.locked = kwargs["locked"]
@property
def path(self):
@@ -132,6 +151,8 @@ class Cargo(object):
def install(self, packages=None):
cmd = ["install"]
cmd.extend(packages or self.name)
if self.locked:
cmd.append("--locked")
if self.path:
cmd.append("--root")
cmd.append(self.path)
@@ -160,15 +181,16 @@ class Cargo(object):
def main():
arg_spec = dict(
executable=dict(default=None, type="path"),
name=dict(required=True, type="list", elements="str"),
path=dict(default=None, type="path"),
state=dict(default="present", choices=["present", "absent", "latest"]),
version=dict(default=None, type="str"),
locked=dict(default=False, type="bool"),
)
module = AnsibleModule(argument_spec=arg_spec, supports_check_mode=True)
name = module.params["name"]
path = module.params["path"]
state = module.params["state"]
version = module.params["version"]
@@ -180,7 +202,7 @@ def main():
LANG="C", LC_ALL="C", LC_MESSAGES="C", LC_CTYPE="C"
)
cargo = Cargo(module, name=name, path=path, state=state, version=version)
cargo = Cargo(module, **module.params)
changed, out, err = False, None, None
installed_packages = cargo.get_installed()
if state == "present":

View File

@@ -1501,7 +1501,7 @@ class ClcServer:
return aa_policy_id
#
# This is the function that gets patched to the Request.server object using a lamda closure
# This is the function that gets patched to the Request.server object using a lambda closure
#
@staticmethod

View File

@@ -138,6 +138,7 @@ options:
description:
- The type of DNS record to create. Required if O(state=present).
- O(type=DS), O(type=SSHFP), and O(type=TLSA) were added in Ansible 2.7.
- Note that V(SPF) is no longer supported by CloudFlare. Support for it will be removed from community.general 9.0.0.
type: str
choices: [ A, AAAA, CNAME, DS, MX, NS, SPF, SRV, SSHFP, TLSA, TXT ]
value:
@@ -613,7 +614,7 @@ class CloudflareAPI(object):
content = str(params['key_tag']) + '\t' + str(params['algorithm']) + '\t' + str(params['hash_type']) + '\t' + params['value']
elif params['type'] == 'SSHFP':
if not (params['value'] is None or params['value'] == ''):
content = str(params['algorithm']) + '\t' + str(params['hash_type']) + '\t' + params['value']
content = str(params['algorithm']) + ' ' + str(params['hash_type']) + ' ' + params['value'].upper()
elif params['type'] == 'TLSA':
if not (params['value'] is None or params['value'] == ''):
content = str(params['cert_usage']) + '\t' + str(params['selector']) + '\t' + str(params['hash_type']) + '\t' + params['value']
@@ -726,7 +727,7 @@ class CloudflareAPI(object):
if (attr is None) or (attr == ''):
self.module.fail_json(msg="You must provide algorithm, hash_type and a value to create this record type")
sshfp_data = {
"fingerprint": params['value'],
"fingerprint": params['value'].upper(),
"type": params['hash_type'],
"algorithm": params['algorithm'],
}
@@ -736,7 +737,7 @@ class CloudflareAPI(object):
'data': sshfp_data,
"ttl": params['ttl'],
}
search_value = str(params['algorithm']) + '\t' + str(params['hash_type']) + '\t' + params['value']
search_value = str(params['algorithm']) + ' ' + str(params['hash_type']) + ' ' + params['value']
if params['type'] == 'TLSA':
for attr in [params['port'], params['proto'], params['cert_usage'], params['selector'], params['hash_type'], params['value']]:

View File

@@ -170,10 +170,15 @@ def get_available_options(module, command='install'):
return command_help_json['definition']['options']
def composer_command(module, command, arguments="", options=None, global_command=False):
def composer_command(module, command, arguments="", options=None):
if options is None:
options = []
global_command = module.params['global_command']
if not global_command:
options.extend(['--working-dir', "'%s'" % module.params['working_dir']])
if module.params['executable'] is None:
php_path = module.get_bin_path("php", True, ["/usr/local/bin"])
else:
@@ -217,7 +222,6 @@ def main():
module.fail_json(msg="Use the 'arguments' param for passing arguments with the 'command'")
arguments = module.params['arguments']
global_command = module.params['global_command']
available_options = get_available_options(module=module, command=command)
options = []
@@ -234,9 +238,6 @@ def main():
option = "--%s" % option
options.append(option)
if not global_command:
options.extend(['--working-dir', "'%s'" % module.params['working_dir']])
option_params = {
'prefer_source': 'prefer-source',
'prefer_dist': 'prefer-dist',
@@ -260,7 +261,7 @@ def main():
else:
module.exit_json(skipped=True, msg="command '%s' does not support check mode, skipping" % command)
rc, out, err = composer_command(module, command, arguments, options, global_command)
rc, out, err = composer_command(module, command, arguments, options)
if rc != 0:
output = parse_out(err)

View File

@@ -0,0 +1,644 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2022, Håkon Lerring
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
module: consul_role
short_description: Manipulate Consul roles
version_added: 7.5.0
description:
- Allows the addition, modification and deletion of roles in a consul
cluster via the agent. For more details on using and configuring ACLs,
see U(https://www.consul.io/docs/guides/acl.html).
author:
- Håkon Lerring (@Hakon)
extends_documentation_fragment:
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
options:
name:
description:
- A name used to identify the role.
required: true
type: str
state:
description:
- whether the role should be present or absent.
required: false
choices: ['present', 'absent']
default: present
type: str
description:
description:
- Description of the role.
- If not specified, the assigned description will not be changed.
required: false
type: str
policies:
type: list
elements: dict
description:
- List of policies to attach to the role. Each policy is a dict.
- If the parameter is left blank, any policies currently assigned will not be changed.
- Any empty array (V([])) will clear any policies previously set.
required: false
suboptions:
name:
description:
- The name of the policy to attach to this role; see M(community.general.consul_policy) for more info.
- Either this or O(policies[].id) must be specified.
type: str
id:
description:
- The ID of the policy to attach to this role; see M(community.general.consul_policy) for more info.
- Either this or O(policies[].name) must be specified.
type: str
service_identities:
type: list
elements: dict
description:
- List of service identities to attach to the role.
- If not specified, any service identities currently assigned will not be changed.
- If the parameter is an empty array (V([])), any node identities assigned will be unassigned.
required: false
suboptions:
name:
description:
- The name of the node.
- Must not be longer than 256 characters, must start and end with a lowercase alphanumeric character.
- May only contain lowercase alphanumeric characters as well as - and _.
type: str
required: true
datacenters:
description:
- The datacenters the policies will be effective.
- This will result in effective policy only being valid in this datacenter.
- If an empty array (V([])) is specified, the policies will valid in all datacenters.
- including those which do not yet exist but may in the future.
type: list
elements: str
required: true
node_identities:
type: list
elements: dict
description:
- List of node identities to attach to the role.
- If not specified, any node identities currently assigned will not be changed.
- If the parameter is an empty array (V([])), any node identities assigned will be unassigned.
required: false
suboptions:
name:
description:
- The name of the node.
- Must not be longer than 256 characters, must start and end with a lowercase alphanumeric character.
- May only contain lowercase alphanumeric characters as well as - and _.
type: str
required: true
datacenter:
description:
- The nodes datacenter.
- This will result in effective policy only being valid in this datacenter.
type: str
required: true
host:
description:
- Host of the consul agent, defaults to V(localhost).
required: false
default: localhost
type: str
port:
type: int
description:
- The port on which the consul agent is running.
required: false
default: 8500
scheme:
description:
- The protocol scheme on which the consul agent is running.
required: false
default: http
type: str
token:
description:
- A management token is required to manipulate the roles.
type: str
validate_certs:
type: bool
description:
- Whether to verify the TLS certificate of the consul agent.
required: false
default: true
requirements:
- requests
'''
EXAMPLES = """
- name: Create a role with 2 policies
community.general.consul_role:
host: consul1.example.com
token: some_management_acl
name: foo-role
policies:
- id: 783beef3-783f-f41f-7422-7087dc272765
- name: "policy-1"
- name: Create a role with service identity
community.general.consul_role:
host: consul1.example.com
token: some_management_acl
name: foo-role-2
service_identities:
- name: web
datacenters:
- dc1
- name: Create a role with node identity
community.general.consul_role:
host: consul1.example.com
token: some_management_acl
name: foo-role-3
node_identities:
- name: node-1
datacenter: dc2
- name: Remove a role
community.general.consul_role:
host: consul1.example.com
token: some_management_acl
name: foo-role-3
state: absent
"""
RETURN = """
role:
description: The role object.
returned: success
type: dict
sample:
{
"CreateIndex": 39,
"Description": "",
"Hash": "Trt0QJtxVEfvTTIcdTUbIJRr6Dsi6E4EcwSFxx9tCYM=",
"ID": "9a300b8d-48db-b720-8544-a37c0f5dafb5",
"ModifyIndex": 39,
"Name": "foo-role",
"Policies": [
{"ID": "b1a00172-d7a1-0e66-a12e-7a4045c4b774", "Name": "foo-access"}
]
}
operation:
description: The operation performed on the role.
returned: changed
type: str
sample: update
"""
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.basic import missing_required_lib
from ansible_collections.community.general.plugins.module_utils.consul import (
get_consul_url, get_auth_headers, handle_consul_response_error)
import traceback
REQUESTS_IMP_ERR = None
try:
from requests.exceptions import ConnectionError
import requests
HAS_REQUESTS = True
except ImportError:
HAS_REQUESTS = False
REQUESTS_IMP_ERR = traceback.format_exc()
TOKEN_PARAMETER_NAME = "token"
HOST_PARAMETER_NAME = "host"
SCHEME_PARAMETER_NAME = "scheme"
VALIDATE_CERTS_PARAMETER_NAME = "validate_certs"
NAME_PARAMETER_NAME = "name"
DESCRIPTION_PARAMETER_NAME = "description"
PORT_PARAMETER_NAME = "port"
POLICIES_PARAMETER_NAME = "policies"
SERVICE_IDENTITIES_PARAMETER_NAME = "service_identities"
NODE_IDENTITIES_PARAMETER_NAME = "node_identities"
STATE_PARAMETER_NAME = "state"
PRESENT_STATE_VALUE = "present"
ABSENT_STATE_VALUE = "absent"
REMOVE_OPERATION = "remove"
UPDATE_OPERATION = "update"
CREATE_OPERATION = "create"
POLICY_RULE_SPEC = dict(
name=dict(type='str'),
id=dict(type='str'),
)
NODE_ID_RULE_SPEC = dict(
name=dict(type='str', required=True),
datacenter=dict(type='str', required=True),
)
SERVICE_ID_RULE_SPEC = dict(
name=dict(type='str', required=True),
datacenters=dict(type='list', elements='str', required=True),
)
_ARGUMENT_SPEC = {
TOKEN_PARAMETER_NAME: dict(no_log=True),
PORT_PARAMETER_NAME: dict(default=8500, type='int'),
HOST_PARAMETER_NAME: dict(default='localhost'),
SCHEME_PARAMETER_NAME: dict(default='http'),
VALIDATE_CERTS_PARAMETER_NAME: dict(type='bool', default=True),
NAME_PARAMETER_NAME: dict(required=True),
DESCRIPTION_PARAMETER_NAME: dict(required=False, type='str', default=None),
POLICIES_PARAMETER_NAME: dict(type='list', elements='dict', options=POLICY_RULE_SPEC,
mutually_exclusive=[('name', 'id')], required_one_of=[('name', 'id')], default=None),
SERVICE_IDENTITIES_PARAMETER_NAME: dict(type='list', elements='dict', options=SERVICE_ID_RULE_SPEC, default=None),
NODE_IDENTITIES_PARAMETER_NAME: dict(type='list', elements='dict', options=NODE_ID_RULE_SPEC, default=None),
STATE_PARAMETER_NAME: dict(default=PRESENT_STATE_VALUE, choices=[PRESENT_STATE_VALUE, ABSENT_STATE_VALUE]),
}
def compare_consul_api_role_policy_objects(first, second):
# compare two lists of dictionaries, ignoring the ID element
for x in first:
x.pop('ID', None)
for x in second:
x.pop('ID', None)
return first == second
def update_role(role, configuration):
url = '%s/acl/role/%s' % (get_consul_url(configuration),
role['ID'])
headers = get_auth_headers(configuration)
update_role_data = {
'Name': configuration.name,
'Description': configuration.description,
}
# check if the user omitted the description, policies, service identities, or node identities
description_specified = configuration.description is not None
policy_specified = True
if len(configuration.policies) == 1 and configuration.policies[0] is None:
policy_specified = False
service_id_specified = True
if len(configuration.service_identities) == 1 and configuration.service_identities[0] is None:
service_id_specified = False
node_id_specified = True
if len(configuration.node_identities) == 1 and configuration.node_identities[0] is None:
node_id_specified = False
if description_specified:
update_role_data["Description"] = configuration.description
if policy_specified:
update_role_data["Policies"] = [x.to_dict() for x in configuration.policies]
if configuration.version >= ConsulVersion("1.5.0") and service_id_specified:
update_role_data["ServiceIdentities"] = [
x.to_dict() for x in configuration.service_identities]
if configuration.version >= ConsulVersion("1.8.0") and node_id_specified:
update_role_data["NodeIdentities"] = [
x.to_dict() for x in configuration.node_identities]
if configuration.check_mode:
description_changed = False
if description_specified:
description_changed = role.get('Description') != update_role_data["Description"]
else:
update_role_data["Description"] = role.get("Description")
policies_changed = False
if policy_specified:
policies_changed = not (
compare_consul_api_role_policy_objects(role.get('Policies', []), update_role_data.get('Policies', [])))
else:
if role.get('Policies') is not None:
update_role_data["Policies"] = role.get('Policies')
service_ids_changed = False
if service_id_specified:
service_ids_changed = role.get('ServiceIdentities') != update_role_data.get('ServiceIdentities')
else:
if role.get('ServiceIdentities') is not None:
update_role_data["ServiceIdentities"] = role.get('ServiceIdentities')
node_ids_changed = False
if node_id_specified:
node_ids_changed = role.get('NodeIdentities') != update_role_data.get('NodeIdentities')
else:
if role.get('NodeIdentities'):
update_role_data["NodeIdentities"] = role.get('NodeIdentities')
changed = (
description_changed or
policies_changed or
service_ids_changed or
node_ids_changed
)
return Output(changed=changed, operation=UPDATE_OPERATION, role=update_role_data)
else:
# if description, policies, service or node id are not specified; we need to get the existing value and apply it
if not description_specified and role.get('Description') is not None:
update_role_data["Description"] = role.get('Description')
if not policy_specified and role.get('Policies') is not None:
update_role_data["Policies"] = role.get('Policies')
if not service_id_specified and role.get('ServiceIdentities') is not None:
update_role_data["ServiceIdentities"] = role.get('ServiceIdentities')
if not node_id_specified and role.get('NodeIdentities') is not None:
update_role_data["NodeIdentities"] = role.get('NodeIdentities')
response = requests.put(url, headers=headers, json=update_role_data, verify=configuration.validate_certs)
handle_consul_response_error(response)
resulting_role = response.json()
changed = (
role['Description'] != resulting_role['Description'] or
role.get('Policies', None) != resulting_role.get('Policies', None) or
role.get('ServiceIdentities', None) != resulting_role.get('ServiceIdentities', None) or
role.get('NodeIdentities', None) != resulting_role.get('NodeIdentities', None)
)
return Output(changed=changed, operation=UPDATE_OPERATION, role=resulting_role)
def create_role(configuration):
url = '%s/acl/role' % get_consul_url(configuration)
headers = get_auth_headers(configuration)
# check if the user omitted policies, service identities, or node identities
policy_specified = True
if len(configuration.policies) == 1 and configuration.policies[0] is None:
policy_specified = False
service_id_specified = True
if len(configuration.service_identities) == 1 and configuration.service_identities[0] is None:
service_id_specified = False
node_id_specified = True
if len(configuration.node_identities) == 1 and configuration.node_identities[0] is None:
node_id_specified = False
# get rid of None item so we can set an empty list for policies, service identities and node identities
if not policy_specified:
configuration.policies.pop()
if not service_id_specified:
configuration.service_identities.pop()
if not node_id_specified:
configuration.node_identities.pop()
create_role_data = {
'Name': configuration.name,
'Description': configuration.description,
'Policies': [x.to_dict() for x in configuration.policies],
}
if configuration.version >= ConsulVersion("1.5.0"):
create_role_data["ServiceIdentities"] = [x.to_dict() for x in configuration.service_identities]
if configuration.version >= ConsulVersion("1.8.0"):
create_role_data["NodeIdentities"] = [x.to_dict() for x in configuration.node_identities]
if not configuration.check_mode:
response = requests.put(url, headers=headers, json=create_role_data, verify=configuration.validate_certs)
handle_consul_response_error(response)
resulting_role = response.json()
return Output(changed=True, operation=CREATE_OPERATION, role=resulting_role)
else:
return Output(changed=True, operation=CREATE_OPERATION)
def remove_role(configuration):
roles = get_roles(configuration)
if configuration.name in roles:
role_id = roles[configuration.name]['ID']
if not configuration.check_mode:
url = '%s/acl/role/%s' % (get_consul_url(configuration), role_id)
headers = get_auth_headers(configuration)
response = requests.delete(url, headers=headers, verify=configuration.validate_certs)
handle_consul_response_error(response)
changed = True
else:
changed = False
return Output(changed=changed, operation=REMOVE_OPERATION)
def get_roles(configuration):
url = '%s/acl/roles' % get_consul_url(configuration)
headers = get_auth_headers(configuration)
response = requests.get(url, headers=headers, verify=configuration.validate_certs)
handle_consul_response_error(response)
roles = response.json()
existing_roles_mapped_by_id = dict((role['Name'], role) for role in roles if role['Name'] is not None)
return existing_roles_mapped_by_id
def get_consul_version(configuration):
url = '%s/agent/self' % get_consul_url(configuration)
headers = get_auth_headers(configuration)
response = requests.get(url, headers=headers, verify=configuration.validate_certs)
handle_consul_response_error(response)
config = response.json()["Config"]
return ConsulVersion(config["Version"])
def set_role(configuration):
roles = get_roles(configuration)
if configuration.name in roles:
role = roles[configuration.name]
return update_role(role, configuration)
else:
return create_role(configuration)
class ConsulVersion:
def __init__(self, version_string):
split = version_string.split('.')
self.major = split[0]
self.minor = split[1]
self.patch = split[2]
def __ge__(self, other):
return int(self.major + self.minor +
self.patch) >= int(other.major + other.minor + other.patch)
def __le__(self, other):
return int(self.major + self.minor +
self.patch) <= int(other.major + other.minor + other.patch)
class ServiceIdentity:
def __init__(self, input):
if not isinstance(input, dict) or 'name' not in input:
raise ValueError(
"Each element of service_identities must be a dict with the keys name and optionally datacenters")
self.name = input["name"]
self.datacenters = input["datacenters"] if "datacenters" in input else None
def to_dict(self):
return {
"ServiceName": self.name,
"Datacenters": self.datacenters
}
class NodeIdentity:
def __init__(self, input):
if not isinstance(input, dict) or 'name' not in input:
raise ValueError(
"Each element of node_identities must be a dict with the keys name and optionally datacenter")
self.name = input["name"]
self.datacenter = input["datacenter"] if "datacenter" in input else None
def to_dict(self):
return {
"NodeName": self.name,
"Datacenter": self.datacenter
}
class RoleLink:
def __init__(self, dict):
self.id = dict.get("id", None)
self.name = dict.get("name", None)
def to_dict(self):
return {
"ID": self.id,
"Name": self.name
}
class PolicyLink:
def __init__(self, dict):
self.id = dict.get("id", None)
self.name = dict.get("name", None)
def to_dict(self):
return {
"ID": self.id,
"Name": self.name
}
class Configuration:
"""
Configuration for this module.
"""
def __init__(self, token=None, host=None, scheme=None, validate_certs=None, name=None, description=None, port=None,
policies=None, service_identities=None, node_identities=None, state=None, check_mode=None):
self.token = token # type: str
self.host = host # type: str
self.port = port # type: int
self.scheme = scheme # type: str
self.validate_certs = validate_certs # type: bool
self.name = name # type: str
self.description = description # type: str
if policies is not None:
self.policies = [PolicyLink(p) for p in policies] # type: list(PolicyLink)
else:
self.policies = [None]
if service_identities is not None:
self.service_identities = [ServiceIdentity(s) for s in service_identities] # type: list(ServiceIdentity)
else:
self.service_identities = [None]
if node_identities is not None:
self.node_identities = [NodeIdentity(n) for n in node_identities] # type: list(NodeIdentity)
else:
self.node_identities = [None]
self.state = state # type: str
self.check_mode = check_mode # type: bool
class Output:
"""
Output of an action of this module.
"""
def __init__(self, changed=None, operation=None, role=None):
self.changed = changed # type: bool
self.operation = operation # type: str
self.role = role # type: dict
def main():
"""
Main method.
"""
module = AnsibleModule(_ARGUMENT_SPEC, supports_check_mode=True)
if not HAS_REQUESTS:
module.fail_json(msg=missing_required_lib("requests"),
exception=REQUESTS_IMP_ERR)
try:
configuration = Configuration(
token=module.params.get(TOKEN_PARAMETER_NAME),
host=module.params.get(HOST_PARAMETER_NAME),
port=module.params.get(PORT_PARAMETER_NAME),
scheme=module.params.get(SCHEME_PARAMETER_NAME),
validate_certs=module.params.get(VALIDATE_CERTS_PARAMETER_NAME),
name=module.params.get(NAME_PARAMETER_NAME),
description=module.params.get(DESCRIPTION_PARAMETER_NAME),
policies=module.params.get(POLICIES_PARAMETER_NAME),
service_identities=module.params.get(SERVICE_IDENTITIES_PARAMETER_NAME),
node_identities=module.params.get(NODE_IDENTITIES_PARAMETER_NAME),
state=module.params.get(STATE_PARAMETER_NAME),
check_mode=module.check_mode
)
except ValueError as err:
module.fail_json(msg='Configuration error: %s' % str(err))
return
try:
version = get_consul_version(configuration)
configuration.version = version
if configuration.state == PRESENT_STATE_VALUE:
output = set_role(configuration)
else:
output = remove_role(configuration)
except ConnectionError as e:
module.fail_json(msg='Could not connect to consul agent at %s:%s, error was %s' % (
configuration.host, configuration.port, str(e)))
raise
return_values = dict(changed=output.changed, operation=output.operation, role=output.role)
module.exit_json(**return_values)
if __name__ == "__main__":
main()

View File

@@ -183,8 +183,9 @@ class CPANMinus(ModuleHelper):
if v.name and v.from_path:
self.do_raise("Parameters 'name' and 'from_path' are mutually exclusive when 'mode=new'")
self.command = self.get_bin_path(v.executable if v.executable else self.command)
self.vars.set("binary", self.command)
self.command = v.executable if v.executable else self.command
self.runner = CmdRunner(self.module, self.command, self.command_args_formats, check_rc=True)
self.vars.binary = self.runner.binary
def _is_package_installed(self, name, locallib, version):
def process(rc, out, err):
@@ -220,8 +221,6 @@ class CPANMinus(ModuleHelper):
self.do_raise(msg=err, cmd=self.vars.cmd_args)
return 'is up to date' not in err and 'is up to date' not in out
runner = CmdRunner(self.module, self.command, self.command_args_formats, check_rc=True)
v = self.vars
pkg_param = 'from_path' if v.from_path else 'name'
@@ -235,7 +234,7 @@ class CPANMinus(ModuleHelper):
return
pkg_spec = self.sanitize_pkg_spec_version(v[pkg_param], v.version)
with runner(['notest', 'locallib', 'mirror', 'mirror_only', 'installdeps', 'pkg_spec'], output_process=process) as ctx:
with self.runner(['notest', 'locallib', 'mirror', 'mirror_only', 'installdeps', 'pkg_spec'], output_process=process) as ctx:
self.changed = ctx.run(pkg_spec=pkg_spec)

View File

@@ -400,7 +400,7 @@ class DconfPreference(object):
rc, out, err = dbus_wrapper.run_command(command)
if rc != 0:
self.module.fail_json(msg='dconf failed while reseting the value with error: %s' % err,
self.module.fail_json(msg='dconf failed while resetting the value with error: %s' % err,
out=out,
err=err)

View File

@@ -178,7 +178,7 @@ class DNSimpleV2():
client = Client(sandbox=self.sandbox, email=self.account_email, access_token=self.account_api_token, user_agent="ansible/community.general")
else:
msg = "Option account_email or account_api_token not provided. " \
"Dnsimple authentiction with a .dnsimple config file is not " \
"Dnsimple authentication with a .dnsimple config file is not " \
"supported with dnsimple-python>=2.0.0"
raise DNSimpleException(msg)
client.identity.whoami()
@@ -225,24 +225,24 @@ class DNSimpleV2():
self.client.domains.delete_domain(self.account.id, domain)
def get_records(self, zone, dnsimple_filter=None):
"""return dns ressource records which match a specified filter"""
"""return dns resource records which match a specified filter"""
records_list = self._get_paginated_result(self.client.zones.list_records,
account_id=self.account.id,
zone=zone, filter=dnsimple_filter)
return [d.__dict__ for d in records_list]
def delete_record(self, domain, rid):
"""delete a single dns ressource record"""
"""delete a single dns resource record"""
self.client.zones.delete_record(self.account.id, domain, rid)
def update_record(self, domain, rid, ttl=None, priority=None):
"""update a single dns ressource record"""
"""update a single dns resource record"""
zr = ZoneRecordUpdateInput(ttl=ttl, priority=priority)
result = self.client.zones.update_record(self.account.id, str(domain), str(rid), zr).data.__dict__
return result
def create_record(self, domain, name, record_type, content, ttl=None, priority=None):
"""create a single dns ressource record"""
"""create a single dns resource record"""
zr = ZoneRecordInput(name=name, type=record_type, content=content, ttl=ttl, priority=priority)
return self.client.zones.create_record(self.account.id, str(domain), zr).data.__dict__

View File

@@ -509,15 +509,15 @@ class DME2(object):
return json.dumps(data, separators=(',', ':'))
def createRecord(self, data):
# @TODO update the cache w/ resultant record + id when impleneted
# @TODO update the cache w/ resultant record + id when implemented
return self.query(self.record_url, 'POST', data)
def updateRecord(self, record_id, data):
# @TODO update the cache w/ resultant record + id when impleneted
# @TODO update the cache w/ resultant record + id when implemented
return self.query(self.record_url + '/' + str(record_id), 'PUT', data)
def deleteRecord(self, record_id):
# @TODO remove record from the cache when impleneted
# @TODO remove record from the cache when implemented
return self.query(self.record_url + '/' + str(record_id), 'DELETE')
def getMonitor(self, record_id):

View File

@@ -78,6 +78,7 @@ EXAMPLES = '''
import syslog
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.cmd_runner import CmdRunner, cmd_runner_fmt
class EjabberdUser(object):
@@ -95,6 +96,17 @@ class EjabberdUser(object):
self.host = module.params.get('host')
self.user = module.params.get('username')
self.pwd = module.params.get('password')
self.runner = CmdRunner(
module,
command="ejabberdctl",
arg_formats=dict(
cmd=cmd_runner_fmt.as_list(),
host=cmd_runner_fmt.as_list(),
user=cmd_runner_fmt.as_list(),
pwd=cmd_runner_fmt.as_list(),
),
check_rc=False,
)
@property
def changed(self):
@@ -102,7 +114,7 @@ class EjabberdUser(object):
changed. It will return True if the user does not match the supplied
credentials and False if it does not
"""
return self.run_command('check_password', [self.user, self.host, self.pwd])
return self.run_command('check_password', 'user host pwd', (lambda rc, out, err: bool(rc)))
@property
def exists(self):
@@ -110,7 +122,7 @@ class EjabberdUser(object):
host specified. If the user exists True is returned, otherwise False
is returned
"""
return self.run_command('check_account', [self.user, self.host])
return self.run_command('check_account', 'user host', (lambda rc, out, err: not bool(rc)))
def log(self, entry):
""" This method will log information to the local syslog facility """
@@ -118,29 +130,36 @@ class EjabberdUser(object):
syslog.openlog('ansible-%s' % self.module._name)
syslog.syslog(syslog.LOG_NOTICE, entry)
def run_command(self, cmd, options):
def run_command(self, cmd, options, process=None):
""" This method will run the any command specified and return the
returns using the Ansible common module
"""
cmd = [self.module.get_bin_path('ejabberdctl', required=True), cmd] + options
self.log('command: %s' % " ".join(cmd))
return self.module.run_command(cmd)
def _proc(*a):
return a
if process is None:
process = _proc
with self.runner("cmd " + options, output_process=process) as ctx:
res = ctx.run(cmd=cmd, host=self.host, user=self.user, pwd=self.pwd)
self.log('command: %s' % " ".join(ctx.run_info['cmd']))
return res
def update(self):
""" The update method will update the credentials for the user provided
"""
return self.run_command('change_password', [self.user, self.host, self.pwd])
return self.run_command('change_password', 'user host pwd')
def create(self):
""" The create method will create a new user on the host with the
password provided
"""
return self.run_command('register', [self.user, self.host, self.pwd])
return self.run_command('register', 'user host pwd')
def delete(self):
""" The delete method will delete the user from the host
"""
return self.run_command('unregister', [self.user, self.host])
return self.run_command('unregister', 'user host')
def main():
@@ -150,7 +169,7 @@ def main():
username=dict(required=True, type='str'),
password=dict(type='str', no_log=True),
state=dict(default='present', choices=['present', 'absent']),
logging=dict(default=False, type='bool') # deprecate in favour of c.g.syslogger?
logging=dict(default=False, type='bool', removed_in_version='10.0.0', removed_from_collection='community.general'),
),
required_if=[
('state', 'present', ['password']),

108
plugins/modules/gio_mime.py Normal file
View File

@@ -0,0 +1,108 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2022, Alexei Znamensky <russoz@gmail.com>
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
module: gio_mime
author:
- "Alexei Znamensky (@russoz)"
short_description: Set default handler for MIME type, for applications using Gnome GIO
version_added: 7.5.0
description:
- This module allows configuring the default handler for a specific MIME type, to be used by applications built with th Gnome GIO API.
extends_documentation_fragment:
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: full
options:
mime_type:
description:
- MIME type for which a default handler will be set.
type: str
required: true
handler:
description:
- Default handler will be set for the MIME type.
type: str
required: true
notes:
- This module is a thin wrapper around the C(gio mime) command (and subcommand).
- See man gio(1) for more details.
seealso:
- name: GIO Documentation
description: Reference documentation for the GIO API..
link: https://docs.gtk.org/gio/
'''
EXAMPLES = """
- name: Set chrome as the default handler for https
community.general.gio_mime:
mime_type: x-scheme-handler/https
handler: google-chrome.desktop
register: result
"""
RETURN = '''
handler:
description:
- The handler set as default.
returned: success
type: str
sample: google-chrome.desktop
stdout:
description:
- The output of the C(gio) command.
returned: success
type: str
sample: Set google-chrome.desktop as the default for x-scheme-handler/https
stderr:
description:
- The error output of the C(gio) command.
returned: failure
type: str
sample: 'gio: Failed to load info for handler "never-existed.desktop"'
'''
from ansible_collections.community.general.plugins.module_utils.module_helper import ModuleHelper
from ansible_collections.community.general.plugins.module_utils.gio_mime import gio_mime_runner, gio_mime_get
class GioMime(ModuleHelper):
output_params = ['handler']
module = dict(
argument_spec=dict(
mime_type=dict(type='str', required=True),
handler=dict(type='str', required=True),
),
supports_check_mode=True,
)
def __init_module__(self):
self.runner = gio_mime_runner(self.module, check_rc=True)
self.vars.set_meta("handler", initial_value=gio_mime_get(self.runner, self.vars.mime_type), diff=True, change=True)
def __run__(self):
check_mode_return = (0, 'Module executed in check mode', '')
if self.vars.has_changed("handler"):
with self.runner.context(args_order=["mime_type", "handler"], check_mode_skip=True, check_mode_return=check_mode_return) as ctx:
rc, out, err = ctx.run()
self.vars.stdout = out
self.vars.stderr = err
if self.verbosity >= 4:
self.vars.run_info = ctx.run_info
def main():
GioMime.execute()
if __name__ == '__main__':
main()

View File

@@ -227,7 +227,7 @@ class GithubDeployKey(object):
yield self.module.from_json(resp.read())
links = {}
for x, y in findall(r'<([^>]+)>;\s*rel="(\w+)"', info["link"]):
for x, y in findall(r'<([^>]+)>;\s*rel="(\w+)"', info.get("link", '')):
links[y] = x
url = links.get('next')

View File

@@ -94,6 +94,13 @@ options:
- This option is only used on creation, not for updates.
type: path
version_added: 4.2.0
force_delete:
description:
- Force delete group even if projects in it.
- Used only when O(state=absent).
type: bool
default: false
version_added: 7.5.0
'''
EXAMPLES = '''
@@ -279,12 +286,18 @@ class GitLabGroup(object):
return (changed, group)
def delete_group(self):
'''
@param force To delete even if projects inside
'''
def delete_group(self, force=False):
group = self.group_object
if len(group.projects.list(all=False)) >= 1:
if not force and len(group.projects.list(all=False)) >= 1:
self._module.fail_json(
msg="There are still projects in this group. These needs to be moved or deleted before this group can be removed.")
msg=("There are still projects in this group. "
"These needs to be moved or deleted before this group can be removed. "
"Use 'force_delete' to 'true' to force deletion of existing projects.")
)
else:
if self._module.check_mode:
return True
@@ -295,7 +308,7 @@ class GitLabGroup(object):
self._module.fail_json(msg="Failed to delete group: %s " % to_native(e))
'''
@param name Name of the groupe
@param name Name of the group
@param full_path Complete path of the Group including parent group path. <parent_path>/<group_path>
'''
def exists_group(self, project_identifier):
@@ -322,6 +335,7 @@ def main():
subgroup_creation_level=dict(type='str', choices=['maintainer', 'owner']),
require_two_factor_authentication=dict(type='bool'),
avatar_path=dict(type='path'),
force_delete=dict(type='bool', default=False),
))
module = AnsibleModule(
@@ -354,6 +368,7 @@ def main():
subgroup_creation_level = module.params['subgroup_creation_level']
require_two_factor_authentication = module.params['require_two_factor_authentication']
avatar_path = module.params['avatar_path']
force_delete = module.params['force_delete']
gitlab_instance = gitlab_authentication(module)
@@ -375,7 +390,7 @@ def main():
if state == 'absent':
if group_exists:
gitlab_group.delete_group()
gitlab_group.delete_group(force=force_delete)
module.exit_json(changed=True, msg="Successfully deleted group %s" % group_name)
else:
module.exit_json(changed=False, msg="Group deleted or does not exists")

View File

@@ -276,11 +276,11 @@ def main():
ensure_gitlab_package(module)
access_level_int = {
'guest': gitlab.GUEST_ACCESS,
'reporter': gitlab.REPORTER_ACCESS,
'developer': gitlab.DEVELOPER_ACCESS,
'maintainer': gitlab.MAINTAINER_ACCESS,
'owner': gitlab.OWNER_ACCESS,
'guest': gitlab.const.GUEST_ACCESS,
'reporter': gitlab.const.REPORTER_ACCESS,
'developer': gitlab.const.DEVELOPER_ACCESS,
'maintainer': gitlab.const.MAINTAINER_ACCESS,
'owner': gitlab.const.OWNER_ACCESS,
}
gitlab_group = module.params['gitlab_group']

View File

@@ -53,13 +53,14 @@ options:
type: bool
vars:
description:
- When the list element is a simple key-value pair, set masked and protected to false.
- When the list element is a dict with the keys C(value), C(masked) and C(protected), the user can
have full control about whether a value should be masked, protected or both.
- When the list element is a simple key-value pair, masked, raw and protected will be set to false.
- When the list element is a dict with the keys C(value), C(masked), C(raw) and C(protected), the user can
have full control about whether a value should be masked, raw, protected or both.
- Support for group variables requires GitLab >= 9.5.
- Support for environment_scope requires GitLab Premium >= 13.11.
- Support for protected values requires GitLab >= 9.3.
- Support for masked values requires GitLab >= 11.10.
- Support for raw values requires GitLab >= 15.7.
- A C(value) must be a string or a number.
- Field C(variable_type) must be a string with either V(env_var), which is the default, or V(file).
- When a value is masked, it must be in Base64 and have a length of at least 8 characters.
@@ -70,7 +71,7 @@ options:
version_added: 4.5.0
description:
- A list of dictionaries that represents CI/CD variables.
- This modules works internal with this sructure, even if the older O(vars) parameter is used.
- This modules works internal with this structure, even if the older O(vars) parameter is used.
default: []
type: list
elements: dict
@@ -87,17 +88,24 @@ options:
type: str
masked:
description:
- Wether variable value is masked or not.
- Whether variable value is masked or not.
type: bool
default: false
protected:
description:
- Wether variable value is protected or not.
- Whether variable value is protected or not.
type: bool
default: false
raw:
description:
- Whether variable value is raw or not.
- Support for raw values requires GitLab >= 15.7.
type: bool
default: false
version_added: '7.4.0'
variable_type:
description:
- Wether a variable is an environment variable (V(env_var)) or a file (V(file)).
- Whether a variable is an environment variable (V(env_var)) or a file (V(file)).
type: str
choices: [ "env_var", "file" ]
default: env_var
@@ -126,6 +134,38 @@ EXAMPLES = r'''
variable_type: env_var
environment_scope: production
- name: Set or update some CI/CD variables with raw value
community.general.gitlab_group_variable:
api_url: https://gitlab.com
api_token: secret_access_token
group: scodeman/testgroup/
purge: false
vars:
ACCESS_KEY_ID: abc123
SECRET_ACCESS_KEY:
value: 3214cbad
masked: true
protected: true
raw: true
variable_type: env_var
environment_scope: '*'
- name: Set or update some CI/CD variables with expandable value
community.general.gitlab_group_variable:
api_url: https://gitlab.com
api_token: secret_access_token
group: scodeman/testgroup/
purge: false
vars:
ACCESS_KEY_ID: abc123
SECRET_ACCESS_KEY:
value: '$MY_OTHER_VARIABLE'
masked: true
protected: true
raw: false
variable_type: env_var
environment_scope: '*'
- name: Delete one variable
community.general.gitlab_group_variable:
api_url: https://gitlab.com
@@ -199,6 +239,7 @@ class GitlabGroupVariables(object):
"value": var_obj.get('value'),
"masked": var_obj.get('masked'),
"protected": var_obj.get('protected'),
"raw": var_obj.get('raw'),
"variable_type": var_obj.get('variable_type'),
}
if var_obj.get('environment_scope') is not None:
@@ -267,6 +308,8 @@ def native_python_main(this_gitlab, purge, requested_variables, state, module):
item['value'] = str(item.get('value'))
if item.get('protected') is None:
item['protected'] = False
if item.get('raw') is None:
item['raw'] = False
if item.get('masked') is None:
item['masked'] = False
if item.get('environment_scope') is None:
@@ -338,11 +381,14 @@ def main():
group=dict(type='str', required=True),
purge=dict(type='bool', required=False, default=False),
vars=dict(type='dict', required=False, default=dict(), no_log=True),
# please mind whenever changing the variables dict to also change module_utils/gitlab.py's
# KNOWN dict in filter_returned_variables or bad evil will happen
variables=dict(type='list', elements='dict', required=False, default=list(), options=dict(
name=dict(type='str', required=True),
value=dict(type='str', no_log=True),
masked=dict(type='bool', default=False),
protected=dict(type='bool', default=False),
raw=dict(type='bool', default=False),
environment_scope=dict(type='str', default='*'),
variable_type=dict(type='str', default='env_var', choices=["env_var", "file"])
)),

View File

@@ -67,17 +67,17 @@ options:
type: str
masked:
description:
- Wether variable value is masked or not.
- Whether variable value is masked or not.
type: bool
default: false
protected:
description:
- Wether variable value is protected or not.
- Whether variable value is protected or not.
type: bool
default: false
variable_type:
description:
- Wether a variable is an environment variable (V(env_var)) or a file (V(file)).
- Whether a variable is an environment variable (V(env_var)) or a file (V(file)).
type: str
choices: [ "env_var", "file" ]
default: env_var

View File

@@ -70,7 +70,7 @@ options:
description:
description:
- A description for the merge request.
- Gets overriden by a content of file specified at O(description_path), if found.
- Gets overridden by a content of file specified at O(description_path), if found.
type: str
description_path:
description:

View File

@@ -282,10 +282,10 @@ def main():
ensure_gitlab_package(module)
access_level_int = {
'guest': gitlab.GUEST_ACCESS,
'reporter': gitlab.REPORTER_ACCESS,
'developer': gitlab.DEVELOPER_ACCESS,
'maintainer': gitlab.MAINTAINER_ACCESS,
'guest': gitlab.const.GUEST_ACCESS,
'reporter': gitlab.const.REPORTER_ACCESS,
'developer': gitlab.const.DEVELOPER_ACCESS,
'maintainer': gitlab.const.MAINTAINER_ACCESS,
}
gitlab_project = module.params['project']

View File

@@ -51,11 +51,12 @@ options:
type: bool
vars:
description:
- When the list element is a simple key-value pair, masked and protected will be set to false.
- When the list element is a dict with the keys C(value), C(masked) and C(protected), the user can
have full control about whether a value should be masked, protected or both.
- When the list element is a simple key-value pair, masked, raw and protected will be set to false.
- When the list element is a dict with the keys C(value), C(masked), C(raw) and C(protected), the user can
have full control about whether a value should be masked, raw, protected or both.
- Support for protected values requires GitLab >= 9.3.
- Support for masked values requires GitLab >= 11.10.
- Support for raw values requires GitLab >= 15.7.
- Support for environment_scope requires GitLab Premium >= 13.11.
- Support for variable_type requires GitLab >= 11.11.
- A C(value) must be a string or a number.
@@ -86,19 +87,26 @@ options:
type: str
masked:
description:
- Wether variable value is masked or not.
- Whether variable value is masked or not.
- Support for masked values requires GitLab >= 11.10.
type: bool
default: false
protected:
description:
- Wether variable value is protected or not.
- Whether variable value is protected or not.
- Support for protected values requires GitLab >= 9.3.
type: bool
default: false
raw:
description:
- Whether variable value is raw or not.
- Support for raw values requires GitLab >= 15.7.
type: bool
default: false
version_added: '7.4.0'
variable_type:
description:
- Wether a variable is an environment variable (V(env_var)) or a file (V(file)).
- Whether a variable is an environment variable (V(env_var)) or a file (V(file)).
- Support for O(variables[].variable_type) requires GitLab >= 11.11.
type: str
choices: ["env_var", "file"]
@@ -143,6 +151,38 @@ EXAMPLES = '''
variable_type: env_var
environment_scope: '*'
- name: Set or update some CI/CD variables with raw value
community.general.gitlab_project_variable:
api_url: https://gitlab.com
api_token: secret_access_token
project: markuman/dotfiles
purge: false
vars:
ACCESS_KEY_ID: abc123
SECRET_ACCESS_KEY:
value: 3214cbad
masked: true
protected: true
raw: true
variable_type: env_var
environment_scope: '*'
- name: Set or update some CI/CD variables with expandable value
community.general.gitlab_project_variable:
api_url: https://gitlab.com
api_token: secret_access_token
project: markuman/dotfiles
purge: false
vars:
ACCESS_KEY_ID: abc123
SECRET_ACCESS_KEY:
value: '$MY_OTHER_VARIABLE'
masked: true
protected: true
raw: false
variable_type: env_var
environment_scope: '*'
- name: Delete one variable
community.general.gitlab_project_variable:
api_url: https://gitlab.com
@@ -220,6 +260,7 @@ class GitlabProjectVariables(object):
"value": var_obj.get('value'),
"masked": var_obj.get('masked'),
"protected": var_obj.get('protected'),
"raw": var_obj.get('raw'),
"variable_type": var_obj.get('variable_type'),
}
@@ -290,6 +331,8 @@ def native_python_main(this_gitlab, purge, requested_variables, state, module):
item['value'] = str(item.get('value'))
if item.get('protected') is None:
item['protected'] = False
if item.get('raw') is None:
item['raw'] = False
if item.get('masked') is None:
item['masked'] = False
if item.get('environment_scope') is None:
@@ -361,11 +404,14 @@ def main():
project=dict(type='str', required=True),
purge=dict(type='bool', required=False, default=False),
vars=dict(type='dict', required=False, default=dict(), no_log=True),
# please mind whenever changing the variables dict to also change module_utils/gitlab.py's
# KNOWN dict in filter_returned_variables or bad evil will happen
variables=dict(type='list', elements='dict', required=False, default=list(), options=dict(
name=dict(type='str', required=True),
value=dict(type='str', no_log=True),
masked=dict(type='bool', default=False),
protected=dict(type='bool', default=False),
raw=dict(type='bool', default=False),
environment_scope=dict(type='str', default='*'),
variable_type=dict(type='str', default='env_var', choices=["env_var", "file"]),
)),

View File

@@ -94,9 +94,9 @@ class GitlabProtectedBranch(object):
self._module = module
self.project = self.get_project(project)
self.ACCESS_LEVEL = {
'nobody': gitlab.NO_ACCESS,
'developer': gitlab.DEVELOPER_ACCESS,
'maintainer': gitlab.MAINTAINER_ACCESS
'nobody': gitlab.const.NO_ACCESS,
'developer': gitlab.const.DEVELOPER_ACCESS,
'maintainer': gitlab.const.MAINTAINER_ACCESS
}
def get_project(self, project_name):

View File

@@ -244,12 +244,12 @@ class GitLabUser(object):
self._gitlab = gitlab_instance
self.user_object = None
self.ACCESS_LEVEL = {
'guest': gitlab.GUEST_ACCESS,
'reporter': gitlab.REPORTER_ACCESS,
'developer': gitlab.DEVELOPER_ACCESS,
'master': gitlab.MAINTAINER_ACCESS,
'maintainer': gitlab.MAINTAINER_ACCESS,
'owner': gitlab.OWNER_ACCESS,
'guest': gitlab.const.GUEST_ACCESS,
'reporter': gitlab.const.REPORTER_ACCESS,
'developer': gitlab.const.DEVELOPER_ACCESS,
'master': gitlab.const.MAINTAINER_ACCESS,
'maintainer': gitlab.const.MAINTAINER_ACCESS,
'owner': gitlab.const.OWNER_ACCESS,
}
'''
@@ -485,7 +485,7 @@ class GitLabUser(object):
'''
@param user User object
@param identites List of identities to be added/updated
@param identities List of identities to be added/updated
@param overwrite_identities Overwrite user identities with identities passed to this module
'''
def add_identities(self, user, identities, overwrite_identities=False):
@@ -504,7 +504,7 @@ class GitLabUser(object):
'''
@param user User object
@param identites List of identities to be added/updated
@param identities List of identities to be added/updated
'''
def delete_identities(self, user, identities):
changed = False

View File

@@ -165,6 +165,7 @@ changed_pkgs:
version_added: '0.2.0'
'''
import json
import os.path
import re
@@ -184,6 +185,10 @@ def _create_regex_group_complement(s):
chars = filter(None, (line.split('#')[0].strip() for line in lines))
group = r'[^' + r''.join(chars) + r']'
return re.compile(group)
def _check_package_in_json(json_output, package_type):
return bool(json_output.get(package_type, []) and json_output[package_type][0].get("installed"))
# /utils ------------------------------------------------------------------ }}}
@@ -479,17 +484,13 @@ class Homebrew(object):
cmd = [
"{brew_path}".format(brew_path=self.brew_path),
"info",
"--json=v2",
self.current_package,
]
rc, out, err = self.module.run_command(cmd)
for line in out.split('\n'):
if (
re.search(r'Built from source', line)
or re.search(r'Poured from bottle', line)
):
return True
data = json.loads(out)
return False
return _check_package_in_json(data, "formulae") or _check_package_in_json(data, "casks")
def _current_package_is_outdated(self):
if not self.valid_package(self.current_package):

View File

@@ -393,7 +393,7 @@ class Homectl(object):
user_metadata.pop('status', None)
# Let last change Usec be updated by homed when command runs.
user_metadata.pop('lastChangeUSec', None)
# Now only change fields that are called on leaving whats currently in the record intact.
# Now only change fields that are called on leaving what's currently in the record intact.
record = user_metadata
record['userName'] = self.name
@@ -439,7 +439,7 @@ class Homectl(object):
self.result['changed'] = True
if self.disksize:
# convert humand readble to bytes
# convert human readable to bytes
if self.disksize != record.get('diskSize'):
record['diskSize'] = human_to_bytes(self.disksize)
self.result['changed'] = True

View File

@@ -84,7 +84,7 @@ ilo_redfish_command:
type: dict
contains:
ret:
description: Return True/False based on whether the operation was performed succesfully.
description: Return True/False based on whether the operation was performed successfully.
type: bool
msg:
description: Status of the operation performed on the iLO.

View File

@@ -142,7 +142,7 @@ class Imgadm(object):
self.uuid = module.params['uuid']
# Since there are a number of (natural) aliases, prevent having to look
# them up everytime we operate on `state`.
# them up every time we operate on `state`.
if self.params['state'] in ['present', 'imported', 'updated']:
self.present = True
else:
@@ -174,7 +174,7 @@ class Imgadm(object):
# There is no feedback from imgadm(1M) to determine if anything
# was actually changed. So treat this as an 'always-changes' operation.
# Note that 'imgadm -v' produces unparseable JSON...
# Note that 'imgadm -v' produces unparsable JSON...
self.changed = True
def manage_sources(self):

View File

@@ -4,6 +4,7 @@
# Copyright (c) 2012, Jan-Piet Mens <jpmens () gmail.com>
# Copyright (c) 2015, Ales Nosek <anosek.nosek () gmail.com>
# Copyright (c) 2017, Ansible Project
# Copyright (c) 2023, Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -42,8 +43,8 @@ options:
description:
- Section name in INI file. This is added if O(state=present) automatically when
a single value is being set.
- If left empty, being omitted, or being set to V(null), the O(option) will be placed before the first O(section).
- Using V(null) is also required if the config format does not support sections.
- If being omitted, the O(option) will be placed before the first O(section).
- Omitting O(section) is also required if the config format does not support sections.
type: str
option:
description:
@@ -98,6 +99,12 @@ options:
- Do not insert spaces before and after '=' symbol.
type: bool
default: false
ignore_spaces:
description:
- Do not change a line if doing so would only add or remove spaces before or after the V(=) symbol.
type: bool
default: false
version_added: 7.5.0
create:
description:
- If set to V(false), the module will fail if the file does not already exist.
@@ -164,6 +171,13 @@ EXAMPLES = r'''
- pepsi
mode: '0600'
state: present
- name: Add "beverage=lemon juice" outside a section in specified file
community.general.ini_file:
path: /etc/conf
option: beverage
value: lemon juice
state: present
'''
import io
@@ -178,7 +192,7 @@ from ansible.module_utils.common.text.converters import to_bytes, to_text
def match_opt(option, line):
option = re.escape(option)
return re.match('[#;]?( |\t)*(%s)( |\t)*(=|$)( |\t)*(.*)' % option, line)
return re.match('([#;]?)( |\t)*(%s)( |\t)*(=|$)( |\t)*(.*)' % option, line)
def match_active_opt(option, line):
@@ -186,19 +200,27 @@ def match_active_opt(option, line):
return re.match('( |\t)*(%s)( |\t)*(=|$)( |\t)*(.*)' % option, line)
def update_section_line(changed, section_lines, index, changed_lines, newline, msg):
option_changed = section_lines[index] != newline
def update_section_line(option, changed, section_lines, index, changed_lines, ignore_spaces, newline, msg):
option_changed = None
if ignore_spaces:
old_match = match_opt(option, section_lines[index])
if not old_match.group(1):
new_match = match_opt(option, newline)
option_changed = old_match.group(7) != new_match.group(7)
if option_changed is None:
option_changed = section_lines[index] != newline
if option_changed:
section_lines[index] = newline
changed = changed or option_changed
if option_changed:
msg = 'option changed'
section_lines[index] = newline
changed_lines[index] = 1
return (changed, msg)
def do_ini(module, filename, section=None, option=None, values=None,
state='present', exclusive=True, backup=False, no_extra_spaces=False,
create=True, allow_no_value=False, follow=False):
ignore_spaces=False, create=True, allow_no_value=False, follow=False):
if section is not None:
section = to_text(section)
@@ -306,8 +328,8 @@ def do_ini(module, filename, section=None, option=None, values=None,
for index, line in enumerate(section_lines):
if match_opt(option, line):
match = match_opt(option, line)
if values and match.group(6) in values:
matched_value = match.group(6)
if values and match.group(7) in values:
matched_value = match.group(7)
if not matched_value and allow_no_value:
# replace existing option with no value line(s)
newline = u'%s\n' % option
@@ -315,12 +337,12 @@ def do_ini(module, filename, section=None, option=None, values=None,
else:
# replace existing option=value line(s)
newline = assignment_format % (option, matched_value)
(changed, msg) = update_section_line(changed, section_lines, index, changed_lines, newline, msg)
(changed, msg) = update_section_line(option, changed, section_lines, index, changed_lines, ignore_spaces, newline, msg)
values.remove(matched_value)
elif not values and allow_no_value:
# replace existing option with no value line(s)
newline = u'%s\n' % option
(changed, msg) = update_section_line(changed, section_lines, index, changed_lines, newline, msg)
(changed, msg) = update_section_line(option, changed, section_lines, index, changed_lines, ignore_spaces, newline, msg)
option_no_value_present = True
break
@@ -330,7 +352,7 @@ def do_ini(module, filename, section=None, option=None, values=None,
for index, line in enumerate(section_lines):
if not changed_lines[index] and match_opt(option, line):
newline = assignment_format % (option, values.pop(0))
(changed, msg) = update_section_line(changed, section_lines, index, changed_lines, newline, msg)
(changed, msg) = update_section_line(option, changed, section_lines, index, changed_lines, ignore_spaces, newline, msg)
if len(values) == 0:
break
# remove all remaining option occurrences from the rest of the section
@@ -449,6 +471,7 @@ def main():
state=dict(type='str', default='present', choices=['absent', 'present']),
exclusive=dict(type='bool', default=True),
no_extra_spaces=dict(type='bool', default=False),
ignore_spaces=dict(type='bool', default=False),
allow_no_value=dict(type='bool', default=False),
create=dict(type='bool', default=True),
follow=dict(type='bool', default=False)
@@ -469,6 +492,7 @@ def main():
exclusive = module.params['exclusive']
backup = module.params['backup']
no_extra_spaces = module.params['no_extra_spaces']
ignore_spaces = module.params['ignore_spaces']
allow_no_value = module.params['allow_no_value']
create = module.params['create']
follow = module.params['follow']
@@ -481,7 +505,9 @@ def main():
elif values is None:
values = []
(changed, backup_file, diff, msg) = do_ini(module, path, section, option, values, state, exclusive, backup, no_extra_spaces, create, allow_no_value, follow)
(changed, backup_file, diff, msg) = do_ini(
module, path, section, option, values, state, exclusive, backup,
no_extra_spaces, ignore_spaces, create, allow_no_value, follow)
if not module.check_mode and os.path.exists(path):
file_args = module.load_file_common_arguments(module.params)

View File

@@ -133,7 +133,7 @@ def _check_new_pkg(module, package, repository_path):
def _check_installed_pkg(module, package, repository_path):
"""
Check the package on AIX.
It verifies if the package is installed and informations
It verifies if the package is installed and information
:param module: Ansible module parameters spec.
:param package: Package/fileset name.

View File

@@ -12,14 +12,14 @@ __metaclass__ = type
DOCUMENTATION = '''
---
module: interfaces_file
short_description: Tweak settings in /etc/network/interfaces files
short_description: Tweak settings in C(/etc/network/interfaces) files
extends_documentation_fragment:
- ansible.builtin.files
- community.general.attributes
description:
- Manage (add, remove, change) individual interface options in an interfaces-style file without having
to manage the file as a whole with, say, M(ansible.builtin.template) or M(ansible.builtin.assemble). Interface has to be presented in a file.
- Read information about interfaces from interfaces-styled files
- Read information about interfaces from interfaces-styled files.
attributes:
check_mode:
support: full
@@ -29,27 +29,27 @@ options:
dest:
type: path
description:
- Path to the interfaces file
- Path to the interfaces file.
default: /etc/network/interfaces
iface:
type: str
description:
- Name of the interface, required for value changes or option remove
- Name of the interface, required for value changes or option remove.
address_family:
type: str
description:
- Address family of the interface, useful if same interface name is used for both inet and inet6
- Address family of the interface, useful if same interface name is used for both V(inet) and V(inet6).
option:
type: str
description:
- Name of the option, required for value changes or option remove
- Name of the option, required for value changes or option remove.
value:
type: str
description:
- If O(option) is not presented for the O(iface) and O(state) is V(present) option will be added.
If O(option) already exists and is not V(pre-up), V(up), V(post-up) or V(down), it's value will be updated.
V(pre-up), V(up), V(post-up) and V(down) options cannot be updated, only adding new options, removing existing
ones or cleaning the whole option set are supported
ones or cleaning the whole option set are supported.
backup:
description:
- Create a backup file including the timestamp information so you can get
@@ -64,72 +64,76 @@ options:
choices: [ "present", "absent" ]
notes:
- If option is defined multiple times last one will be updated but all will be deleted in case of an absent state
- If option is defined multiple times last one will be updated but all will be deleted in case of an absent state.
requirements: []
author: "Roman Belyakovsky (@hryamzik)"
'''
RETURN = '''
dest:
description: destination file/path
description: Destination file/path.
returned: success
type: str
sample: "/etc/network/interfaces"
ifaces:
description: interfaces dictionary
description: Interfaces dictionary.
returned: success
type: complex
type: dict
contains:
ifaces:
description: interface dictionary
description: Interface dictionary.
returned: success
type: dict
contains:
eth0:
description: Name of the interface
description: Name of the interface.
returned: success
type: dict
contains:
address_family:
description: interface address family
description: Interface address family.
returned: success
type: str
sample: "inet"
method:
description: interface method
description: Interface method.
returned: success
type: str
sample: "manual"
mtu:
description: other options, all values returned as strings
description: Other options, all values returned as strings.
returned: success
type: str
sample: "1500"
pre-up:
description: list of C(pre-up) scripts
description: List of C(pre-up) scripts.
returned: success
type: list
elements: str
sample:
- "route add -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
- "route add -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
up:
description: list of C(up) scripts
description: List of C(up) scripts.
returned: success
type: list
elements: str
sample:
- "route add -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
- "route add -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
post-up:
description: list of C(post-up) scripts
description: List of C(post-up) scripts.
returned: success
type: list
elements: str
sample:
- "route add -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
- "route add -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
down:
description: list of C(down) scripts
description: List of C(down) scripts.
returned: success
type: list
elements: str
sample:
- "route del -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
- "route del -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
@@ -336,6 +340,8 @@ def addOptionAfterLine(option, value, iface, lines, last_line_dict, iface_option
changed = False
for ln in lines:
if ln.get('line_type', '') == 'iface' and ln.get('iface', '') == iface and value != ln.get('params', {}).get('method', ''):
if address_family is not None and ln.get('address_family') != address_family:
continue
changed = True
ln['line'] = re.sub(ln.get('params', {}).get('method', '') + '$', value, ln.get('line'))
ln['params']['method'] = value

View File

@@ -40,6 +40,12 @@ options:
aliases: ["primarygroup"]
type: str
version_added: '2.5.0'
ipagroupobjectclasses:
description: A list of group objectclasses.
aliases: ["groupobjectclasses"]
type: list
elements: str
version_added: '7.3.0'
ipagroupsearchfields:
description: A list of fields to search in when searching for groups.
aliases: ["groupsearchfields"]
@@ -85,12 +91,20 @@ options:
elements: str
version_added: '3.7.0'
ipauserauthtype:
description: The authentication type to use by default.
description:
- The authentication type to use by default.
- The choice V(idp) has been added in community.general 7.3.0.
aliases: ["userauthtype"]
choices: ["password", "radius", "otp", "pkinit", "hardened", "disabled"]
choices: ["password", "radius", "otp", "pkinit", "hardened", "idp", "disabled"]
type: list
elements: str
version_added: '2.5.0'
ipauserobjectclasses:
description: A list of user objectclasses.
aliases: ["userobjectclasses"]
type: list
elements: str
version_added: '7.3.0'
ipausersearchfields:
description: A list of fields to search in when searching for users.
aliases: ["usersearchfields"]
@@ -235,11 +249,12 @@ class ConfigIPAClient(IPAClient):
def get_config_dict(ipaconfigstring=None, ipadefaultloginshell=None,
ipadefaultemaildomain=None, ipadefaultprimarygroup=None,
ipagroupsearchfields=None, ipahomesrootdir=None,
ipakrbauthzdata=None, ipamaxusernamelength=None,
ipapwdexpadvnotify=None, ipasearchrecordslimit=None,
ipasearchtimelimit=None, ipaselinuxusermaporder=None,
ipauserauthtype=None, ipausersearchfields=None):
ipagroupsearchfields=None, ipagroupobjectclasses=None,
ipahomesrootdir=None, ipakrbauthzdata=None,
ipamaxusernamelength=None, ipapwdexpadvnotify=None,
ipasearchrecordslimit=None, ipasearchtimelimit=None,
ipaselinuxusermaporder=None, ipauserauthtype=None,
ipausersearchfields=None, ipauserobjectclasses=None):
config = {}
if ipaconfigstring is not None:
config['ipaconfigstring'] = ipaconfigstring
@@ -249,6 +264,8 @@ def get_config_dict(ipaconfigstring=None, ipadefaultloginshell=None,
config['ipadefaultemaildomain'] = ipadefaultemaildomain
if ipadefaultprimarygroup is not None:
config['ipadefaultprimarygroup'] = ipadefaultprimarygroup
if ipagroupobjectclasses is not None:
config['ipagroupobjectclasses'] = ipagroupobjectclasses
if ipagroupsearchfields is not None:
config['ipagroupsearchfields'] = ','.join(ipagroupsearchfields)
if ipahomesrootdir is not None:
@@ -267,6 +284,8 @@ def get_config_dict(ipaconfigstring=None, ipadefaultloginshell=None,
config['ipaselinuxusermaporder'] = '$'.join(ipaselinuxusermaporder)
if ipauserauthtype is not None:
config['ipauserauthtype'] = ipauserauthtype
if ipauserobjectclasses is not None:
config['ipauserobjectclasses'] = ipauserobjectclasses
if ipausersearchfields is not None:
config['ipausersearchfields'] = ','.join(ipausersearchfields)
@@ -283,6 +302,7 @@ def ensure(module, client):
ipadefaultloginshell=module.params.get('ipadefaultloginshell'),
ipadefaultemaildomain=module.params.get('ipadefaultemaildomain'),
ipadefaultprimarygroup=module.params.get('ipadefaultprimarygroup'),
ipagroupobjectclasses=module.params.get('ipagroupobjectclasses'),
ipagroupsearchfields=module.params.get('ipagroupsearchfields'),
ipahomesrootdir=module.params.get('ipahomesrootdir'),
ipakrbauthzdata=module.params.get('ipakrbauthzdata'),
@@ -293,6 +313,7 @@ def ensure(module, client):
ipaselinuxusermaporder=module.params.get('ipaselinuxusermaporder'),
ipauserauthtype=module.params.get('ipauserauthtype'),
ipausersearchfields=module.params.get('ipausersearchfields'),
ipauserobjectclasses=module.params.get('ipauserobjectclasses'),
)
ipa_config = client.config_show()
diff = get_config_diff(client, ipa_config, module_config)
@@ -322,6 +343,8 @@ def main():
ipadefaultloginshell=dict(type='str', aliases=['loginshell']),
ipadefaultemaildomain=dict(type='str', aliases=['emaildomain']),
ipadefaultprimarygroup=dict(type='str', aliases=['primarygroup']),
ipagroupobjectclasses=dict(type='list', elements='str',
aliases=['groupobjectclasses']),
ipagroupsearchfields=dict(type='list', elements='str',
aliases=['groupsearchfields']),
ipahomesrootdir=dict(type='str', aliases=['homesrootdir']),
@@ -337,9 +360,11 @@ def main():
ipauserauthtype=dict(type='list', elements='str',
aliases=['userauthtype'],
choices=["password", "radius", "otp", "pkinit",
"hardened", "disabled"]),
"hardened", "idp", "disabled"]),
ipausersearchfields=dict(type='list', elements='str',
aliases=['usersearchfields']),
ipauserobjectclasses=dict(type='list', elements='str',
aliases=['userobjectclasses']),
)
module = AnsibleModule(

View File

@@ -237,7 +237,7 @@ def get_otptoken_dict(ansible_to_ipa, uniqueid=None, newuniqueid=None, otptype=N
if owner is not None:
otptoken[ansible_to_ipa['owner']] = owner
if enabled is not None:
otptoken[ansible_to_ipa['enabled']] = 'FALSE' if enabled else 'TRUE'
otptoken[ansible_to_ipa['enabled']] = False if enabled else True
if notbefore is not None:
otptoken[ansible_to_ipa['notbefore']] = notbefore + 'Z'
if notafter is not None:

View File

@@ -30,7 +30,9 @@ options:
default: 'always'
choices: [ always, on_create ]
givenname:
description: First name.
description:
- First name.
- If user does not exist and O(state=present), the usage of O(givenname) is required.
type: str
krbpasswordexpiration:
description:
@@ -54,7 +56,9 @@ options:
- Will not be set for an existing user unless O(update_password=always), which is the default.
type: str
sn:
description: Surname.
description:
- Surname.
- If user does not exist and O(state=present), the usage of O(sn) is required.
type: str
sshpubkey:
description:

View File

@@ -69,7 +69,7 @@ EXAMPLES = '''
RETURN = '''
data:
description: "JSON parsed response from ipbase.com. Please refer to U(https://ipbase.com/docs/info) for the detailled structure of the response."
description: "JSON parsed response from ipbase.com. Please refer to U(https://ipbase.com/docs/info) for the detailed structure of the response."
returned: success
type: dict
sample: {

View File

@@ -458,7 +458,7 @@ def main():
# The issue comes when wanting to restore state from empty iptable-save's
# output... what happens when, say:
# - no table is specified, and iptables-save's output is only nat table;
# - we give filter's ruleset to iptables-restore, that locks ourselve out
# - we give filter's ruleset to iptables-restore, that locks ourselves out
# of the host;
# then trying to roll iptables state back to the previous (working) setup
# doesn't override current filter table because no filter table is stored

View File

@@ -195,7 +195,14 @@ def send_msg(msg, server='localhost', port='6667', channel=None, nick_to=None, k
irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
if use_ssl:
irc = ssl.wrap_socket(irc)
if getattr(ssl, 'PROTOCOL_TLS', None) is not None:
# Supported since Python 2.7.13
context = ssl.SSLContext(ssl.PROTOCOL_TLS)
else:
context = ssl.SSLContext()
context.verify_mode = ssl.CERT_NONE
# TODO: create a secure context with `context = ssl.create_default_context()` instead!
irc = context.wrap_socket(irc)
irc.connect((server, int(port)))
if passwd:

View File

@@ -20,6 +20,7 @@ requirements:
author:
- Brett Milford (@brettmilford)
- Tong He (@unnecessary-username)
- Juan Casanova (@juanmcasanova)
extends_documentation_fragment:
- community.general.attributes
attributes:
@@ -65,6 +66,19 @@ options:
description:
- User to authenticate with the Jenkins server.
type: str
detach:
description:
- Enable detached mode to not wait for the build end.
default: false
type: bool
version_added: 7.4.0
time_between_checks:
description:
- Time in seconds to wait between requests to the Jenkins server.
- This times must be higher than the configured quiet time for the job.
default: 10
type: int
version_added: 7.4.0
'''
EXAMPLES = '''
@@ -152,6 +166,8 @@ class JenkinsBuild:
self.user = module.params.get('user')
self.jenkins_url = module.params.get('url')
self.build_number = module.params.get('build_number')
self.detach = module.params.get('detach')
self.time_between_checks = module.params.get('time_between_checks')
self.server = self.get_jenkins_connection()
self.result = {
@@ -235,7 +251,14 @@ class JenkinsBuild:
build_status = self.get_build_status()
if build_status['result'] is None:
sleep(10)
# If detached mode is active mark as success, we wouldn't be able to get here if it didn't exist
if self.detach:
result['changed'] = True
result['build_info'] = build_status
return result
sleep(self.time_between_checks)
self.get_result()
else:
if self.state == "stopped" and build_status['result'] == "ABORTED":
@@ -273,6 +296,8 @@ def main():
token=dict(no_log=True),
url=dict(default="http://localhost:8080"),
user=dict(),
detach=dict(type='bool', default=False),
time_between_checks=dict(type='int', default=10),
),
mutually_exclusive=[['password', 'token']],
required_if=[['state', 'absent', ['build_number'], True], ['state', 'stopped', ['build_number'], True]],
@@ -288,7 +313,7 @@ def main():
else:
jenkins_build.absent_build()
sleep(10)
sleep(jenkins_build.time_between_checks)
result = jenkins_build.get_result()
module.exit_json(**result)

Some files were not shown because too many files have changed in this diff Show More