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

355 commits

Author SHA1 Message Date
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]
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]
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]
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
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
7cf834fb3c
[stable-7] Revert new features to be able to do 7.2.1 release (#7042)
* Revert "[PR #7020/b46d5d81 backport][stable-7] redfish_utils: Add support for "nextLink" property tag pagination (#7026)"

This reverts commit 1dad95370e.

* Revert "[PR #6914/17b4219b backport][stable-7] proxmox_kvm: enable 'force' restart of vm (as documented) (#6997)"

This reverts commit 7d68af57af.

* Revert "[PR #6976/d7c1a814 backport][stable-7] [proxmox_vm_info] Re-use cluster resources API to use module without requiring node param (#6993)"

This reverts commit fb3768aada.
2023-07-31 15:45:08 +02:00
patchback[bot]
fb3768aada
[PR #6976/d7c1a814 backport][stable-7] [proxmox_vm_info] Re-use cluster resources API to use module without requiring node param (#6993)
[proxmox_vm_info] Re-use cluster resources API to use module without requiring node param (#6976)

* [proxmox_vm_info] Re-use cluster resources API to use module without requiring node param

* More consife if

* Fix use case when requesting all vms from specific node

* Add changelog fragment

(cherry picked from commit d7c1a814ea)

Co-authored-by: Sergei Antipov <greendayonfire@gmail.com>
2023-07-23 21:55:32 +02:00
patchback[bot]
93f990a1b9
[PR #6981/f9448574 backport][stable-7] [proxmox_kvm] Don't create VM if name is used without vmid (#6992)
[proxmox_kvm] Don't create VM if name is used without vmid (#6981)

* [proxmox_kvm] Don't create VM if name is used without vmid

* Add changelog and unit tests

(cherry picked from commit f9448574bd)

Co-authored-by: Sergei Antipov <greendayonfire@gmail.com>
2023-07-23 21:48:36 +02:00
patchback[bot]
bb80ff6aee
[PR #6908/ea6fb9da backport][stable-7] snap: add param "dangerous" (#6944)
snap: add param "dangerous" (#6908)

* snap: add param "dangerous"

* adjusted run_command out for simple test case

* add changelog frag

(cherry picked from commit ea6fb9da8f)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-07-15 16:28:00 +02:00
patchback[bot]
6584348d05
[PR #6902/cc8e2d67 backport][stable-7] Added support in nmcli for ipv4.dns-options (#6926)
Added support in nmcli for ipv4.dns-options (#6902)

* Added support for ipv4.dns_options in nmcli module

* added support for dns6-options

* Added version added

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

* added version_added: 4.6.0 for dns6 options

* added changelog fragment

* Rename 4308-added-support-in-nmcli-for-ipvx-dns-options to 4308-added-support-in-nmcli-for-ipvx-dns-options.yml

* Update changelogs/fragments/4308-added-support-in-nmcli-for-ipvx-dns-options.yml

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

* Fix and add tests

* Update PR number and version_added

---------

Co-authored-by: Matteo Caruso <m.caruso425@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit cc8e2d676a)

Co-authored-by: Chih-Hsuan Yen <1937689+yan12125@users.noreply.github.com>
2023-07-13 22:42:05 +02:00
patchback[bot]
e69ea28662
[PR #6389/5365647e backport][stable-7] New lookup plug-in: Bitwarden Secrets Manager (#6889)
New lookup plug-in: Bitwarden Secrets Manager (#6389)

* add Bitwarden Secrets Manager lookup

* fix pep8 and yamllint complaints

* fix version_added, add maintainer and copyright notice

* document BWS_ACCESS_TOKEN env var and declare as required

* avoid returning nested list

* update 'value of a secret' example after f6c4492c

* update copyright notice in bitwarden_secrets_manager plugin

thx felixfontein

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

* rename classes to distinguish from existing bw plugin

* use AnsibleLookupError, formatting

* bump version_added to 7.0.0

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

* ci fix: python style guide calls for excessive blank lines

https://peps.python.org/pep-0008/#blank-lines

* first attempt at unit tests for bws lookup

* ci fix: remove trailing newline

* attempt to fix tests object not callable error

* address formatting, tests and pyright suggestions

* reduce scope of mocked code for more real test coverage

only the actual bws CLI call is mocked now, this should enable the
exception thrown test to succeed if I didn't add new problems

* fix undefined variable 'expected_rc'

* fix mocked _run method to return correct data types

* keep list of one element for test case comparison

* bump version_added to 7.2.0

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

---------

Co-authored-by: jantari <jantari@github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 5365647ee7)

Co-authored-by: jantari <jantari@outlook.de>
2023-07-08 18:09:39 +02:00
patchback[bot]
b5d56463a6
[PR #6852/7adb9985 backport][stable-7] [proxmox_vm_info] New module to retrieve virtual machines information from Proxmox VE API (#6897)
[proxmox_vm_info] New module to retrieve virtual machines information from Proxmox VE API (#6852)

* [proxmox_vm_info] New module to retrieve virtual machines information from Proxmox VE API

* Address review comments

* Fix seealso fragment

* Update plugins/modules/proxmox_vm_info.py

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

---------

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

Co-authored-by: Sergei Antipov <greendayonfire@gmail.com>
2023-07-08 18:09:16 +02:00
patchback[bot]
330b0304ef
[PR #6769/9d8bec14 backport][stable-7] nmcli: fix empty list to replace / remove values (#6869)
nmcli: fix empty list to replace / remove values (#6769)

(cherry picked from commit 9d8bec14c0)

Co-authored-by: genofire <geno+dev@fireorbit.de>
2023-07-06 21:39:07 +02:00
patchback[bot]
9036d8edd0
[PR #6757/2d6e369d backport][stable-7] [proxmox_template] Fix error while uploading big ISO to Proxmox VE cluster (#6831)
[proxmox_template] Fix error while uploading big ISO to Proxmox VE cluster (#6757)

* [proxmox_template] Fix error while uploading big ISO to Proxmox VE cluster

* Fix pep8 test

* Add changelog fragment

* Add notes about requests_toolbelt

* Check versions and file size

* Fix typo in notes

* Add unit test. Move try inside of each function.

* Fix sanity tests

* Add proxmoxer in requirements file

* Update integration tests

* Add proxmoxer into constraints.txt

* Address review comments

* Don't run tests on 2.6 python

* Disable Python 2.6 tests for other proxmox modules

(cherry picked from commit 2d6e369d81)

Co-authored-by: Sergei Antipov <greendayonfire@gmail.com>
2023-07-02 22:25:14 +02:00
patchback[bot]
72d1af86f3
[PR #6783/867704dd backport][stable-7] rhsm_repository: refactor handling of subscription-manager (#6830)
rhsm_repository: refactor handling of subscription-manager (#6783)

Create a small helper class Rhsm, so all the logic related to the
interaction with subscription-manager is grouped there:
- create the Rhsm object in main(), once the initial checks are done
- search subscription-manager as required (so there is no need to
  manually check it), and store its path for reuse
- store the common arguments for running subscription-manager
- move run_subscription_manager() to Rhsm as run_repos()
- get rid of the different list parameters: we list only all the
  repositories, so the other cases are not needed (and can be added
  easily, if needed)
- move get_repository_list() to Rhsm as list_repositories()

The execution of subscription-manager is improved as well:
- pass the arguments to run_command() directly as list, rather than
  joining the arguments to string, which run_command() will need to
  split again
- move the "repos" parameter directly in run_repos()
- explicitly disable the shell, already off by default
- disable the expansions of variables, as there are none

Adapt the unit test to the different way run_command() is called.

There should be no behaviour changes.

(cherry picked from commit 867704dd75)

Co-authored-by: Pino Toscano <ptoscano@redhat.com>
2023-07-02 22:01:53 +02:00
patchback[bot]
6c718a4f55
[PR #6826/eb734d03 backport][stable-7] snap: fix bug when processing output (#6829)
snap: fix bug when processing output (#6826)

* snap: fix bug when processing output

* add changelog frag

(cherry picked from commit eb734d03c0)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-07-02 21:45:16 +02:00
patchback[bot]
39d83fefee
[PR #6758/08fa05f0 backport][stable-7] rhsm_repository: add an initial unit test (#6781)
rhsm_repository: add an initial unit test (#6758)

So far there are no tests for the rhsm_repository module, which makes it
difficult to do even basic changes. Hence, add an initial version of
unit tests, heavily based on the approach of the redhat_subscription
unit tests.

(cherry picked from commit 08fa05f05f)

Co-authored-by: Pino Toscano <ptoscano@redhat.com>
2023-06-24 16:32:40 +02:00
patchback[bot]
4209c58ae1
[PR #6732/cd48e818 backport][stable-7] Keycloak: Authentication required actions management (#6754)
Keycloak: Authentication required actions management (#6732)

* feat: keycloak required actions

* Update plugins/modules/keycloak_authentication_required_actions.py

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

* Update plugins/modules/keycloak_authentication_required_actions.py

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

* fix: dedent

* fix: unnecessary defaults

* fix: sanity checks

* Update plugins/modules/keycloak_authentication_required_actions.py

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

* fix: ident

---------

Co-authored-by: Skrekulko <Skrekulko@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit cd48e818ae)

Co-authored-by: Skrekulko <111891715+Skrekulko@users.noreply.github.com>
2023-06-20 19:48:18 +02:00
patchback[bot]
6f518ba18b
[PR #6721/48711406 backport][stable-7] lvg_rename: New module to support VG renaming (#6733)
lvg_rename: New module to support VG renaming (#6721)

* lvg_rename: New module to support VG renaming

* Remove vg option aliases

Fix YAML boolean case-formatting

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

---------

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

Co-authored-by: Laszlo Szomor <laszomor@gmail.com>
2023-06-19 16:43:39 +02:00
patchback[bot]
1592be779a
[PR #6709/fb04dc3d backport][stable-7] proxmox_kvm - Allow creation of VM with existing name but new vmid (#6729)
proxmox_kvm - Allow creation of VM with existing name but new vmid (#6709)

* proxmox_kvm - Allow creation of VM with existing name but new vmid

* Fix pylint and pep8 errors

* Add changelog fragment

* Move status variable outside of try block

* Add assertion for calling get_vm_node function

* Use try/catch for module_utils functions

* Update changelogs/fragments/6709-proxmox-create-vm-with-existing-name.yml

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

---------

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

Co-authored-by: Sergei Antipov <greendayonfire@gmail.com>
2023-06-19 08:27:24 +02:00
patchback[bot]
5c7b103936
[PR #6687/e06a0e22 backport][stable-7] keycloak_client_rolemapping.py: add support for subgroups (#6723)
keycloak_client_rolemapping.py: add support for subgroups (#6687)

* keycloak_client_rolemapping.py: add support for subgroups

* Add PR number after creating a PR to 6687-support-subgroups-for-keycloak-client-rolemapping.yml

* Update changelogs/fragments/6687-support-subgroups-for-keycloak-client-rolemapping.yml

Add missing URL

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

* Update plugins/modules/keycloak_client_rolemapping.py

Set a correct version_added (previously it was a copy-paste)

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

* Update plugins/modules/keycloak_client_rolemapping.py

Fix typo after copy-paste

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

* Update plugins/modules/keycloak_client_rolemapping.py

Fix typo after copy-paste

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

* Update plugins/modules/keycloak_client_rolemapping.py

Fix typo after copy-paste

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

---------

Co-authored-by: Mikhail Putilov <Mikhail.Putilov@dimoco.eu>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit e06a0e22f7)

Co-authored-by: Mikhail Putilov <post.snowy@gmail.com>
2023-06-18 20:25:34 +02:00
patchback[bot]
41ba810463
[PR #6469/9395df1c backport][stable-7] Inspq keycloak role composites (#6693)
Inspq keycloak role composites (#6469)

* Add composites to keycloak_role module

* Add composites support for realm role in keycloak module_utils

* Clean f.write from keycloak_role module

* keycloak_role support state for realm role composites

* Add support for composites in client role for keycloak_role module

* Add changelog fragment for keycloak role composites PR

* Fix pep8 and validate-modules tests errors

* Update changelogs/fragments/6469-add-composites-support-for-keycloak-role.yml

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

* Update plugins/modules/keycloak_role.py

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

* Update plugins/modules/keycloak_role.py

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

* Update plugins/modules/keycloak_role.py

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

* Update plugins/modules/keycloak_role.py

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

* Update plugins/modules/keycloak_role.py

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

* Update plugins/modules/keycloak_role.py

I will try it

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

* Fix test_keycloak_role assertion

* Fix role composite compare before update in keycloak_role module

* Fix realm problem with update_role_composites in keycloak.py module_utils

* Add units tests for composites and client roles in keycloak_role module

* Update plugins/module_utils/identity/keycloak/keycloak.py

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

* Update plugins/module_utils/identity/keycloak/keycloak.py

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

* Change try in is_struct_included and add unit tests for keycloak.py module_utils

* Add integration tests for composites roles and fix bug with non master roles in keycloak_role module

* Update plugins/modules/keycloak_role.py

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

* Update plugins/modules/keycloak_role.py

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

* Update plugins/modules/keycloak_role.py

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

* Update plugins/module_utils/identity/keycloak/keycloak.py

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

* Update plugins/module_utils/identity/keycloak/keycloak.py

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

* is_struct_included refactor

---------

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

Co-authored-by: Philippe Gauthier <philippe.gauthier@inspq.qc.ca>
2023-06-15 08:42:10 +02:00
patchback[bot]
a8f5926da3
[PR #6688/032996e0 backport][stable-7] Fix composites comparison for role in is_struct_included keycloak.py … (#6690)
Fix composites comparison for role in is_struct_included keycloak.py … (#6688)

* Fix composites comparison for role in is_struct_included keycloak.py function

* Add changelog fragment and unit tests

* Update changelogs/fragments/6688-is-struct-included-bug-in-keycloak-py.yml

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

---------

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

Co-authored-by: Philippe Gauthier <philippe.gauthier@inspq.qc.ca>
2023-06-14 23:30:33 +02:00
patchback[bot]
f986b97c9a
[PR #6669/74ffb295 backport][stable-7] rhsm_release: improve the execution of subscription-manager (#6674)
rhsm_release: improve the execution of subscription-manager (#6669)

- pass the arguments to run_command() directly as list, rather than
  joining the arguments to string, which run_command() will need to
  split again
- disable the expansions of variables, as there are none

Adapt the unit test to the different way run_command() is called,
factorizing the kwargs for run_command() so there is less repetition.

There should be no behaviour changes.

(cherry picked from commit 74ffb29573)

Co-authored-by: Pino Toscano <ptoscano@redhat.com>
2023-06-11 12:05:42 +02:00
patchback[bot]
396b94183d
[PR #6658/42f7531f backport][stable-7] redhat_subscription: refactor of internal Rhsm class (#6667)
redhat_subscription: refactor of internal Rhsm class (#6658)

The two RegistrationBase & Rhsm classes were copied from the ones in the
shared module_utils.redhat module; that said:
- the versions here got improvements over the years
- the RegistrationBase in module_utils.redhat is used only by the RHN
  modules, which are deprecated and slated for removal

Hence, the classes here can be kept and simplified a bit:
- fold the non-dummy content of RegistrationBase into Rhsm: there is no
  more need for the separate RegistrationBase base class
- drop the init arguments "username", "password", and "token": the
  instance variables of them are not used anywhere, as the needed
  credentials (together with other variables) are passed to the
  register() method
- create the Rhsm object later in main(), after the AnsibleModule
  creation and the uid check: this avoids the creation of Rhsm with a
  null module variable, changing it later

There should be no behaviour change.

(cherry picked from commit 42f7531f21)

Co-authored-by: Pino Toscano <ptoscano@redhat.com>
2023-06-10 21:10:56 +02:00
patchback[bot]
04162da6c9
[PR #6476/07a5f07e backport][stable-7] Inspq keycloak user module (#6645)
Inspq keycloak user module (#6476)

* Add Keycloak User Module

* keycloak_user refactoring

* Add changelog fragment for breaking changes

* Fix Copyright for keycloak_user module

* Add keycloak_user module to BOTMETA

* Remove ANSIBLE_METADATA and override aliases for auth_username argument spec

* Update plugins/modules/keycloak_user.py

Updated short description

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

* Update plugins/modules/keycloak_user.py

Fix keycloak_user module description

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Dedent and use FQCN's for examples in keycloak_user module

* Fix examples in keycloak_user module documentation

* keycloak_user refactoring

* Add changelog fragment for breaking changes

* Remove ANSIBLE_METADATA and override aliases for auth_username argument spec

* Fix merge error on keycloak_user module changelogs fragment

* Add integration test for keycloak_user module

* Fix yamllint errors in keycloak_user integration tests

* Add README.md and fix integration tests for keycloak_user module

* Add Copyright and license in README.md integration tests keycloak_user module

* Update changelogs/fragments/6476-new-keycloak-user.module.yml

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

* Fix argument_spec auth_username aliases for keycloak_user module

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Add units tests for keycloak_user module

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Remove default value for keycloak_user enabled module parameter

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* keycloak_user refactoring

* Remove ANSIBLE_METADATA and override aliases for auth_username argument spec

* Update plugins/modules/keycloak_user.py

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

* Dedent and use FQCN's for examples in keycloak_user module

* Fix examples in keycloak_user module documentation

* keycloak_user refactoring

* Add changelog fragment for breaking changes

* Remove ANSIBLE_METADATA and override aliases for auth_username argument spec

* Fix merge error on keycloak_user module changelogs fragment

* Update changelogs/fragments/6476-new-keycloak-user.module.yml

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

* Fix argument_spec auth_username aliases for keycloak_user module

* Update plugins/modules/keycloak_user.py

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

* Remove github Workflow

* Remove bugfix from changelog fragment

* Fix indentation in examples for keycloak_user module

* Fix examples in documentation for keycloak_user module

* Remove PR 6476 changelog fragment

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Update plugins/modules/keycloak_user.py

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

* Restore ansible-test.yml

* Add msg output and RETURN documentation for keycloak_user module

* Fix RETURN documentation for keycloak_user module

* Fix msg for keycloak_user module

---------

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

Co-authored-by: Philippe Gauthier <philippe.gauthier@inspq.qc.ca>
2023-06-09 12:56:06 +02:00
patchback[bot]
7ee0389c98
[PR #6602/59db302d backport][stable-7] VarDict module utils: add as_dict() method (#6610)
VarDict module utils: add `as_dict()` method (#6602)

* VarDict module utils: add `as_dict()` method

* add changelog frag

(cherry picked from commit 59db302deb)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-05-31 08:32:10 +02:00
patchback[bot]
e55df1c63e
[PR #6511/486f6553 backport][stable-7] VarDict module utils (#6594)
VarDict module utils (#6511)

* vardict: easy hadling of module variables

* fix copyright year

* initial tests passing

* small adjustments

* add tests

* add to BOTMETA

* remove unused import pytest

* Update plugins/module_utils/vardict.py

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

* minor refactor and documentation

* minor adjustments

* rename VarDict.var() to VarDict._var()

- plus add more docs

* fix method name in tests

---------

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

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-05-29 21:18:03 +02:00
patchback[bot]
443d5a2a5f
[PR #6527/cb1e6376 backport][stable-7] nmcli: Fix bond option xmit_hash_policy (#6556)
nmcli: Fix bond option xmit_hash_policy (#6527)

* nmcli_bond_xmit_fix

* Create 6527-nmcli-bond-fix-xmit_hash_policy.yml

add changelog

* Update changelogs/fragments/6527-nmcli-bond-fix-xmit_hash_policy.yml

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

* unit tests extend

---------

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

Co-authored-by: Sergey Putko <mail@psvlan.com>
2023-05-21 17:24:39 +02:00
Dominik Kukacka
ca3beb68de
Add ipbase_info module (#6477)
* Add ipbase_facts module

* Fixes

* Fix

* check

* Move to _info

* Fixes

* Add apikey

* check

* check

* Fix

* check

* check

* Add test

* Go

* Fix test

* Fix

* load vs loads

* check

* make pep happy

* test

* check

* fix

* check

* fix

* Some typo fixes

* Fix YAML boolean.

* Docs improvement.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-09 19:48:29 +02:00
Sam Potekhin
c949f3a834
nmcli: added new module option 'slave_type' to allow create non-ethernet slave connections (#6108)
* nmcli: added new module option 'slave_type' to allow create non-ethernet slave connections

* argument specs updated

* documentation updated

* examples updated

* added warning message when using type='bridge-slave'

* remove trailing whitespace

* Added warnings about rewrite 'slave-type' property when using type one of 'bond-slave', 'bridge-slave', 'team-slave'.
Added module fails when user sets contradicting values of 'slave-type' for types 'bond-slave', 'bridge-slave', 'team-slave'.
Returned back checking for types that can be a slave to assign 'master' and 'slave-type' properties.

* Extending list of slave-conn-types

* Update plugins/modules/nmcli.py

Version updated

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

* Update plugins/modules/nmcli.py

Updated documentation for `slave_type`

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

* Updated argspec's 'required_by' for 'master' property.

* Fixed mistake in property  naming in module argspec.

* changelog fragment and module docs updated

* Validation of 'master', 'slave_type' options improved. (rebased)

* Validation of 'master' and 'slave_type' separated to special method.

* Wrote 6 tests for slave_type option behaviour

* Removed erroneously added property 'hairpin'

* Update version_added for 'slave_type'

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

* Update changelogs/fragments/473-nmcli-slave-type-implemented.yml

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

* Update plugins/modules/nmcli.py

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

* Let master be without slave_type

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-08 19:44:30 +02:00
Alexei Znamensky
3c20261264
gconftool2: fix change output (#6270)
* gconftool2: fix change output

* add changelog frag

* gconftool2: improve visibility on the output

* fix obtaining updated value after `set`

* use issue URL in the changelog fragment

* fix further issues

* fix return value docs + changelog frag

* Update plugins/modules/gconftool2.py

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

* fix return value doc

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-03 22:45:35 +02:00
Alexei Znamensky
d254372d37
puppet: fix noop parameter error (#6458)
* puppet: fix noop parameter error

* add changelog frag
2023-05-03 22:45:01 +02:00
Felix Fontein
24efe6b9db
Make sure that plugins/module_utils/deps.py is cleaned up before every test (#6459)
Make sure that plugins/module_utils/deps.py is cleaned up before every test.

ci_complete
2023-04-29 21:46:12 +02:00
Alexei Znamensky
6e913a3b28
dnsimple_info: remove extraneous importorskip from test (#6439)
* dnsimple_info: remove extraneous importorskip from test

* remove yet another extraneous importorskip from test
2023-04-28 10:05:24 +02:00
Felix Fontein
0a26b6d48d
Prepare main for 7.0.0 (#6428)
* Bump version to 7.0.0.

* Remove deprecated parameters and change some defaults for 7.0.0.

* Remove deprecated alias.

* Adjust tests.
2023-04-26 07:32:00 +02:00
Georg Gadinger
cb3ca05bd1
one_vm: fix syntax error when creating VMs with a more complex template (#6294)
* one_vm: fix syntax error when creating VMs with a more complex template

with more complex templates that make use of quoted strings the new
"render" method fails to produce a template that is accepted by
OpenNebula.  ==> escape double quotes in strings to make OpenNebula
happy again.

I also tested whether newlines need to be escaped, looks like they are
fine as they are.

Fixes #6225

* module_utils/opennebula: skip empty values in render
2023-04-16 13:22:49 +02:00
Sergey Putko
29a7d24d75
nmcli: Add macvlan connection type support (#6312)
* add nmcli macvlan type

* changelog

* improve docs

* macvlan params

* fix linter and improve module params

* improve_docs

* raise error if type macvlan and macvlan options not set
2023-04-16 13:22:11 +02:00
Jon-Paul Lindquist
ea8720f572
Add skip_tags option to Puppet module (#6293)
* Add Puppet skip_tags option

* Include changelog fragment

* Apply suggestions from code review

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-04-13 06:40:54 +02:00
Roy Lenferink
f52dd194f9
Add new merge_variables lookup plugin (#5533)
* Add new merge_variables lookup plugin

* Add changelog fragment

* Process bot feedback

* Refactor override options and add pattern_type option

* Fix unit tests

* Changed default pattern_type and simplified plugin based on feedback

* Processed feedback for merge_variables lookup plugin

* Adjust version_added.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-26 11:27:30 +02:00
Alex Groshev
d4f272ba52
nmcli: add runner_fast_rate option (#6148)
* add runner_fast_rate option

* unset default value for runner_fast_rate parameter

* add some commas

* Remove default in copy of argspec.

Co-authored-by: Sam Potekhin <eax24@ya.ru>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Sam Potekhin <eax24@ya.ru>
2023-03-26 09:27:00 +02:00
Léo GATELLIER
f3be0076af
Add Gitlab group runners support (#3935) 2023-03-25 08:23:20 +01:00
Jeffrey Cutter
ed8049a220
nmcli: add new addr_gen_mode6 options (#5974)
* nmcli: add new addr_gen_mode6 options

* Add changelog fragment.

* Update plugins/modules/nmcli.py

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

* Adjust documentation.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-24 07:55:58 +01:00
Pino Toscano
bbd68e26a2
redhat_subscription: require credentials only when needed (#5664)
The module currently has a static 'required_if' statement for its
parameters that forces any of 'username' or 'activationkey' or 'token'
in case state=present; while this is generally a good idea, it can be
an extra requirements in some cases. In particular, if the system is
already registered, there is no need for credentials -- some of the
operations of the module, such as manipulating pools, can be done
perfectly without credentials.

Hence:
- change the static 'required_if' to require credentials only when
  forcing the registration
- check for credentials manually when a registration is needed, i.e.
  on an unregistered system; the fail message is the same as the one
  shown by 'required_if'

Adapt the tests to this new situation:
- test_without_required_parameters now needs to mock an unregistered
  system
- add a new version of test_without_required_parameters to test an
  already registered system
- add a simple test case for only state=present usable on an already
  registered system
- remove the credentials from a test case for pool attachment that
  mocks an already registered system
2023-03-22 20:19:55 +01:00
Pino Toscano
9f67cbbe36
rhsm modules: cleanly fail when not run as root (#6211)
subscription-manager on RHEL installs a symlink in /usr/bin to
console-helper (part of usermode), which triggers an interactive prompt
for root credentials when run as user. It seems that console-helper
does not handle well non-interactive contexts (e.g. without a TTY for
input), and thus it will hang waiting for input when run as user in an
Ansible task.

Since subscription-manager requires root already anyway (and it will
fail when explicitly run as user), then apply the same logic locally on
all the modules that interact with it: redhat_subscription,
rhsm_release, and rhsm_repository.
2023-03-22 13:15:32 +01:00
Pino Toscano
e939cd07ef
redhat_subscription: use D-Bus for registration if possible (#6122)
subscription-manager currently does not have a way to get credentials
(username, password, activation keys, organization ID) in a secure way:
the existing command line parameters can be easily spotted when running
a process listing while 'subscription-manager register' runs.
There is a D-Bus service, which is used by e.g. cockpit and Anaconda to
interface with RHSM (at least for registration and common queries).

Try to perform the registration using D-Bus, in a way very similar to
the work done in convert2rhel [1] (with my help):
- try to do a simple signal test to check whether the system bus works;
  inspired by the login in the dconf module
- pass most of the options as registration options; for the few that are
  not part of the registration, execute 'subscription-manager' manually
- add quirks for differently working (or not) registration options for
  the D-Bus Register*() methods depending on the version of RHEL
- 'subscription-manager register' is used only in case the signal test
  is not working; silent fallback in case of D-Bus errors during the
  registration is not done on purpose to avoid silent fallback to a less
  secure registration

[1] https://github.com/oamg/convert2rhel/pull/540/
2023-03-14 22:52:51 +01:00