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

1910 commits

Author SHA1 Message Date
Felix Fontein
7ae8cc9902
Semantic markup: use E() in more places (#6699)
Use semantic markup.
2023-06-15 09:29:30 +02:00
Gnonthgol
8801463575
plugins/modules/ldap_search: Add support for multipage searches (#6648)
* Add more integration tests for ldap_search

* Add new page_size option to ldap_search

* Add changelog fragment

* Apply suggestions from code review

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

* Simplify if statement to reduce negatives

* Apply suggestions from code review

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-06-15 07:19:55 +02:00
Gnonthgol
f3ecf4c7f8
ldap: Add client certificate support (#6668)
* Set up secure ldap server

* ldap: Added client cert options

Shamelessly copied from https://github.com/andrewshulgin/ldap_search

* Added tests for ldap client authentication

* Add changelog fragment

* Make sure the openssl commands work on older versions of openssl

* Apply suggestions from code review

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

* Remove aliases for new arguments

* Add required_together to ldap module declerations

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-06-15 07:19:29 +02:00
Alexei Znamensky
bb2169340d
csv module utils: detect unicode BOM in content (#6662)
* csv module utils: detect unicode BOM in content

* fix handling of py2

* fix comment

* add changelog frag

* add missing link

* simplification
2023-06-15 07:19:16 +02:00
Philippe Gauthier
9395df1c6f
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>
2023-06-15 06:57:30 +02:00
Ondrej Zvara
9f47cdde32
New module: gitlab_merge_request.py (#6605)
* feat(gitlab_merge_request): initial module version

* feat(gitlab_merge_request): adding assignees & reviewers

* fix(gitlab_merge_request): sanity fixes

* chore(gitlab_merge_request): adding BOTMETA record

* chore(gitlab_merge_request): integration tests

* docs(gitlab_merge_request): updating modules documentation

* fix(gitlab_merge_request): proper module return values

* fix(gitlab_merge_request): remove duplicate target_branch query

* docs(gitlab_merge_request): apply improvements suggested from code review

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

* docs(gitlab_merge_request): updates to description and minor fixes based on code review

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

* chore(gitlab_merge_request): add aliases file for integration tests

* fix(gitlab_merge_request): use with syntax for IOErrors handling

Co-authored-by: Léo GATELLIER <26511053+lgatellier@users.noreply.github.com>

* fix(gitlab_merge_request): inverted message parameters

* refactor(gitlab_merge_request): use shared find_project method

* refactor(gitlab_merge_request): use username filter for user retrieval

* fix(gitlab_merge_request): handling of empty user search result

* test(gitlab_merge_request): extends integration tests suite for merge request changes

* chore(gitlab_merge_request): sanity validation & licensing fixes

* docs(gitlab_merge_request): formatting changes to documentation

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

* chore(gitlab_merge_request): licensing of test files fixed

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

* docs(gitlab_merge_request): extends description & adds code comments

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Léo GATELLIER <26511053+lgatellier@users.noreply.github.com>
2023-06-15 06:55:49 +02:00
Philippe Gauthier
032996e005
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>
2023-06-14 22:34:45 +02:00
Paul Levytskyi
1f6d404deb
Proxmox inventory plugin: support composite variables (#6641)
* Added composite var support for proxmox inventory plugin

* Composite variables support for Proxmox nodes in dynamic inventory plugin
Fixes #6640

* Composite variables support for Proxmox nodes in dynamic inventory plugin
Fixes #6640

* Added composite var support for proxmox inventory plugin

* Added composite var support for proxmox inventory plugin

* Update changelogs/fragments/6640-proxmox-composite-variables-support.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-06-12 21:44:26 +02:00
Pino Toscano
2dbe529a90
rhsm_repository: deprecate "state=present" and "state=absent" (#6673)
"state=present" is broken, and acts like "disabled"; also, the
subscription repositories cannot be really "added" or "removed", which
is what "present" and "absent" would imply, but only enabled or
disabled. Hence, deprecate both these states, slating them for removal
in community.general 10.0.0.
2023-06-11 10:38:09 +02:00
Pino Toscano
74ffb29573
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.
2023-06-11 08:34:25 +00:00
Alexei Znamensky
2bd8469a92
VarDict: convenience methods (#6647)
* vardict module util: add methods as_dict and get_meta

* add test for get_meta()

* update reserved named in VarDict

* add changelog frag

* add breaking change to changelog frag
2023-06-11 08:34:06 +00:00
Pino Toscano
42f7531f21
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.
2023-06-10 15:03:34 +02:00
Pino Toscano
78c42def04
Deprecate module_utils.redhat (#6663)
This module contains bits that are either unused (the Rhsm* classes), or
used only by deprecated modules (the RegistrationBase class).
Considering that the bits here have not seen updates in years, it is
unlikely that anyone is actually using them as "library".

Hence, deprecate the whole module altogether:
- the Rhsm* classes, as not used by anything, are slated for removal in
  9.0.0
- the RegistrationBase class is slated for removal in 10.0.0, together
  with its only user (i.e. the rhn_register module)
2023-06-10 13:26:14 +02:00
Felix Fontein
011b2f8bdc
Start using semantic markup (#6627)
* Start using semantic markup.

* Forgot some places.

* Fix typo.

* Use 'ignore:' prefix until https://github.com/ansible-community/antsibull-docs/pull/155 is out.

* Break too long line.
2023-06-10 09:28:40 +02:00
delinea-sagar
eddd1ba4f2
Fetch secret id's which are in folder by folder id (#6652)
Added function to fetch secret id's by folder id
2023-06-09 17:14:05 +02:00
Pino Toscano
61b889749e
redhat_subscription: deprecate "pool" (#6650)
The "pool" option is slower to use, and the regexp may expand to broader
results than wanted. Because of that, deprecate it in favour of the
"pool_ids" options (which is much better), slating it for removal in
community.general 10.0.0.
2023-06-09 13:27:38 +02:00
Alexei Znamensky
994f08b37a
MH VarsMixin deprecation (#6649)
* MH VarsMixin deprecation

* add changelog frag
2023-06-09 13:27:22 +02:00
Pino Toscano
621bedf751
redhat_subscription: officially deprecate "autosubscribe" (#6646)
The "autosubscribe" alias for the "auto_attach" option has been
deprecated for many years, although only in the documentation.
Officially mark it as deprecated also in the module parameters spec,
slating it for removal in 9.0.0.
2023-06-09 13:20:40 +02:00
Alexander Petermann
7216286466
proxmox_snap: allow set retention for snapshots (#6577)
* proxmox_snap: allow to trim snapshots

* proxmox_snap: add changelog fragment for trim parameter

* proxmox_snap: fix linter issues

* Update plugins/modules/proxmox_snap.py

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

* Update changelogs/fragments/6576-proxmox-snap-allow-trimming.yml

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

* proxmox_snap: rename 'trim' into 'retention'

* proxmox_snap: improve docu, as suggested by felixfontein

* proxmox_snap: rename 'trim' in changelog

* Update plugins/modules/proxmox_snap.py

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

* Update plugins/modules/proxmox_snap.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-06-09 12:56:22 +02:00
Alexei Znamensky
494909aba5
MH mh/mixins/deps.py: prevent deprecation warning when no deps are specified (#6644)
* MH mh/mixins/deps.py: prevent deprecation warning when no deps are specified

* rollback empty "patch" on license markers to prevent test error

* disable test in ansible 2.12

* add changelog frag
2023-06-09 12:56:10 +02:00
Philippe Gauthier
07a5f07eaa
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>
2023-06-09 06:17:44 +02:00
Victor Martinez
58958fc417
opentelemetry: add span event attributes (#6531)
* add span event attributes (task name and host name)

* add fragment

* refactor: use set_attributes

* Add same span attributes to the event

* chore: change description in the fragment

* as mentioned in the code review

* use flag to disable the attributes in logs

there are some vendors that might not require those attributes since those details are shown in the UI when accessing the spans, i.e.: jaeger

* Update plugins/callback/opentelemetry.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-06-06 20:54:58 +02:00
Alexei Znamensky
b78d1999e1
snap: aware of channel in installed snaps (#6435)
* [WIP] snap: aware of channel in installed snaps

* parse snap list output and assert whether channel matches

* undo test

* fail rightfully when install with different channel does not work

* transparetent refresh

* rollback comment in integration test

* rollback comment in integration test

* add changelog frag

* Update plugins/modules/snap.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-06-06 20:49:12 +02:00
Tristan Pinaudeau
91b692634e
Fixed typo in record_values documentation (#6620) 2023-06-06 05:59:32 +02:00
Mike Raineri
c4e7a943c0
Redfish: Add MultipartHTTPPushUpdate (#6612)
* Redfish: Add MultipartHTTPPushUpdate

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

* Updates based on CI results

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

* Update plugins/modules/redfish_command.py

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

* Update changelogs/fragments/6471-redfish-add-multipart-http-push-command.yml

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

* Update plugins/modules/redfish_command.py

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

* Update plugins/module_utils/redfish_utils.py

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

* Update plugins/module_utils/redfish_utils.py

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

* Update plugins/module_utils/redfish_utils.py

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

* Update plugins/module_utils/redfish_utils.py

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

* Added missing import statement

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

* Added documentation for the usage of 'timeout'

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

---------

Signed-off-by: Mike Raineri <michael.raineri@dell.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-06-05 21:56:44 +02:00
Chris Evich
36e8653cf7
Minor bitwarden plugin req. docs addition (#6613)
The Bitwarden CLI requires a `login` followed by an `unlock` operation.
The later will display a message regarding setting (and exporting) the
`$BW_SESSION` env. var. When using the `bitwarden` lookup plugin, having
the env. var. set and available (exported) to Ansible is critical.
Without it, the plugin will simply return the error:

`Bitwarden Vault locked. Run 'bw unlock'.`

Make this clearer in the requirement documentation.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-06-05 21:18:12 +02:00
Sergei Antipov
16abb96bd8
New Proxmox VE modules to handle pools and their membership (#6604)
* New Proxmox VE modules to handle pools and their membership

* Fix pep8 linting errors

* Fix pep8 and compatibility errors

* Add required fields in the documentation

* Typo fix

* Fix pylint errors

* Fix the last one error

* Address review comments

* Fix linting error

* Add integration tests playbook

* Add assert for the diff mode

* Address review comments

* Fix typo in the word

* Fail for non-empty pool even in check_mode
2023-06-05 21:17:31 +02:00
nxet
f71a474726
proxmox: support param timezone when creating container (#6510)
* proxmox: support param `timezone` when creating container

* add changelog fragments for #6510

* Apply suggestions from code review

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

* Improved param description

* Use major.minor version comparison for options

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Sergei Antipov <s.antipov@mulesoft.com>
2023-05-31 08:01:47 +02:00
Alexei Znamensky
59db302deb
VarDict module utils: add as_dict() method (#6602)
* VarDict module utils: add `as_dict()` method

* add changelog frag
2023-05-31 07:58:54 +02:00
Alexei Znamensky
c9aae5e45c
CmdRunner module utils: deprecate format method as_default_type() (#6601)
* CmdRunner module utils: deprecate format method `as_default_type()`

* add changelog frag
2023-05-31 07:58:28 +02:00
Jeff Turner
01f21b1d46
proxmox_kvm: support for tpmstate0 parameter (#6533)
* proxmox_kvm: added support for tmpstate

adds hash of options for a TPM state disk, which is required for Windows 11 installations

* updated wrong version in docs

* bump version 7.1.0 -> 7.1.1

* fixed parameter name typo

* updated to pass sanity; assumed version_added to be next major (7.2.0)

* replaced 'tpmstate' with 'tpmstate0'; added suboptions to kvm_args

* fixed line too long

* use get() instead of pop() to preserve verbose invocation.module_args

* update comment to include tpmstate0

* added changelog fragment

* Revert "bump version 7.1.0 -> 7.1.1"

This reverts commit 772ed98dba.

* Include PR link in changelog fragment

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

* Corrected version_added

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

* corrected semantic markup for option name

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

* set suboptions of tpmstate0 to required

* set default for tpmstate0.version (2.0)

* fixed typo

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

* wrapped default version string in quotes

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

* Improve changelog formatting.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-29 18:56:57 +02:00
Sergei Antipov
b133aa40c6
proxmox_kvm | Expose timeout param to stopped state (#6570)
* Expose timeout param to stopped state

Forcefully stop virtual machine using timeout param for proxmox vm
shutdown api call.

* Add changelog fragment

* Typo fix in timeout param description

* Update changelogs/fragments/6570-handle-shutdown-timeout.yaml

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

* Update plugins/modules/proxmox_kvm.py

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

* Revert back exception message

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-29 18:56:33 +02:00
Gonéri Le Bouder
c76af60a73
ini_file: Don't creates new file instead of following symlink (#6546)
* ini_file: Don't creates new file instead of following symlink

This is a bug fix that address a situation where `community.general.ini_file`
was destroying symlinks instead of updating of updating their targets.

Closes: #6470

* ini_file: add the follow parameter

If `poth` points on a symlink and `follow` is true, the `ini_file` plugin
will preserve the symlink and modify the target file.

* adjust the documentation of the new key

- yes/no -> true/false.
- new key will be introduced in 7.1.0.
- clean up the `state=link` part.
2023-05-29 18:56:06 +02:00
Benibr
0c96d22994
gitlab modules: added instance variable (#6524)
* gitlab modules: added instance variable

* fixup

* first review

* renamed to variables (groups->instance)
* added 'version_added'

* better disscription of 'updated' return value

* removed unneccessary import error check

* removed environment scope

* added vars_to_variables import

* added maintainer to .github/BOTMETA.yml

* second review

* removed vars

* readded postprocessing

* added integration test

---------

Co-authored-by: Benedikt Braunger <bebr@adm.ku.dk>
2023-05-29 18:55:42 +02:00
Felix Fontein
57f8d84776
Improve/fix dconf documentation using semantic markup (#6544)
Improve/fix dconf documentation using semantic markup.
2023-05-29 18:55:12 +02:00
Alexei Znamensky
4c0eff02e5
sorcery: moved import to top (#6525)
* sorcery: moved import to top

* add changelog frag

* Update changelogs/fragments/6525-sorcery-import.yaml

Co-authored-by: Vlad Glagolev <vaygr@users.noreply.github.com>

---------

Co-authored-by: Vlad Glagolev <vaygr@users.noreply.github.com>
2023-05-29 18:54:35 +02:00
Alexei Znamensky
486f6553f5
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>
2023-05-29 18:54:17 +02:00
Orion Poplawski
8586adcd51
plugins/inventory/cobbler: Add option to use system name for inventory (#6502)
* plugins/inventory/cobbler: Add option to use system name for inventory hostname (#6492)

* plugins/inventory/cobbler: Add warning for systems with empty profiles
2023-05-29 18:53:56 +02:00
Justine Jose
4373f2f33b
mas: disable sign-in check for macOS 12+ (#6520)
* disable sign-in check for macOS 12+

* move is_version_greater func outside class Mas

* fix formatting

* remove trailing whitespace

* make use of LooseVersion to compare versions

* update requirement description

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

* update requirement description link

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

* update constant of macOS version

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

* use updated constant

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

* update getting macOS version

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

* add changelog fragment

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-29 18:53:20 +02:00
Maxwell G
bd6cec2105
respawn copr module when dnf is missing (#6522)
* respawn copr module when dnf is missing

Fixes: https://bugzilla.redhat.com/2203513

* don't guard common.respawn module_util import
2023-05-29 18:52:50 +02:00
Alexei Znamensky
e588e675d9
opkg: remove useless default value for force (#6513)
* opkg: remove useless default value for force

* add changelog frag

* Update changelogs/fragments/6513-opkg-default-force.yml

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

* add to force param description

* typo

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-29 18:52:29 +02:00
Alexei Znamensky
64f74e1228
cpanm: deprecate default mode (#6512)
* cpanm: deprecate default mode

* add changelog frag
2023-05-29 18:52:02 +02:00
day4me
ee47497e97
datadog_monitor: Added notification preset name and renotify options (#6523)
* added notification_preset_name to datadog_monitor module

* added renotify optiond

* fix renotify_interval

* remove renotify_interval, it's already there

* add renotify_status only if renotify_interval not None

* add default for renotify_occurrences

* fix renotify_occurrences

* set renotify_occurrences default to 1

* fix renotify_occurrences

* fix renotify_occurrences

* fix renotify_occurrences

* fix renotify_occurrences

* fix renotify_statuses

* fix renotify_statuses

* fix renotify_statuses

* fix renotify_statuses

* final changes

* added changelog fragment

* added choices for renotify_statuses and changed version

* remove choices duplication

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-29 18:51:43 +02:00
Philippe Gauthier
27fe14bfc1
Fix get_user_by_username in keycloak library (#6568)
* Fix get_user_by_username in keycloak library for keycloak_user_rolemapping module

* Add changelog fragment for keycloak.py bug fix
2023-05-29 15:32:15 +02:00
Sergei Antipov
29790df583
Don't require api_password when api_token_id is used in proxmox_tasks_info (#6554)
* Don't require api_password when api_token_id is used in proxmox_tasks_info

* Add changelog fragment

* Fix casing.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-22 06:32:26 +02:00
tover99
a9fd9f8982
added handling of zypper exitcode 102: ZYPPER_EXIT_INF_REBOOT_NEEDED (#6534)
* added handling of zypper exitcode 102: ZYPPER_EXIT_INF_REBOOT_NEEDED - Returned after a successful installation of a patch which requires reboot of computer.

The exitcode 102 will be treated exactly like 0 by the module internally now, and the changed status will be reported correctly. However, since I preserve the rc 102 in the retvals to allow the playbook to react to the requested reboot, the task must still include a "failed_when: zypper_cmd.rc not in [0, 102]" to not fail in this case.

* removed trailing whitespaces

* added changelogs fragment

* Fix typo.

Co-authored-by: Alex <alexgubin@gmx.de>

* Add URL.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alex <alexgubin@gmx.de>
2023-05-22 06:24:53 +02:00
s-hamann
5f968fb075
portage: fix changed_use and newuse not triggering rebuilds (#6008) (#6548)
* portage: fix changed_use and newuse not triggering rebuilds (#6008)

* Add changelog fragment

* Update changelogs/fragments/6548-portage-changed_use-newuse.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-21 21:36:46 +02:00
Sergey Putko
cb1e6376db
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>
2023-05-21 17:03:38 +02:00
Tamerlan Bimzhanov
08377df7a5
Fix code formatting in documentation of dconf.py (#6538)
* Fix code formatting in documentation of dconf.py

* Update plugins/modules/dconf.py

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

* Update plugins/modules/dconf.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-20 14:33:00 +02:00
Peter Upton
88f7b5a675
Shutdown systemd without sysv (#6171)
* setup test

* inital working commit to enable shutdown using systemd

* add changelog fragment

* address sanity checks

* fix changelog fragement

* update to combine args and command

* fix self pararm

* fix pylint output

* cleanup test

* fix tests

* fix systemd missing failure message

* broaden test coverage

* address pr feedback

* address sanity test results

* fix tests

* fix tests

* pep8 sanity fix

* fix test conditional ordering

* quick fix for pep8

* Update changelogs/fragments/6171-shutdown-using-systemd.yml

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

* Update changelogs/fragments/6171-shutdown-using-systemd.yml

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

* Fix indentation.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-09 20:10:09 +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
Pino Toscano
aa6b5e4a60
Deprecate rhn_channel & rhn_register (#6493)
They are useful only with RHN, which Red Hat discontinued many years
ago, and with Spacewalk 5, which is EOL for more than 3 years;
while they could be potentially used with Uyuni / SUSE Manager (fork of
Spacewalk 5), we have not heard about anyone using it in those setups.

Hence, deprecate these two modules, with their removal planned for
10.0.0 in case there are no reports about being still useful, and
potentially noone that steps up to maintain them.
2023-05-09 19:30:19 +02:00
Max Juhlke
6558c9981f
fix typo in terraform docs (#6503)
fix typo

The [Docs](https://docs.ansible.com/ansible/latest/collections/community/general/terraform_module.html) have a typo in the examples. `camplex_vars` should be spelled `complex_vars`. 

Since many people are copy-and-pasting from docs and modify them to their needs this typo is an annoyance for users.
2023-05-08 19:46:10 +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
Jonathan Kamens
9f3c86a589
dconf - Try to find a Python interpreter that has gi.repository.GLib (#6491)
* dconf - Try to find a Python interpreter that has gi.repository.GLib

If we're invoked in a Python interpreter that doesn't have access to
`gi.repository.GLib`, try to find one that does and respawn the task
in that interpreter.

* ChangeLog fragment for #6491

* Update changelogs/fragments/6491-dconf-respawn.yml

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

* Simplify import code

* Get rid of ModuleNotFoundError

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-08 19:42:49 +02:00
Alexei Znamensky
febe7a2fb4
gitlab modules: minor refactor (#6384)
* gitlab modules: minor refactor

* add changelog frag

* Update plugins/module_utils/gitlab.py

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

* Update plugins/module_utils/gitlab.py

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

* update changelog frag

* remove extraneous bracket

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-08 19:40:52 +02:00
ljkimmel
165182cdbf
mssql_script: allow non-returning SQL statements (#6457)
* feat: Allow non-returning SQL statements

- The current implementation fails out when certain statements or
  batches do not have resultsets - this limits the usefulness of the
  module
- Instead, it is known that statements without resultsets return then
  OperationalError exception with text "Statement not executed or
  executed statement has no resultset". We will utilize these facts to
  accept these statements
- The implementation also assumes that users will always use best-
  practices for the script syntax; that is, "GO" will always be
  capitalized but this is not strictly required -- update to allow "GO"
  to be any mixed-case

Signed-off-by: Lesley Kimmel <lesley.j.kimmel@gmail.com>

* feat: Add changelog fragment for change

- Add changelog fragment for PR 6192

Signed-off-by: Lesley Kimmel <lesley.j.kimmel@gmail.com>

* feat: Improve batching

- Previous batching had shortcomings like making strict assumptions
  about the format of the incoming script and did not handle Windows-
  based scripts (e.g. \r characters). It also did not handle cases where
  there were trailing or leading whitespace characters round the 'GO'
- Added a special case for removing the Byte Order Mark (BOM) character
  that may come as part of a script when slurped from some hosts.

Signed-off-by: Lesley Kimmel <lesley.j.kimmel@gmail.com>

* feat: Use str.splitlines()

- Use of this method is cleaner

Signed-off-by: Lesley Kimmel <lesley.j.kimmel@gmail.com>

* Update changelogs/fragments/6192-allow-empty-resultsets.yml

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

* fix: Update transcribing errors

- Replace local namespace with project namespace
- Remove 'return' statement from the module.fail_json call

Signed-off-by: Lesley Kimmel <lesley.j.kimmel@gmail.com>

---------

Signed-off-by: Lesley Kimmel <lesley.j.kimmel@gmail.com>
Co-authored-by: Lesley Kimmel <lesleyk@vmware.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-07 21:58:38 +02:00
Felix Fontein
61a0dc4370
proxmox_kvm: remove non-working example (#6498)
Remove non-working example.
2023-05-07 20:58:15 +02:00
Felix Fontein
4e57240e9f
terraform: fix warn() call (#6497)
Fix warn() call.
2023-05-07 20:57:54 +02:00
Alexei Znamensky
ca388f064a
snap: now using CmdRunner (#6468)
* snap: now using CmdRunner

* add changelog frag

* minor adjustment + comment

* simplified args for cmdrunner when retrieving snap options

* Update changelogs/fragments/6468-snap-cmdrunner.yml
2023-05-07 20:22:53 +02:00
joris
fe224a6537
modules/proxmox_kvm: initial support for online migrations (#6448)
* modules/proxmox_kvm: initial support for online migrations

* modules/proxmox_kvm: add version_added and changelog fragment

* modules/proxmox_kvm: update migrate description

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

* modules/proxmox_kvm: update failure message

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

* modules/proxmox_kvm: lowercase example boolean

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

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-06 16:07:25 +02:00
cfiehe
9c11230824
Fixes #5143: xfs_quota fails to initialize new project quotas (#6387)
This fix ensures that in case of a project quota, the corresponding project gets initialized, if required.

Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
Co-authored-by: Christoph Fiehe <c.fiehe@eurodata.de>
2023-05-06 07:12:21 +02:00
Felix Fontein
be1a905f6f
ldap_search: make sure output is always UTF-8 (by allowing to Base64 encode specific values, and force-converting everything else) (#6475)
* Simplify code.

* Make sure output is always UTF-8.
2023-05-05 07:56:48 +02:00
Felix Fontein
57cfd1b46d
deps module util: fix overzealous name cropping (#6479)
Fix overzealous name cropping.
2023-05-04 19:50:39 +12: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
Daniel Harding
fab717bb2d
modules/portage: fix usage with withbdeps: false (#6456)
Using ``withbdeps: false`` was causing the underlying emerge command to
fail due to not passing an argument to the ``--with-bdeps`` flag.  Fix
by updating the logic for generating the emerge command arguments to
ensure that ``withbdeps: false`` results in a passing an ``n`` argument
with the ``--with-bdeps`` emerge flag.
2023-05-03 22:44:28 +02:00
Alexei Znamensky
27a3d6d85d
dnsimple_info: minor refactor (#6440)
* dns_simple: minor refactor

* add changelog frag
2023-05-03 22:43:51 +02:00
delinea-sagar
91376f7989
tss lookup - Dev.secret (#6431)
* added support to download secret server secret attachments

* added support to download secret server secret attachments

* Fixed PR comments

* Fixed yaml lint errors

* Resolved the review comments

* Removed white space

* Added comment to explain usecase of parametrs

* Removed trailing whitespace

* Updated description of fetch_attachments variable

* Updated comment

* Fixed commnets and added changelog fragment

* Fixed lint error

* Removed the file a it's throwing lint error

* Added changelog fragment

* Fixed comment

* Fixed pr comment
2023-05-03 22:12:09 +02:00
Alexei Znamensky
9a4e77384d
ModuleHelper: updated/fixed imports in module_utils/module_helper.py (#6464)
* ModuleHelper: updated/fixed imports in module_utils/module_helper.py

* add changelog frag

* pylint disable unused imports

* now in the right file
2023-05-02 20:48:46 +02:00
Alexei Znamensky
f09b1e7f4c
MH mh/mixins/deps.py: deprecation (#6465)
* MH mh/mixins/deps.py: deprecation

* add changelog frag
2023-05-02 20:48:11 +02:00
Alexei Znamensky
b4628e27b2
awall: improve docs (#6442)
* awall: improve docs

* Update plugins/modules/awall.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-04-28 13:27:03 +02:00
Felix Fontein
c58dda14c2
passwordstore plugin: vendor FileLock that was removed from ansible-core devel (#6447)
Vendor FileLock that was removed from ansible-core devel.
2023-04-28 12:08:45 +02:00
Alexei Znamensky
d4df585370
snap_alias: refactor code out to module utils (#6441)
* snap_alias: refactor code out to module utils

* add changelog frag
2023-04-28 10:02:07 +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
Felix Fontein
e49c6a339e
ini_file: removing required=true for 'section' option (#6404)
Fix ini_file by removing required=true for 'section' option.
2023-04-23 16:51:18 +02:00
Felix Fontein
486c47f922
rhsm_release: removing required=true for 'release' option (#6401)
Fix rhsm_release by removing required=true for 'release' option.
2023-04-23 16:51:05 +02:00
Marc Sensenich
c1b16d534f
office_365_connector_card: Remove references to dev.outlook.com (#6390)
* office_365_connector_card: Remove references to dev.outlook.com

Remove references to the deprecated dev.outlook.com and update them to the relevant learn.microsoft.com links.

Closed #6262

* Fix PEP 8 line length issue

* Apply suggestions from PR review

* Update plugins/modules/office_365_connector_card.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-04-23 16:07:23 +02:00
Samuli Seppänen
bc228d82be
Add keycloak_authz_authorization scope module (#6256)
* Add keycloak_authz_authorization scope module

This module allows managing Keycloak client authorization scopes. The client has
to have authorization enable for this to work.

* botmeta: make mattock maintainer of keycloak_authz_authorization_scope

* botmeta: add mattock to team_keycloak

* keycloak_authz_authorization_scope: documentation and code layout fixes

* keycloak_authz_authorization_scope: do not fail on names with whitespace

* keycloak_authz_authorization_scope: use url quote method

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

* keycloak_authz_authorization_scope: style fixes to documentation

* keycloak_authz_authorization_scope: do not claim check/diff mode support

* keycloak_authz_authorization_scope: fix documentation

* keycloak_authz_authorization_scope: support check_mode and diff_mode

* keycloak_authz_authorization_scope: use more common terminology

Most keycloak modules use before_<object_type> and desired_<object_type> to
designate current and desired states of objects. Do the same for authorization
scopes.

* keycloak_authz_authorization_scope: fixes to check_mode and docs

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-04-23 14:07:58 +02:00
Alexei Znamensky
e7cc996470
deps module utils: add function failed() to retrieve dependencies check result (#6383)
* deps module utils: add function failed() to retrieve dependencies check result

* add changelog frag
2023-04-23 14:04:37 +02:00
Alexei Znamensky
3e338a1cca
udm_dns_record: minor refactor (#6382)
* udm_dns_record: minor refactor

* remove unused import

* improve ptr_record zone validation

* add changelog frag

* undo zone validation change as it breaks for IPv6 addresses
2023-04-23 14:01:53 +02:00
Alexei Znamensky
ad6ff9b0c5
cpanm: apply MH feature (#6385)
* cpanm: apply MH feature

* add changelog frag
2023-04-22 22:58:02 +02:00
efrikin
0eb33c2839
Add support env variables for nmap inventory plugin (#6352)
* Add support env variables for nmap inventory plugin

* Add  changelogs/fragments file

* Rename support-env-variables-to-nmap-dynamic-inventoiry to 6351-support-env-variables-to-nmap-dynamic-inventoiry

* Add extension for changelog file

* Fix https://github.com/ansible-collections/community.general/pull/6352#discussion_r1167973326

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

* Fix https://github.com/ansible-collections/community.general/pull/6352#discussion_r1167973295

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

* Fix https://github.com/ansible-collections/community.general/pull/6352#discussion_r1167973265

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

* Fix https://github.com/ansible-collections/community.general/pull/6352#discussion_r1167973193

* Fix linter

* Fix https://github.com/ansible-collections/community.general/pull/6352#discussion_r1168014445

* Fix changelog fragment.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-04-22 22:56:13 +02:00
fachleitner
114eb67f58
keycloak: Add option to create authentication sub-flow of type 'form flow' (#6318)
* keycloak: Improve API error message

* keycloak: Fix API error message

They key 'provider' is undefined.

* keycloak: Allow the creation of 'form-flow' authentication sub flows

To create something like keycloak's built-in registration flow,
we need to create a subflow with the type 'form-flow'.

* Add changelog fragment 6318

* Update changelogs/fragments/6318-add-form-flow.yml

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

* Update plugins/modules/keycloak_authentication.py

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

* Update plugins/modules/keycloak_authentication.py

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

* keycloak_authentication: Don't compare subFlowType

It is only useful for creation.

* Update changelogs/fragments/6318-add-form-flow.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-04-22 22:55:56 +02:00
Simon Pahl
1f2c7b1731
Add a module to set the keycloak client scope type (#6322)
The module keycloak_clientscope_type allows to set the client scope
types (optional/default) either on realm or client level.
2023-04-22 22:55:46 +02:00
Jan Sobczak
f4dd4d5ace
Add append option to ipa_hostgroup module (#6203)
* Add append option to ipa_hostgroup module

Signed-off-by: Jan Sobczak <jan.sobczak@soit.com.pl>

* Update plugins/modules/ipa_hostgroup.py

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

* Update plugins/modules/ipa_hostgroup.py

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

* Add changelog fragment

Signed-off-by: Jan Sobczak <jan.sobczak@soit.com.pl>

* Move choices argument to previous line

Signed-off-by: Jan Sobczak <jan.sobczak@soit.com.pl>

* Update plugins/modules/ipa_hostgroup.py

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

* Update changelogs/fragments/6203-add-append-option-to-ipa-hostgroup.yml

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

---------

Signed-off-by: Jan Sobczak <jan.sobczak@soit.com.pl>
Co-authored-by: Jan Sobczak <jan.sobczak@soit.com.pl>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-04-22 22:55:36 +02:00
Mike Raineri
484f642c23
Redfish iDRAC: Allow for specifying an exact manager with 'resource_id' for CreateBiosConfigJob (#6370)
Allow for specifying an exact manager with 'resource_id' for CreateBiosConfigJob

Signed-off-by: Mike Raineri <michael.raineri@dell.com>
2023-04-20 06:59:52 +02:00
Alexei Znamensky
4171418e37
snap_alias: fix regex expression when listing aliases (#6361)
* snap_alias: fix regex expression when listing aliases

* simplify regex, add changelog
2023-04-20 06:56:21 +02:00
Paul Aurich
996fc8c18e
pipx: fix state=latest w/ install_deps=true (#6303)
* pipx and pipx_info: Document that modules require pipx 0.16.2.1 or above

Since their introduction, these modules rely on 'pipx list --json' to
return machine-readable output about installed pipx applications. That
functionality was introduced in 0.16.2, along with a critical bug fix
(invalid json) in 0.16.2.1.

* pipx: fix state=latest with install_deps=true

"pipx upgrade" stopped supporting the "--include-deps" option
("install_deps" in the ansible module) in pipx 0.15
(https://pypa.github.io/pipx/changelog/#01500).

The lack of support causes the pipx module to fail if attempting to use
state=latest with install_deps, since the parameter is passed to both
pipx install (fine) and pipx upgrade (fails).

* Add changelog fragment
2023-04-20 06:43:49 +02:00
Gregory Furlong
ae5090d90e
New modules btrfs_subvolume / btrfs_info (#5832)
* Initial implementation for new modules btrfs_subvolume and btrfs_info

* Improve/flesh out documentation. Add ability to target filesystem by uuid, label or device. Update tests to test targeting filesystem by each supported parameter and when only mountpoint.

* Updates for btrfs modules. Add missing copyright notices. Switch options to contains in return documentation. Update btrfs_subvolume to always use closest parent mount.

* Add maintainers for btrfs module(s) and remove unused class member cause lint failure.

* Add changelog fragment. Attempt to only run against the VMs as part of CI.

* Updates per code review. Remove changelog fragment. Switch use of map to list comprehension. Add trailing comma to last item in multi-line dicts. Clean up documentation with complete senstences for descriptions and correct/consistent use of macros.

* Improved error handling in btrfs_subvolume module: add custom exception type, favor exceptions over immediate call to fail_json and add single top level return for failure scenarios. Normalize name and snapshot_source parameters early in module execution and remove unecessary duplicate normalization throughout processing.

* Add azp/posix/3 to aliases per feedback

* Clean up automatic mounting. Prevent automount when check_mode=True. Immediately fail if a mount is identified as required and automount=True. Identify the minimal subset of subvolumes that need to be mounted instead of just finding a single common root.

* Skip btrfs_subvolume integration tests if btrfs-progs isn't successfully installed.

* Bump version_added for btrfs modules to 6.6.0. Ensure consistent trailing punctuation for module descriptions and document check_mode behavior as attribute description rather than a module level note.

* Remove unused imports from btrfs_subvolume module.

* Fix import.

* Docs improvements.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-04-20 06:35:29 +02:00
yoannlr
76dd465e08
icinga2_host: make use of templates and template vars (#6286)
* icinga2_host: make use of templates, append vars instead of replacing all vars array.

* Initialize `template` variable. Add changelog fragment.

* Update changelogs/fragments/6286-icinga2_host-template-and-template-vars.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-04-20 06:17:16 +02:00
Alexei Znamensky
fe798e22a6
parted: improve docs (#6338) 2023-04-20 06:16:23 +02:00
Svenum
6e0bc4f45c
Remove --app by flatpak check if already installed (ansible-collectio… (#6289)
* Remove --app by flatpak check if already installed (ansible-collections#6265)

* Add Changelogfragment

* Fix syntax

* Update changelogs/fragments/6289-bugfix-flatpak-check-if-already-installed.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-04-20 06:15:46 +02:00
Mike Raineri
087c5a53d5
Redfish iDRAC: Added job_id to response for CreateBiosConfigJob (#6367)
* Redfish iDRAC: Added job_id to response for CreateBiosConfigJob

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

* YAML fix to changelog fragment

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

---------

Signed-off-by: Mike Raineri <michael.raineri@dell.com>
2023-04-19 20:11:57 +02:00
Pino Toscano
1aa94a5a1d
redhat_subscription: document the security of the registration (#6366) 2023-04-19 20:10:12 +02:00
Alexei Znamensky
59cb5b2d6f
dconf: minor refactor (#6336)
* dconf: minor refactor

* add changelog frag

* Update plugins/modules/dconf.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-04-16 22:19:26 +02:00
Kevin P. Fleming
64e797d077
dig: Support multiple domains in a single lookup (#6334)
* dig: Support multiple domains in a single lookup (#6334)

The docs for this plugin indicated that multiple domains could be
specified at once, but the code did not support multiple domains.

* Address review feedback.
2023-04-16 14:26:44 +02:00
Phillipe Smith
a35542d0d1
Rundeck modules fixes and improvements (#6300)
* feat: add token alias to api_token parameter

* fix: return (None, info) on empty content response

* feat: update the modules for using module_utils.rundeck funcs

* docs: add changelog fragment

* fix: add trailing commas

* fix: changelog fragment invalid syntax

* fix: changelog typos

* fix: remove token aliases from api_token

* fix: add token alias to api_token param

* fix: add partial overwrite of params and docs
2023-04-16 13:23:39 +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
TSKushal
f95b8ab9cd
Adding CheckiLORebootStatus functionality to ilo_redfish_command (#6115)
* Adding CheckiLORebootStatus functionality to ilo_redfish_command

* PR fix

* Update plugins/modules/ilo_redfish_command.py

Agreed

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

* sanity fix

* Changed command to WaitforiLORebootCompletion

* PR comment fix

* Update plugins/modules/ilo_redfish_command.py

Agreed

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

* Update plugins/modules/ilo_redfish_command.py

Agreed

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

* Update plugins/modules/ilo_redfish_command.py

Agreed

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

* Update plugins/modules/ilo_redfish_command.py

Agreed

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

* Updating documentation based on PR comment

* Adding tests and updating task name in module

---------

Co-authored-by: Kushal <t-s.kushal@hpe.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-04-16 13:06:12 +02:00
Sharuzzaman Ahmat Raslan
42bc2cb4d8
fix small typo (#6316)
fix small typo toch -> touch
2023-04-13 07:43:53 +02:00
Pino Toscano
83994c0a2d
redhat_subscription: use CLI when using environments (#6319)
It turns out that the 'environments' that the D-Bus Register*() APIs
accept are the IDs of the environments, and not the user-facing names of
the environments (which is what the module has been accepting so far).

Since there is no easy way to do the mapping manually, for now use again
the subscription-manager CLI for registering when environments are
specified.
2023-04-13 07:17:53 +02:00
LanceNero
bf780ea738
terraform: remote state file exists check issue (#6296)
* remote state file exists check

In the official CLI implementation of Terraform, if the state file does not exist, a new one will be created, and there is no need to check that the state file already exists and with an error if file not exists.

```bash
# Test command
terraform apply -state test.tfstate. # if state file not exists ,terraform will create a new one
terraform destroy -state test1.tfstate  ### Terraform will not throw any error, the command will succeed execute, only report no resource has destroy
```

* Update terraform.py

add 1 blank line to function end

* Create 6296-LanceNero-Terraform_statefile_check

remove file exists check (https://github.com/ansible-collections/community.general/pull/6296)

* resolve if case issue

* Add blank line

* Update 6296-LanceNero-Terraform_statefile_check

* Update changelogs/fragments/6296-LanceNero-Terraform_statefile_check

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

* update code style

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

* Update suffix to correct CI issue

* Update Code Style

* Update bug-fix to feature release

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-04-13 06:55:52 +02:00
Jonathan Kamens
a5765143f1
dconf: three minor but useful fixes (#6206)
* dconf: Correctly handle setting a key that has no value in DB

We need to check if the value in the database is None before we try to
parse it, because the GVariant parser won't accept None as an input
value. By definition if the value is None, i.e., there's no value in
the database, than any value the user is trying to set is a change, so
just indicate that it's a change without trying to compare the None to
whatever the user specified as the value.x

* dconf: Give a more useful error when writing a key fails

if writing a key fails, then include in the error that is returned the
exact key and value aguments that were given to the dconf command, to
assist in diagnosing failures caused by providing the key or value in
the wrong format.x

* dconf: Convert boolean values into the format that dconf expects

Even though we warn users to be careful to specify GVariant strings
for values, a common error is to be trying to specify a boolean string
which ends up getting converted into a boolean by the YAML parser or
Ansible. Then it gets converted to "True" or "False", the string
representations of Python booleans, which are not valid GVariants.

Rather than just failing with an obscure error when this happens,
let's be more user-friendly and detect when the user has specified a
boolean and convert it into the correct GVariant forms, "true" or
"false", so it just works. There's no good reason to be more pedantic
than that.
2023-04-13 06:52:14 +02:00
Claude Becker
6c5c05dfdc
homebrew: respect greedy flag for cask upgrade_all (#6267)
* homebrew: respect greedy flag for cask upgrade_all

* homebrew: implement feedback from code review
2023-04-13 06:41:23 +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
Nils Meyer
14b19afc9a
archive: Generate crc32 over 16MiB chunks (#6274)
* archive: Generate crc32 over 16MiB chunks

Running crc32 over the whole content of the compressed file potentially
requires a lot of RAM. The crc32 function in zlib allows for calculating
the checksum in chunks. This changes the code to calculate the checksum
over 16 MiB chunks instead. 16 MiB is the value also used by
shutil.copyfileobj().

* Update changelogs/fragments/6199-archive-generate-checksum-in-chunks.yml

Change the type of change to bugfix

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

* Update changelogs/fragments/6199-archive-generate-checksum-in-chunks.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-04-13 06:40:16 +02:00
Paul Aurich
f93a1bf5ec
pipx: Add support for system_site_packages (#6308)
* pipx: Add support for system_site_packages

* Add changelog fragment
2023-04-10 09:10:32 +02:00
Alexei Znamensky
a64e36820f
mksysb: improve visibility on the output (#6269)
* mksysb: improve visibility on the output

* add changelog frag
2023-04-05 13:55:49 +02:00
Lorenzo Tanganelli
cee5f31b70
Add support to topics on Gitlab Project module (#6278)
* add topics to gitlab_project.py

* add chngelog fragment

* fix lint error

* Update changelogs/fragments/6277-add-topics-gitlab-project.yml

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

* Apply suggestions from code review

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-04-03 22:02:20 +02:00
Pino Toscano
c280b793de
redhat_subscription: fix D-Bus option for environments on CentOS (#6275)
Factorize the current logic to determine whether use 'environments' as
D-Bus registration option (rather than 'environment') in an own
function, so it is easier to read it and maintain it.

With the small helper function in place, extend the logic to support
CentOS: it is in practice the same as the RHEL one, with an additional
check to support CentOS Stream 8 (which is a rolling release, and not
versioned).
2023-04-03 21:26:56 +02:00
Pino Toscano
c9e11e5c0c
redhat_subscription: manually unregister only when registered (#6259)
When registering using D-Bus and using a version of subscription-manager
with an unimplemented 'force' option, then unregister manually the
system only if it is registered. 'subscription-manager unregister'
errors out when trying to unregister an already unregistered system.
2023-04-03 21:03:43 +02:00
Paul Aurich
33093e9f3e
pipx: document parameters supported with state=latest, and fix include_injected parameter (#6212)
* pipx: Document parameters supported with state=latest

* pipx: Support "include_injected" with states "upgrade" and "latest"

- Contrary to documentation, "include_injected" doesn't appear to have
  worked with state=upgrade since it was introduced.
- Add support for include_injected with "latest", since "latest" is
  specified as being install+upgrade.

* Add changelog fragment

* Update plugins/modules/pipx.py

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

* Update changelog fragment

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

* pipx: Update to correct target release of community.general

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-30 07:28:24 +02:00
Cédric Servais
5e1e8d06ef
ldap_entry documentation is lacking examples (#5815)
* Add changelog fragment

* Add documentation for possible values of LDAP entry attributes

* Add PR information

* Update plugins/modules/ldap_entry.py

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

* remove changlog

* Update docstring

* Align ldap_attrs doc to ldap_entry module

* Update plugins/modules/ldap_attrs.py

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

* Change formulations.

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-27 20:57:21 +02:00
Roy Lenferink
05824a0754
merge_variables: Fix example section (#6250) 2023-03-26 15:42:48 +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
Hugo Prudente
be7f11bf39
Add worklog functionality to jira module (#6210)
community.general#6209 Add worklog functionality to jira
2023-03-26 09:31:06 +02:00
Salvatore Mesoraca
997761878c
Add module to manipulate KDE config files using kwriteconfig (#6182)
* Add module to manipulate KDE config files using kwriteconfig

* Fix license issues

* Apply suggestions from code review

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

* Add smeso as kdeconfig.py maintainer

* Fix attributes fragment name

* Fix test

* Do not use shutil.chown

It isn't available on old Python versions

* Apply suggestions from code review

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-26 09:30:34 +02:00
barloff-st
59e58079cb
Adding open option to nmap (#6200)
* Adding nmap `open` option

* Removing accidental copy/paste issue

* Update changelogs/fragments/6200-adding-open-option-to-nmap.yml

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>
2023-03-26 09:29:55 +02:00
lirkwood
cd706454ec
Fixed XenOrchestra inventory plugin failing due to not checking response ID. (#6227)
* Added call method to select proper response from xo server

* Added changelog fragment

* Removed excess blank lines

* Moved period in changelog fragment

* Made suggested changes

* Remove f-strings for Python 2.7 compatibility

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

---------

Co-authored-by: Linus Kirkwood <lkirkwood@allette.com.au>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-26 09:29:36 +02:00
Sam Potekhin
81b16a88ee
nmcli: fixed idempotency issue when config bridge connection (#6105)
* nmcli: fixed idempotency issue when config bridge connection

* Update changelog fragment.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-26 09:28:51 +02:00
Sam Potekhin
5ee687049f
nmcli: fixed idempotency issue with 'may_fail4' when 'method' is 'disabled' (#6106)
* nmcli: fixed idempotency issue with 'may_fail4' when 'method' is 'disabled'

* added note to documentation

* updated changelog fragment

* Update changelog fragment.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-26 09:28:06 +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
Paul Aurich
6fa833feed
pipx: Allow injected modules to add apps (#6198)
* pipx: Allow injected modules to add apps

Add support for pipx inject's "--include-apps" parameter.

* add changelog fragment

* fix pipx test ("install_apps", not "include_apps")

* fix pipx test -- add a second invocation for install_apps

* Update changelogs/fragments/6198-pipx-inject-install-apps.yml

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

* Update plugins/modules/pipx.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-26 09:17:55 +02:00
ky13
33ccabed13
added hpe thermal config and fan percent min (#6208)
* added hpe thermal config and fan percent min

* typo fixed

* Create 6208-hpe-thermal-fan-percent.yaml

* fixed changelog fragment

* Update 6208-hpe-thermal-fan-percent.yaml
2023-03-25 23:18:21 +01:00
Gavin Will
e96552396e
ssh_config: add proxyjump option (#6205)
* feat(ssh_config): proxyjump option

* feat(ssh_config: add proxyjump test

* CamelCase ProxyJump

* add changelog fragment

* Update plugins/modules/ssh_config.py

add version_added

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

* update task name to include new proxyjump option

* adding tests for proxyjump option

* fixing assert variable name

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-25 23:16:46 +01:00
Julian
7059789f35
Add archive param for proxmox_kvm module (#6159)
We simply add a param to allow proxmox administrator to restore VM from
an archives. This new option will be useful to automate automatic
creation and restore of VM.

Co-authored-by: Julian Vanden Broeck <julian.vandenbroeck@dalibo.com>
2023-03-25 08:24:28 +01:00
Léo GATELLIER
f3be0076af
Add Gitlab group runners support (#3935) 2023-03-25 08:23:20 +01:00
Andrey Cherepanov
b1d94385ae
apt_rpm: add clean, dist_upgrade and update_kernel (#5867)
* clean performs apt-get clean.

* dist_upgrade performs apt-get dist-upgrade.

* update_kernel performs update-kernel to upgrade kernel packages.

* update_cache, clean, dist_upgrade and update_kernel can be used with and without specified packages.
2023-03-25 08:22:33 +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
Reto Kupferschmid
512bf4b77f
ldap moduls: add optional ca_cert_file option (#6185)
* add ca_cert_file option

* fix pr url

* Apply suggestions from code review

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

* update parameter name

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-22 07:39:58 +01:00
Hugo van Kemenade
f66cc7c933
Replace deprecated error with BadZipFile (#6180)
* Replace deprecated error with BadZipFile

* Use imported BadZipFile

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

* Add news fragment

* Update new fragment

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-22 07:39:18 +01:00
Petr Tichý
3fb1ff0b72
Fix influxdb_user grants in check mode (#6111)
* Fix influxdb_user grants in check mode

When running in check mode, `influxdb_user` will return error when the user doesn't exist yet, instead of reporting `changed` state.

* Update changelogs/fragments/6111-influxdb_user-check-mode.yaml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-22 07:38:31 +01:00
barloff-st
bf8f2950b4
Adding support for -p option to specify port(s) to scan (#6165)
* Adding support for `-p` option to specify port(s) to scan

* Adding changelog fragment file

* Corrected appending options

* Edit to doc section

* Correction in documentation type

* Fixed `:` use in doc breaking yaml

* Update changelogs/fragments/6165-nmap-port.yml

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

* Update plugins/inventory/nmap.py

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

* Update plugins/inventory/nmap.py

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

* Adding usage example

* Adding comment to example that was missed

* Breaking line up, was too long for sanity test 160 char limit

* Still too long since spaces are counted

* Changed type to string to work for a single entry as well as comma separated values

* Update changelogs/fragments/6165-nmap-port.yml

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>
2023-03-19 13:27:10 +01:00
Martin Helwig
1dd86bcb55
add optional use_tls parameter (#6154)
* add optional use_tls parameter

* add optional use_tls parameter

---------

Co-authored-by: Martin Helwig <prostep.helwig@extaccount.com>
2023-03-14 23:01:59 +01:00
Patrik Lundin
b97bee3fd6
openbsd_pkg: set TERM to 'dumb' in execute_command (#6149)
* openbsd_pkg: set TERM to 'dumb' in execute_command

Keeps pkg_add happy when someone running ansible is using a TERM that
the managed OpenBSD host does not know about.

Fixes #5738.

Selection of specific TERM from discussion at
https://marc.info/?l=openbsd-tech&m=167290482630534&w=2

* Add changelog fragment for openbsd_pkg TERM fix

* Update changelogs/fragments/6149-openbsd_pkg-term.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-14 23:01:06 +01:00
John Daly
df34569fad
Updating yarn.list to not fail when when warnings are emitted (#6129)
* Updating yarn.list to not fail when when warnings are emitted

* Adding changelog fragment

* Adding _process_yarn_error function

* - Adding back changes to the changelog fragment
- Fixing formatting

* Fix trailing whitespace

* Update plugins/modules/yarn.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-14 23:00:23 +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
Cédric Jeanneret
a49ad340af
[make] Provide built command in the module output (#6160)
It may happen operator wants to get the built command instead of all the
parameters. This change injects a new entry in the dict output, showing
what command way actually launched.

This patch also takes the opportunity to add missing dots to some
documentation lines.
2023-03-14 20:44:08 +01:00
Peter Upton
3862de3f15
Removes dependency on StormSSH (#6117)
* included storm config parser

* Add changelog fragment

* Fix changelog fragment

* address PR feedback

* fix license

* add required boilerplate, fix issues found in test output

* move __future__ imports

* address pr feedback

* address test output

* address pr feedback
2023-03-12 12:39:42 +01:00
Roman Belyakovsky
abcba9dbbe
Interfaces file spaces fix (#6131)
* interfaces_file: added test case for #6120

* interfaces_file: reverted code to #fafabed

* interfaces_file: added changelog fragment

* interfaces_file: added missing licenses

* interfaces_file: improved test coverage

* interfaces_file: fixed retrieving option values

* Update plugins/modules/interfaces_file.py

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

* Update plugins/modules/interfaces_file.py

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

* Update tests/unit/plugins/modules/interfaces_file/test_interfaces_file.py

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

* Update plugins/modules/interfaces_file.py

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

* Update plugins/modules/interfaces_file.py

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

* Update plugins/modules/interfaces_file.py

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

* Update plugins/modules/interfaces_file.py

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

* Update plugins/modules/interfaces_file.py

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

* Update plugins/modules/interfaces_file.py

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

* Update tests/unit/plugins/modules/interfaces_file/test_interfaces_file.py

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

* interfaces_file: spacing fix

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-09 20:09:13 +01:00
Cédric Jeanneret
6d003ca7fc
[make] Improve module doc (#6161)
This change reorder the parameters so that we get the mandatory one at
the top, then alphabetically order the other bellow.

It also adds the returned values.
2023-03-08 14:16:45 +01:00
Daniel Patrick
6cf674485f
memset*.py: Fixed URLError handling (#6114)
* memset.py: Added URLError exception and stderr to Response() object

* memset_*.py: Check response.status_code and response.stderr

* Added changelog fragment

* memset.py: Fixed pep8

* Renamed changelog fragment with .yml file extension
2023-03-08 07:54:36 +01:00
Felix Fontein
11c7611ced
More true/false normalization (#6152)
* More true/false normalization.

* Boolean do not need explicit choices.

* One more.

* Fix type argument.
2023-03-06 23:02:24 +01:00
Jonathan Kamens
627371e2d8
dconf: Check for changes properly despite style of quotes used by user (#6049)
dconf: parse GVariant values to check for equality whenever possible

Direct string comparisons are an inaccurate way to compare two
GVariant representations. For example, 'foo' and "foo" (including the
quote marks, which are part of the representation) are equal GVariants
but if you just do a string compare (remember, including the quotes)
they'll be interpreted.

We therefore want to use the `gi.repository` Python library to parse
GVariant representations before comparing them whenever possible.

However, we don't want to assume that this library will always be
available or require it for Ansible to function, so we use a straight
string comparison as a fallback when the library isn't available. This
may result in some false positives, i.e., Ansible thinking a value is
changing when it actually isn't, but will not result in incorrect
values being written into `dconf`.

Co-authored-by: Jonathan Kamens <jik@jik5.kamens.us>
2023-03-04 20:51:50 +01:00
cfiehe
c077818c5d
Fixes #6112: community.general.gitlab_runner KeyError: 'access_level' (#6130)
The fix ensures that no 'KeyError' is raised, when 'access_level' is not provided as module parameter or when 'access_level_on_creation' is false.

Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
Co-authored-by: Christoph Fiehe <c.fiehe@eurodata.de>
2023-03-04 10:14:58 +01:00
Sargun Vohra
3d67f51824
Fix Yarn global not working without explicit executable path (#6138)
* Fix Yarn global not working without explicit executable path

* changelog fragment

* fix formatting and add test

* oops
2023-03-04 10:09:14 +01:00