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

996 commits

Author SHA1 Message Date
patchback[bot]
1676b09573
[PR #6122/e939cd07 backport][stable-6] redhat_subscription: use D-Bus for registration if possible (#6188)
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/

(cherry picked from commit e939cd07ef)

Co-authored-by: Pino Toscano <ptoscano@redhat.com>
2023-03-14 23:06:41 +01:00
patchback[bot]
e9bc32528e
[PR #6175/1ddcdc63 backport][stable-6] Mark monit integration tests as unstable (#6178)
Mark monit integration tests as unstable (#6175)

Mark monit integration tests as unstable.

(cherry picked from commit 1ddcdc63ff)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-12 15:50:18 +01:00
patchback[bot]
8e84b3ef8e
[PR #6117/3862de3f backport][stable-6] Removes dependency on StormSSH (#6179)
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

(cherry picked from commit 3862de3f15)

Co-authored-by: Peter Upton <peterupton99@gmail.com>
2023-03-12 15:50:07 +01:00
patchback[bot]
944bc78360
[PR #6131/abcba9db backport][stable-6] Interfaces file spaces fix (#6169)
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>
(cherry picked from commit abcba9dbbe)

Co-authored-by: Roman Belyakovsky <roman.beliakovskii@smartly.io>
2023-03-09 20:31:08 +01:00
patchback[bot]
47514e1401
[PR #6152/11c7611c backport][stable-6] More true/false normalization (#6153)
More true/false normalization (#6152)

* More true/false normalization.

* Boolean do not need explicit choices.

* One more.

* Fix type argument.

(cherry picked from commit 11c7611ced)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-07 07:10:10 +01:00
patchback[bot]
186b4200f6
[PR #6049/627371e2 backport][stable-6] dconf: Check for changes properly despite style of quotes used by user (#6145)
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>
(cherry picked from commit 627371e2d8)

Co-authored-by: Jonathan Kamens <jik@kamens.us>
2023-03-05 11:49:43 +01:00
patchback[bot]
4860c20108
[PR #6104/2dee3464 backport][stable-6] nmcli: fixed inability to change mtu on vlan connection (#6140)
nmcli: fixed inability to change mtu on vlan connection (#6104)

* tests updated

Co-authored-by: Sam Potekhin <heaveaxy@gmail.com>
(cherry picked from commit 2dee3464dd)

Co-authored-by: Sam Potekhin <24751685+heaveaxy@users.noreply.github.com>
2023-03-04 10:21:59 +01:00
patchback[bot]
8efbd8172c
[PR #6138/3d67f518 backport][stable-6] Fix Yarn global not working without explicit executable path (#6141)
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

(cherry picked from commit 3d67f51824)

Co-authored-by: Sargun Vohra <sargun.vohra@gmail.com>
2023-03-04 10:21:50 +01:00
patchback[bot]
1d39bbefd9
[PR #6119/345a6930 backport][stable-6] opkg: fix bug when update_cache=true (#6124)
opkg: fix bug when update_cache=true (#6119)

* opkg: fix bug when update_cache=true

* add changelog fragment

(cherry picked from commit 345a69304a)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-03-02 07:15:28 +01:00
patchback[bot]
eb6ef5ae2e
[PR #5424/29f50337 backport][stable-6] add persistent option for modprobe (#6102)
add persistent option for modprobe (#5424)

* add persistent option for modprobe

* add suggested changes + fix broken test

* change modprobe module path in tests due to rebase

* change persistent option type from bool to str with choices

* fix unused import

* add example with persistent option

* fix some minor issues after review

- move regexps compiling to __init__
- move AnsibleModule to build_module function and use this function in tests instead of AnsibleModule
- fix terminlogy issue in documentation

* fix unused-import

(cherry picked from commit 29f5033737)

Co-authored-by: Alex Groshev <38885591+haddystuff@users.noreply.github.com>
2023-02-26 15:37:09 +01:00
patchback[bot]
9bab144d06
[PR #5830/c8a2ac3a backport][stable-6] sefcontext: add support for path substitutions (#6098)
sefcontext: add support for path substitutions (#5830)

* sefcontext: add path substitution support (#1193)

First commit for feedback, missing docs and tests.

* sefcontext: add documentation

* Add changelog fragment

* Documentation formatting

* Delete extra newline

* pep8 fixes

Fix indentation

* Add version_added to arg docs

* Add examples

* Don't delete non-matching path substitutions

* Add integration tests

* Delete only substitutions if such arg passed

Don't delete existing regular file context mappings if deletion of
a path substitution was requested with the presence of the
`equal` arg - delete only path substitutions in such case.

Path substitutions and regular mappings may overlap.

* Can only add args in minor releases

:(

* Cleanup before tests

* Fix deletion using substitution

Was comparing wrong var.

* Fix test checking wrong var

* Improve args documentation and examples

List the default values for selevel, seuser.
Add example for deleting path substitutions only.

* Add attributes documentation block

Not sure if should add become/delegate/async,
shouldn't those work just like that without any
specific code added for them?

* and fix indentation on attribute block

* Consistent indentation for attributes

Confusing, most plugins indent with 4 spaces.
But some use 2 like the rest of the code, so use 2.

* Add missing ref for attribute block

* Use correct c.g version in doc block

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

* Add full stop to changelog fragment

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

* Streamline documentation

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

* Support limiting deletion to setype

Deleting file context mappings may be limited by
passing setype or equal, if neither arg is passed
then delete either setype/equal mappings that match.

* Change arg name, diff mode output fix

Change arg name from equal to substitute.
Print target = subsitute in diff mode same way as
semanage does.

Also put back platform attribute, try to improve
clumsy language in the substitute arg docs.

* Delete even if arg setype not match existing

Test 5 indicates that deletion is supposed to not check that
the arg setype passed when deleting matches the setype
of the mapping to delete.
Delete any mapping that matches target, regardless of
setype arg value.

* Update arg name in tests

* Too eager replacing

Accidentally replaced seobject function names so fix them back

* 4564: Fix invalid setype in doc example

Change from httpd_git_rw_content_t which
does not exist to httpd_sys_rw_content_t

Fixes #4564

* Fix documentation attributes

Additional fragment

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

* Update version_added in docs

Bumping minor to 6.4.0 since it didn't make 6.3.0.

* Add more description to the new arg docs

Try to improve discoverability of the new feature and make it easier to understand without deep SELinux understanding.

* Update platform to Linux in documentation

* Add equal as alias for the new argument

Improve discoverability of the new feature by adding an alias to the new module argument. The argument name "equal" will be easy to find for users who are not familiar with SELinux and who just try to match to the CLI tool `semanage`.

* And add alias argument properly

Previous commit missed actually adding the alias (added to docs only).

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
(cherry picked from commit c8a2ac3a47)

Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2023-02-26 14:23:53 +01:00
patchback[bot]
bc64c4035e
[PR #5926/810f3b50 backport][stable-6] Add enabled parameter to flatpak_remote (#6095)
Add `enabled` parameter to `flatpak_remote` (#5926)

(cherry picked from commit 810f3b50fc)

Co-authored-by: Yannick Ihmels <yannick@ihmels.org>
2023-02-25 23:16:07 +01:00
patchback[bot]
1462ed0b4a
[PR #5814/7d3e6d1b backport][stable-6] keycloak_group: support keycloak subgroups (#6089)
keycloak_group: support keycloak subgroups (#5814)

* feat(module/keycloak_group): add support for ...

... handling subgroups

* added changelog fragment and fixing sanity ...

... test issues

* more sanity fixes

* fix missing version and review issues

* added missing licence header

* fix docu

* fix line beeing too long

* replaced suboptimal string type prefixing ...

... with better subdict based approach

* fix sanity issues

* more sanity fixing

* fixed more review issues

* fix argument list too long

* why is it failing? something wrong with the docu?

* is it this line then?

* undid group attribute removing, it does not ...

... belong into this PR

* fix version_added for parents parameter

---------

Co-authored-by: Mirko Wilhelmi <Mirko.Wilhelmi@sma.de>
(cherry picked from commit 7d3e6d1bb7)

Co-authored-by: morco <thegreatwiper@web.de>
2023-02-25 14:03:38 +01:00
patchback[bot]
3aeaab2708
[PR #6075/de1f0ff4 backport][stable-6] Consolidate onepassword unit tests so that ansible-test will find them when the plugin is modified (#6076)
Consolidate onepassword unit tests so that ansible-test will find them when the plugin is modified (#6075)

Consolidate onepassword unit tests so that ansible-test will find them when the plugin is modified.

(cherry picked from commit de1f0ff419)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-02-25 11:22:36 +01:00
Felix Fontein
470f4e8c02
[stable-6] Run tests with EOL ansible-core versions in GHA (#6069)
* Run tests with EOL ansible-core versions in GHA (#6044)

Run tests with EOL ansible-core versions in GHA.

(cherry picked from commit b72b7d4936)

* Re-schedule cron.
2023-02-24 12:50:57 +01:00
patchback[bot]
86b19a2bf4
[PR #6041/a7e8e95b backport][stable-6] onepassword lookup: fix unit tests (#6042)
onepassword lookup: fix unit tests (#6041)

Fix unit tests.

(cherry picked from commit a7e8e95b50)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-02-22 23:10:15 +01:00
patchback[bot]
ec7f885e2f
[PR #5996/24efe9ee backport][stable-6] Normalize bools in tests (#5997)
Normalize bools in tests (#5996)

* Normalize bools in tests.

* Fix typo.

(cherry picked from commit 24efe9ee9a)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-02-16 06:42:27 +01:00
patchback[bot]
4f71c9384e
[PR #5829/4c4ef80c backport][stable-6] yarn: Fix state=latest not working with global=true (#5992)
yarn: Fix state=latest not working with global=true (#5829)

* Yarn module: fix state=latest not working with global=true

* fix whitespace

* add changelog fragment

* add integration test cases

* add only tests for this PR (install+upgrade)

* fix assuming default global dir

* fix list() not working when global=true and name a package with no binary

* remove ignores

* whitespace

* Update changelogs/fragments/5829-fix-yarn-global.yml

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

* Update changelogs/fragments/5829-fix-yarn-global.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
(cherry picked from commit 4c4ef80ca9)

Co-authored-by: Sargun Vohra <sargun.vohra@gmail.com>
2023-02-13 22:07:12 +01:00
patchback[bot]
3d70bfa1e4
[PR #5978/9f87989e backport][stable-6] Remove unnecessary test imports (#5979)
Remove unnecessary test imports (#5978)

Remove unnecessary test imports.

(cherry picked from commit 9f87989e7f)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-02-12 21:36:32 +01:00
patchback[bot]
ead9524dc3
[PR #5928/a64df658 backport][stable-6] Replace missing default favicon with docs.ansible.com favicon (#5935)
Replace missing default favicon with docs.ansible.com favicon (#5928)

* replace missing default favicon with docs.ansible.com

* create changelog fragment for PR 5928

* move changelog fragment

* fix parameter description

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

* fix parameter description

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

* add affected modules in changelog fragment

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

---------

Co-authored-by: Lars Krahl <lkr@mms-dresden.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit a64df658c5)

Co-authored-by: Lars Krahl <57526005+mmslkr@users.noreply.github.com>
2023-02-03 11:46:40 +01:00
patchback[bot]
e5930aabcb
[PR #5883/dcc3d4f5 backport][stable-6] Add support for setenv parameters (#5920)
Add support for setenv parameters (#5883)

(cherry picked from commit dcc3d4f508)

Co-authored-by: Renaud <33203203+redat00@users.noreply.github.com>
2023-01-30 05:57:28 +00:00
patchback[bot]
99336ba5fe
[PR #5812/8818a6f2 backport][stable-6] OpenNebula/one_vm implement the one.vm.updateconf API call (#5905)
OpenNebula/one_vm implement the one.vm.updateconf API call (#5812)

* opennebula: Add template manipulation helpers

* one_vm: Use 'updateconf' API call to modify running VMs

* one_vm: Emulate 'updateconf' API call for newly created VMs

* opennebula/one_vm: Satisfy linter checks

* opennebula/one_vm: Apply suggestions from code review

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

* opennebula/one_vm: Drop 'extend' function, use 'dict_merge' instead

* Add changelog fragment

* one_vm: Refactor 'parse_updateconf' function

* opennebula/one_vm: Apply suggestions from code review

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

* one_vm: Allow for using updateconf in all scenarios

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 8818a6f242)

Co-authored-by: Michal Opala <mopala@opennebula.io>
2023-01-28 11:52:27 +01:00
patchback[bot]
9d99ccef2d
[PR #5851/7b8b73f1 backport][stable-6] Add support to Bitwarden Lookup for filtering results by collection (#5849) (#5904)
Add support to Bitwarden Lookup for filtering results by collection (#5849) (#5851)

* Add support to Bitwarden Lookup for filtering results by collection id (#5849)

* Debug

* Add support to Bitwarden Lookup for filtering results by collection id (#5849)

* Update comments

* Fix blank line issue

* Fix unit tests for bitwarden lookup plugin. Add changelog fragment file.

* Change collectionId to collection_id parameter on bitwarden plugin

* Fix collection id parameter name when used in bw cli

(cherry picked from commit 7b8b73f17f)

Co-authored-by: Piotr <skc.peter@gmail.com>
2023-01-28 11:52:14 +01:00
patchback[bot]
ee07d8320a
[PR #5868/098912c2 backport][stable-6] stormssh tests: do not install newer cryptography (#5872)
stormssh tests: do not install newer cryptography (#5868)

Do not install newer cryptography.

ci_complete

(cherry picked from commit 098912c229)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-01-22 18:16:53 +01:00
patchback[bot]
0729f0c262
[PR #5811/bf117c83 backport][stable-6] Clarify Error message when bitwarden vault not unlocked (#5878)
Clarify Error message when bitwarden vault not unlocked (#5811)

* Clarify Error message when vault not unlocked

You can be logged into the Bitwarden-CLI, but it can still be locked. This took me several hours to debug, since every time I ran 'bw login' it told me, that I am already logged in.
If you run 'bw unlock' without being logged in, you are prompted to log in.
This clarifies the Error occurring and can drastically reduce debugging time, since you don't have to look into the source code to get an understanding of whats wrong.

* RM: negation

Nobody needs negation

* Update function name

* FIX: tests

* ADD: changelog

* Update changelogs/fragments/5811-clarify-bitwarden-error.yml

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

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

Co-authored-by: Christoph <29735603+Chr1s70ph@users.noreply.github.com>
2023-01-22 17:46:44 +01:00
patchback[bot]
57cd48f3cf
[PR #5750/6781dd19 backport][stable-6] bugfixing keycloak user federation failing when updating default mapper simultaneously (#5876)
bugfixing keycloak user federation failing when updating default mapper simultaneously (#5750)

* fix(modules/keycloak_user_federation): fixes ...

... user federation creation failing when also updating/changing default
mappers at the same time

* add changelog fragment for pr

Co-authored-by: Mirko Wilhelmi <Mirko.Wilhelmi@sma.de>
(cherry picked from commit 6781dd1918)

Co-authored-by: morco <thegreatwiper@web.de>
2023-01-22 17:44:52 +01:00
patchback[bot]
afd2151672
[PR #5732/0ca41ded backport][stable-6] Bugfix/keycloak userfed idempotency (#5874)
Bugfix/keycloak userfed idempotency (#5732)

* fix(modules/keycloak_user_federation): fixes ...

... federation read call not finding already existing federations
properly because of bad parametrisation

* fix(modules/keycloak_user_federation): added ...

... new integration test for module idempotency bugfix

* added changelog fragment for pr

Co-authored-by: Mirko Wilhelmi <Mirko.Wilhelmi@sma.de>
(cherry picked from commit 0ca41dedce)

Co-authored-by: morco <thegreatwiper@web.de>
2023-01-22 17:44:42 +01:00
patchback[bot]
ea9b272043
[PR #5754/59a9d342 backport][stable-6] Remote management modules for OCAPI-based devices. (#5869)
Remote management modules for OCAPI-based devices. (#5754)

* Remote management modules for OCAPI-based devices.

    Open Composable API (OCAPI) is a REST-based API designed for data center composability. For more information, see https://www.opencompute.org/documents/open-composable-api-for-ocp-2019-06-24-pdf

    This PR introduces ocapi_command and ocapi_info modules.  These are based on the existing redfish_command and redfish_info modules and follow similar patterns.  This initial implementation includes support for the folowing operations:

    - Indicator LED toggling
    - Power state toggling
    - Enclosure reset (reboot)
    - Firmware upload
    - Firmware update
    - Firmware activate
    - Job deletion
    - Job status

    These modules have been tested against Western Digital OpenFlex(tm) Data24 storage enclosures. API reference is at https://documents.westerndigital.com/content/dam/doc-library/en_us/assets/public/western-digital/product/platforms/openflex/reference-architecture-open-composable-api.pdf

* Fix licensing issue for ocapi_utils.py

* PR Feedback

* Apply suggestions from code review

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

* Update plugins/module_utils/ocapi_utils.py

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

* Update plugins/modules/ocapi_info.py

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

* Apply suggestions from code review

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

* PR Feedback

Use six module for urlparse

* Apply suggestions from code review

Documentation fixes.

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

* Fix sanity test line too long error.

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

Co-authored-by: Mike Moerk <michael.moerk@wdc.com>
2023-01-22 17:23:28 +01:00
patchback[bot]
1ade62c5bc
[PR #5845/1430ed00 backport][stable-6] pipx: add testcase w/ env vars PIPX_xxxx (#5859)
pipx: add testcase w/ env vars PIPX_xxxx (#5845)

* pipx: add testcase w/ env vars PIPX_xxxx

* add note to the docs about env vars

* add note to the docs about env vars

* Apply suggestions from code review

* Update plugins/modules/pipx.py

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

* Update plugins/modules/pipx_info.py

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

* break long lines into smaller ones

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

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-01-18 21:43:16 +01:00
patchback[bot]
811c4a304a
[PR #5793/756c0776 backport][stable-6] apache2_module generates false/misleading warning (#5841)
apache2_module generates false/misleading warning (#5793)

* Add parameter warn_mpm_module to control when warning are raised

* Remoe whitespace

* Add changelog fragment

* Add missing license

* Update changelogs/fragments/5793-apache2-module-npm-warnings.yml

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

* Update plugins/modules/apache2_module.py

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

* Update plugins/modules/apache2_module.py

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

* Update tests/integration/targets/apache2_module/tasks/635-apache2-misleading-warning.yml

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

* Refining integration test - previous was invalid

* False to false

* refactor assertion for suse

* Revert "refactor assertion for suse"

This reverts commit 61b86e7493.

* Excluding test on Suse

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

Co-authored-by: Cédric Servais <cedric.servais@outlook.com>
2023-01-14 19:04:17 +01:00
patchback[bot]
c0fde76b79
[PR #5808/6ec04973 backport][stable-6] xml children module parameter does not exist (#5839)
xml children module parameter does not exist (#5808)

* Add changelog

* Add integration tests

* Rename children to set_children

* Add PR information

* Update changelogs/fragments/5808-xml-children-parameter-does-not-exist.yml

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

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

Co-authored-by: Cédric Servais <cedric.servais@outlook.com>
2023-01-14 18:40:20 +01:00
patchback[bot]
82a9db9738
[PR #5718/682bb4b8 backport][stable-6] opkg: refactor module to use StateModuleHelper and CmdRunner (#5824)
opkg: refactor module to use StateModuleHelper and CmdRunner (#5718)

* opkg: refactor module to use StateModuleHelper and CmdRunner

* add changelog fragment

* Update plugins/modules/opkg.py

Co-authored-by: joergho <48011876+joergho@users.noreply.github.com>

* Update plugins/modules/opkg.py

Co-authored-by: joergho <48011876+joergho@users.noreply.github.com>

* Update plugins/modules/opkg.py

Co-authored-by: joergho <48011876+joergho@users.noreply.github.com>

* Update plugins/modules/opkg.py

Co-authored-by: joergho <48011876+joergho@users.noreply.github.com>

* Update plugins/modules/opkg.py

Co-authored-by: joergho <48011876+joergho@users.noreply.github.com>

* Update plugins/modules/opkg.py

Co-authored-by: joergho <48011876+joergho@users.noreply.github.com>

* Update plugins/modules/opkg.py

Co-authored-by: joergho <48011876+joergho@users.noreply.github.com>

* generate message outcome as before

* aggregated changes from 5688

* fix package query

* add unit tests

* fix sanity error

* Update plugins/modules/opkg.py

Co-authored-by: joergho <48011876+joergho@users.noreply.github.com>

* add test for specifying version

* refactor parameter name

Co-authored-by: joergho <48011876+joergho@users.noreply.github.com>
(cherry picked from commit 682bb4b88a)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-01-12 21:06:11 +01:00
patchback[bot]
efc2cbf840
[PR #5782/6fb212b1 backport][stable-6] Update CI matrix (#5798)
Update CI matrix (#5782)

* Update CI matrix.

* Disable RHEL 9.1 for tests where RHEL 9.0 was disabled as well.

* Skip iso_extract on FreeBSD 12.4.

* Fix cloud_init_data_facts test for Fedora 37.

* Do not try to install snap on RHEL 9.1.

* Skip pkgng jail tests on FreeBSD 12.4 as well.

(cherry picked from commit 6fb212b104)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-01-07 18:17:12 +01:00
patchback[bot]
a1ca89b058
[PR #5786/759ca9a0 backport][stable-6] Remove currently unneeded generic tests from CI (#5791)
Remove currently unneeded generic tests from CI (#5786)

Remove currently unneeded generic tests from CI.

(cherry picked from commit 759ca9a0ab)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-01-07 15:24:47 +01:00
patchback[bot]
dd70419d18
[PR #5785/0ff003d3 backport][stable-6] Fix CI (#5789)
Fix CI (#5785)

Try to fix CI.

(cherry picked from commit 0ff003d312)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-01-07 15:20:24 +01:00
patchback[bot]
8bc5494ad5
[PR #5765/dc531b18 backport][stable-6] ModuleHelper - lax handling of conflicting output (#5775)
ModuleHelper - lax handling of conflicting output (#5765)

* ModuleHelper - lax handling of conflicting output

* add changelog fragment

* only create _var when really needed

* adjust changelog

* Update changelogs/fragments/5765-mh-lax-output-conflict.yml

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

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

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-01-07 10:52:56 +01:00
patchback[bot]
2d450a5a36
[PR #5725/4dc897d5 backport][stable-6] redhat_subscription: Add support for Red Hat API token (#5768)
redhat_subscription: Add support for Red Hat API token (#5725)

Add support for Red Hat API token

fix mixed up

fix version

(cherry picked from commit 4dc897d559)

Co-authored-by: Eric C Chong <ecchong@gmail.com>
2023-01-05 21:51:21 +01:00
patchback[bot]
c355f93d62
[PR #5755/b49bf081 backport][stable-6] ModuleHelper - fix bug when adjusting conflicting output (#5758)
ModuleHelper - fix bug when adjusting conflicting output (#5755)

* ModuleHelper - fix bug when adjusting conflicting output

* add changelog fragment

* remove commented test code

(cherry picked from commit b49bf081f8)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-01-04 21:40:56 +01:00
patchback[bot]
5fcf5d0c8b
[PR #5720/6383c823 backport][stable-6] ssh_config: fixed sanity (#5726)
ssh_config: fixed sanity (#5720)

* ssh_config: fix sanity checks

* fixed mod utils and removed sanity ignores

* update BOTMETA

* add changelog fragment

* Update plugins/module_utils/ssh.py

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

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

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-12-23 06:41:39 +01:00
patchback[bot]
95f3109ddc
[PR #5721/28969c61 backport][stable-6] manageiq_policies: deprecate list state (#5723)
manageiq_policies: deprecate list state (#5721)

* manageiq_policies: deprecate list state

* add changelog fragment

(cherry picked from commit 28969c61ad)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-12-22 07:11:24 +01:00
patchback[bot]
6037c5d1e6
[PR #5680/488e828f backport][stable-6] ansible_galaxy_install: use locale C tentatively, else en_US (#5722)
ansible_galaxy_install: use locale C tentatively, else en_US (#5680)

* ansible_galaxy_install: use locale C tentatively, else en_US

* use custom exception to signal unsupported locale

* add step to remove artefacts at the end of the test

* add step to remove artefacts at the beginning of the test

* comment out context controller

* trying with temporary dir as destination

* remove collection before test with reqs file

* ensure collections are installed in temp dir in tests + check_force

* simplified the change

* added extra condition for failing locale

* improved exception handling

* add changelog fragment

(cherry picked from commit 488e828f9b)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-12-22 06:00:34 +00:00
patchback[bot]
a70d9773dd
[PR #5713/1f492414 backport][stable-6] CI: add extra VMs for certain tests (#5717)
CI: add extra VMs for certain tests (#5713)

* Remove superfluous VM.

* Add extra VM group.

* More platforms, add scripts.

* [REVERT THIS] Shrink matrix to only the tests we are interested in.

* Fix some tests.

* Skip snap tests on Ubuntu VMs for now.

* Skip xfs_quota tests on Alpine VMs due to ansible.posix.mount failing.

* Revert "[REVERT THIS] Shrink matrix to only the tests we are interested in."

This reverts commit 2e98e163db.

* Stick to Alpine and Ubuntu 22.04 for now.

(cherry picked from commit 1f49241481)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-12-21 08:13:06 +01:00
patchback[bot]
bc50b48205
[PR #5703/77fde030 backport][stable-6] Add support for host restriction in sudoers module (#5716)
Add support for host restriction in sudoers module (#5703)

* Add support to restrict privileges by host

* Missing comma

* Making linter happy.

* Add version 6.2.0 as when sudoers host parameter added

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

* Changelog fragment for PR #5703

* Test for sudoers host-based restriction

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

Co-authored-by: Laurence <laurence+github@entek.org.uk>
2022-12-20 12:59:26 +01:00
patchback[bot]
1489c080a7
[PR #5612/f95e0d77 backport][stable-6] puppet: refactored to use CmdRunner (#5686)
puppet: refactored to use CmdRunner (#5612)

* puppet: refactored to use CmdRunner

* add changelog fragment

* add more tests

(cherry picked from commit f95e0d775d)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-12-14 22:03:40 +01:00
patchback[bot]
ff21afb227
[PR #5662/471f523f backport][stable-6] redhat_subscription: add server_proxy_scheme parameter (#5671)
redhat_subscription: add `server_proxy_scheme` parameter (#5662)

Add the `server_proxy_scheme` parameter to configure the scheme used for
the proxy server. This completes the configuration parameters for the
proxy server.

(cherry picked from commit 471f523f53)

Co-authored-by: Pino Toscano <ptoscano@redhat.com>
2022-12-08 22:54:18 +01:00
patchback[bot]
c1d6e5c3c2
[PR #5668/50021d6b backport][stable-6] Fix pipx_info tests (#5670)
Fix pipx_info tests (#5668)

Update dependencies.

(cherry picked from commit 50021d6bfb)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-12-08 22:25:12 +01:00
patchback[bot]
8a231e4b36
[PR #5606/7ea544a6 backport][stable-6] New Module: Keycloak ClientSecret with PR changes (#5654)
New Module: Keycloak ClientSecret with PR changes (#5606)

* feat(plugins/keycloak): add get and create util function for client secret

* feat(plugins/keycloak): add client secret module

* chore: add maintainer in BOTMETA

* Update plugins/modules/identity/keycloak/keycloak_clientsecret.py

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

* Make changes to keycloak_clientsecret from PR

* Add SPDX identifier for keycloak_clientsecret

* Add copyright in keycloak_clientsecret for REUSE

* Add integration test for keycloak_clientsecret

* rm clientsecret from keycloak_clientsecret result

  - end_state used instead

* keycloak_clientsecret: Undo meta/runtime.yml change

* Fix sanity tests for keycloak_clientsecret

* New keycloak_clientsecret_info module

  - Replaces keycloak_clientsecret
  - Module definition and some common logic moved into module_utils
  - Update documentation, tests, etc.
  - Add myself as author

* Misc fixes to keycloak_clientsecret_info

* Add keycloak_clientsecret_regenerate module

* keycloak_clientsecret* Update .github/BOTMETA.yml

* keycloak_clientsecret_regenerate: Fix sanity tests

* Fix README for keycloak_clientsecret integration test

* Separate out keycloak_clientsecret module_utils

* Keycloak_clientsecret module_utils: boilerplate

* Update plugins/modules/keycloak_clientsecret_info.py

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

* Update plugins/modules/keycloak_clientsecret_info.py

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

* Update plugins/modules/keycloak_clientsecret_info.py

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

* Update plugins/modules/keycloak_clientsecret_info.py

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

* Update plugins/modules/keycloak_clientsecret_info.py

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

* Update plugins/modules/keycloak_clientsecret_info.py

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

* keycloak_clientsecret: Add no_log to examples and docs

* keycloak_clientsecret: Update BOTMETA

* Update .github/BOTMETA.yml

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

Co-authored-by: fynncfchen <fynn.cfchen@gmail.com>
Co-authored-by: Fynnnnn <ethan.cfchen@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 7ea544a624)

Co-authored-by: John Cant <a.johncant@gmail.com>
2022-12-05 05:47:23 +00:00
patchback[bot]
51d704bfe3
[PR #5605/fb2833d3 backport][stable-6] feat(ssh_config): host_key_algorithms option (#5653)
feat(ssh_config): host_key_algorithms option (#5605)

* feat(ssh_config): host_key_algorithms option

* chore: add changelog fragment

* chore(ssh_config): add version info to option and update fragment

(cherry picked from commit fb2833d34d)

Co-authored-by: Arek Kalandyk <36413794+koralowiec@users.noreply.github.com>
2022-12-04 13:10:32 +01:00
patchback[bot]
cc28cde3a2
[PR #5647/be22ca06 backport][stable-6] cmd_runner: allow bool format to pass alternate (false) value (#5650)
cmd_runner: allow bool format to pass alternate (false) value (#5647)

* allow bool format to pass alternate (false) value

* add changelog fragment

(cherry picked from commit be22ca0633)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-12-04 12:39:30 +01:00
patchback[bot]
2d616bf4d1
[PR #5638/23aacc78 backport][stable-6] Reenable and enhance copr integration tests (#5646)
Reenable and enhance `copr` integration tests (#5638)

* Enhance `copr` integration tests

- Switch to a new test Copr repository. @copr/integration_tests was
  removed which caused the tests to fail. I created a new one under my
  account that I'll ensure stays around.
- Add basic testing to ensure that repo files are created in the correct
  location and contain the correct baseurl and enabled status.
- Also run tests on Enterprise Linux.
- Test that packages from the Copr install. This has to be disabled on
  EOL Fedoras that Copr does not allow building new packages for.

Resolves: https://github.com/ansible-collections/community.general/issues/5595

* copr tests: Fix ansible_python_interpreter on c8s

* copr: Don't test on alt Pythons on cs8

* Revert "copr tests: Fix ansible_python_interpreter on c8s"

This reverts commit 58e15a7ebf.

(cherry picked from commit 23aacc78e1)

Co-authored-by: Maxwell G <gotmax@e.email>
2022-12-03 22:40:55 +01:00
patchback[bot]
efedd0d6e2
redhat_subscription: drop unneeded args to Rhsm.register() (#5583) (#5626)
Stop passing all the "rhsm_", and "server_" module arguments to
"Rhsm.register()", and thus as arguments for
"subscription-manager register":
- right before calling "Rhsm.register()", "Rhsm.configure()" is called
  to configure subscription-manager with all the "rhsm_", and "server_"
  arguments; hence, they are already configured
- the passed argument to "--serverurl" is partially wrong:
  "Rhsm.register()" passes only the hostname, whereas the other bits
  (port and prefix) are supported too; this "works" because port and
  prefix were already configured previously, and the lax parsing that
  subscription-manager does allows for missing bits
- the parsing done by subscription-manager for "--baseurl" strips out
  the URL scheme and always uses https: this means that specifying
  "rhsm_baseurl: http://server" as module parameter will be taken as
  "https://server" by subscription-manager; since "rhsm_baseurl" is
  already configured by "Rhsm.configure()", this issue is gone

(cherry picked from commit 101c957631)

Co-authored-by: Pino Toscano <ptoscano@redhat.com>
2022-11-29 13:20:30 +01:00
patchback[bot]
d930c8d877
udm_share: fix sanity checks (#5557) (#5609)
* udm_share: fix sanity checks

* add changelog fragment

(cherry picked from commit a3b748a15e)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-11-26 18:58:09 +01:00
patchback[bot]
4b7554445b
Temporarily disable copr tests. (#5594) (#5598)
(cherry picked from commit 11e1423f60)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-23 20:34:31 +01:00
patchback[bot]
3a456a645d
udm_user: sanity (#5559) (#5593)
* fix parameter email

* fix parameter groups

* fix parameters home_telephone_number, mail_alternative_address, mobile_telephone_number, pager_telephonenumber

* fix parameter phone

* fix parameter samba_privileges

* fix parameter samba_user_workstations

* fix parameter secretary

* fix parameter serviceprovider

* remove lines from ignore files

* add changelog fragment

(cherry picked from commit 79929830c4)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-11-23 18:58:37 +01:00
patchback[bot]
8d83557e52
[GitLab] Add modules to manager project badges (#5534) (#5584)
* [GitLab] Add modules to manager project badges

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* first review

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* Update plugins/modules/gitlab_project_badge.py

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

Signed-off-by: Lunik <lunik@tiwabbit.fr>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit c7481c5c96)

Co-authored-by: Guillaume MARTINEZ <lunik@tiwabbit.fr>
2022-11-23 07:38:08 +01:00
patchback[bot]
17447d2a84
jenkins_plugin: fix sanity checks (#5565) (#5575)
* jenkins_plugin: fix sanity checks

* update BOTMETA

* add changelog fragment

* fix copyright

* Update plugins/module_utils/jenkins.py

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

* Update plugins/module_utils/jenkins.py

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

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

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-11-23 07:37:52 +01:00
patchback[bot]
38b4e316ae
lxd_project: refactored os.path.expanduser() to module utils (#5549) (#5552)
* lxd_project: refactored os.path.expanduser() to module utils

* add changelog fragment

(cherry picked from commit 9874462abb)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-11-23 07:37:36 +01:00
patchback[bot]
b52a6f3611
gconftool2: refactored to use ModuleHelper + CmdRunner (#5545) (#5551)
* gconftool2: refactored to use ModuleHelper + CmdRunner

* add changelog fragment

* removed old code commented out

(cherry picked from commit 6c7e9116e1)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-11-23 07:37:27 +01:00
patchback[bot]
2435fb3f30
rax_scaling_group: fix sanity check (#5563) (#5569)
* rax_scaling_group: fix sanity check

* add changelog fragment

* added missing call to expanduser()

(cherry picked from commit 6a03108609)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-11-23 07:37:12 +01:00
patchback[bot]
4b04e3cc32
scaleway_organization_info: sanity checks (#5571) (#5577)
* scaleway_organization_info: fix sanity checks

* remove lines from ignore files

* Update plugins/modules/scaleway_organization_info.py

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

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

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-11-17 07:29:49 +01:00
patchback[bot]
c681249364
cmd_runner module utils: fix case for as_fixed() format (#5538) (#5562)
* cmd_runner module utils: fix case for as_fixed() format

* add changelog fragment

* simplified test_cmd_runner

* fix handling empty default for `as_map()`

* add changelog fragment

* MissingArgumentValue is reraised in run()

(cherry picked from commit e87ca10b61)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-11-16 06:58:30 +01:00
patchback[bot]
57a4195b0d
redhat_subscription: fix sanity check (#5555) (#5560)
* redhat_subscription: fix sanity check

* removed ignore lines

(cherry picked from commit 801e3d86ef)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-11-16 06:57:38 +01:00
patchback[bot]
41a23f093d
spotinst_aws_elasticgroup: sanity checks (#5553) (#5554)
* spotinst_aws_elastigroup: add elements to parameter do_not_update

* spotinst_aws_elastigroup: add docs for parameter token

* add missing docs

* add changelog fragment

* Update plugins/modules/spotinst_aws_elastigroup.py

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

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

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-11-16 05:35:56 +00:00
patchback[bot]
fef6abc8c8
Fix a logical flaw when deleting a build in the jenkins_build module (#5514) (#5531)
* Fix the logical flaw when deleting a build in the jenkins_build module.

* Fix the logical flaw when deleting a Jenkins build in the jenkins_build module.

* Adding changelogs.

* Update tests/unit/plugins/modules/test_jenkins_build.py

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

* Attempt to mock the exception classes.

* Remedy the CI issues when mocking the exception classes.

* Assuming a way to mock the get_build_status function.

* Near to the feasible approach.

* Calls the correct class when unit testing.

* Fix sending wrong arguments when unit testing.

* Directly assign the argument value in the unit testing.

* Fix errors calling different classes.

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

Co-authored-by: Tong He <68936428+unnecessary-username@users.noreply.github.com>
2022-11-13 17:36:34 +01:00
patchback[bot]
e96bfd07b4
Actually sort the fixtures (#5510) (#5517)
* Actually sort the fixtures

I removed my more complicated fix but failed to actually put the sorted() call
back in.

* Sort by class name

(cherry picked from commit eae33c20f6)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2022-11-09 07:32:56 +01:00
Guillaume MARTINEZ
4fed0e13db
[Scaleway] Add module to manage containers (#5496)
Signed-off-by: Lunik <lunik@tiwabbit.fr>

Signed-off-by: Lunik <lunik@tiwabbit.fr>
2022-11-07 21:04:55 +01:00
Alexei Znamensky
b696aa72b2
cpanm: using CmdRunner (#5485)
* cpanm: using CmdRunner

* add changelog fragment
2022-11-07 20:15:00 +01:00
Alexei Znamensky
8fb2228125
snap: fix regex to support option values with whitespaces (#5475)
* snap: fix regex to support option values with whitespaces

* add changelog fragment
2022-11-06 11:41:11 +01:00
Alexei Znamensky
fc817601bc
django_manage: add extra tests (#5476) 2022-11-06 11:38:38 +01:00
Sam Doran
be0b5e5f8c
onepassword - Support v2 (#4728)
* Begin building out separate classes to support  different op cli versions

Create separet base classes for each major version.
Define the main interface in the base class.
Create methods for getting the current version and instantiating the
appropriate class based on the found version.

* First pass at mostly working CLI version classes

* Correct mismathched parameters

* Update _run() method to allow updating enviroment

This allows passing in the app secret as an env var, which is more
secure than using a command line arg.

* Continuing to improve the interface

* Tear existing tests down to the studs

These tests were based off of the LastPass unit tests. I’m going to
just start from scratch given the new plugin code is vastly diffenent.

* Fix sanity test

* CLI config file path can be None

* Improve required param checking

- only report missing params
- use proper grammer based on number of missing params

* Change assert_logged_in() method return value

Return a boolean value indicating whether or not account is signed in

* Improve full login for v2

Have to do a bit of a dance to avoid hitting the interactive prompt
if there are no accounts configured.

* Remove unused methods

* Add some tests

* Fix linting errors

* Move fixtures to separate file

* Restructure mock test data and add more tests

* Add boilerplate

* Add test scenario for op v2 and increase coverage

* Fix up copyright statements

* Test v1 and v2 in all cases

* Use a more descriptive variable name

* Use docstrings rather than pass in abstract class

This adds coverage to abstract methods with the least amount of hackery.

* Increase test coverage for CLI classes

* Sort test parameters to avoid collection errors

* Update version tested in docs

* Revere test parameter sorting for now

The parameters need to be sorted to avoid the issue in older Python
versions in CI, but I’m having trouble working out how to do that
currently.

* Allow passing kwargs to the lookup module under test

* Favor label over id for v2 when looking for values

Add tests

* Display a warning for section on op v2 or greater

There is no “value” in section fields. If we wanted to support sections
in v2, we would also have to allow specifying the field name in
order to override “value”.

* Move test cases to their own file

Getting a bit unwieldy having it in the test file

* Move output into JSON files fore easier reuse

* Switch to using get_options()

* Add licenses for fixture files

* Use get_option() since get_options() was added in Ansible Core 2.12

* Rearrange fixtures

* Add changelog

* Move common classes to module_utils

* Move common classes back to lookup

The plugin relies on AnsibleLookupError() quite a bit which is not available
in module code.

Remove use of display for errors since section isn’t actually deprecated.

* Properly handle sections

Still room for improvement, but this is at least a start.

* Remove some comments that won’t be addressed

* Make test gathering more deterministic to avoid failures

* Update changelog fragment

* Simple fix for making tests reliable
2022-11-06 11:32:35 +01:00
Guillaume MARTINEZ
1e17ec13b8
[Scaleway] Add module to manage container namespaces (#5416)
* [Scaleway] Add module to manage container namespaces

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* Fix CI

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix botmeta

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix typo in loop var name

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* Add missing required lib check

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix integration tests assertions

Signed-off-by: Lunik <lunik@tiwabbit.fr>

Signed-off-by: Lunik <lunik@tiwabbit.fr>
2022-11-05 20:44:33 +00:00
Guillaume MARTINEZ
db7e5f12f5
[Scaleway] Add module to manage functions (#5463)
* [Scaleway] Add module to manage function

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix integration tests assertions

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* Update plugins/modules/scaleway_function.py

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

Signed-off-by: Lunik <lunik@tiwabbit.fr>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-05 20:43:47 +00:00
Alexei Znamensky
8dc82b1890
sorted content of sanity/ignore-*.txt files (#5473) 2022-11-05 11:35:39 +01:00
Guillaume MARTINEZ
c181f2dd08
[Scaleway] Fix function namespace integration tests assertions (#5464)
Signed-off-by: Lunik <lunik@tiwabbit.fr>

Signed-off-by: Lunik <lunik@tiwabbit.fr>
2022-11-03 06:45:37 +01:00
Felix Fontein
b531ecdc9b
Unflatmap community.general (#5461)
* Move files.

* Update imports and references.

* Move wrongly placed files.

* Reverse redirects, deprecate long → short name redirects.

* Simplify contribution guidelines for new modules.

* Rewrite BOTMETA.

* Add changelog fragment.

* Fix ignore.txt files.
2022-11-02 20:42:29 +00:00
Felix Fontein
faf4ec7fa6
passwordstore lookup: allow to pass options as lookup options (#5444)
* Allow to pass options as lookup options.

* Adjust tests.
2022-11-02 20:17:08 +01:00
Guillaume MARTINEZ
5fe0f57033
[Scaleway] Add module to manage function namespaces (#5415)
* [Scaleway] Add module to manage function namespaces

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* rename short_descriptions

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* handle changed verification on hashed secret values

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix syntax for python 2.6

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix missing argon2 in unittest

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix missing value on description field

Signed-off-by: Lunik <lunik@tiwabbit.fr>

Signed-off-by: Lunik <lunik@tiwabbit.fr>
2022-11-02 20:11:04 +01:00
Felix Fontein
e718bd8445
Lookups: use Ansible's config manager whenever possible (#5440)
* Start using Ansible's config manager to handle options.

* Docs improvements.

* Fix documentation, make options actual lookup options.

* The cyberarkpassword lookup does too strange things.

* The onepassword lookups are converted in #4728, let's not interfere.

* Improve docs.

* Skip shelvefile as well.

* Convert lmdb_kv.

* Convert and fix credstash.

* Convert manifold.

* Drop chef_databag.

* Convert dig.

* Update examples.

* Forgot the most important part.

* Fix lmdb_kv docs.

* Python 2.6 compatibility.

* Convert AnsibleUnicode to str.

* Load lookup with lookup loader.

* Fix environment handling and error message checking.

* Improve docs formatting.
2022-11-01 21:58:46 +01:00
Alex Groshev
dc66aefa40
fix int options idempotence bug and add new test to check it (#5443) 2022-11-01 21:40:17 +01:00
Felix Fontein
5f4e593116 Revert "Fix non-matching defaults in docs (#5446)"
This reverts commit a978bff2c7.
2022-11-01 19:12:21 +01:00
Felix Fontein
a978bff2c7
Fix non-matching defaults in docs (#5446)
* Allow to pass options as lookup options.

* Adjust tests.

* Fix non-matching defaults.
2022-11-01 18:11:02 +01:00
Brian Coca
20b84fc709
linnode inventory, remove redundant (#5438)
* remove redundant

templar is already in base class
env var is already consulted in via config resolution

* more whites

* no need to import templar again

* Add changelog fragment.

* Try to update tests.

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-01 07:33:43 +01:00
Felix Fontein
a1f75efee2
Fix iso_customize tests. (#5447) 2022-10-31 21:15:03 +01:00
Felix Fontein
fa924aae31
Prepare un-flatmapping (#5350)
* Add module name into fixtures directory name.

* Rename conftest.py to avoid collisions.

* Match filenames inside directories.
2022-10-26 07:32:00 +02:00
Felix Fontein
2830a3452d
Remove deprecated features, bump version to 6.0.0 (#5326)
* Bump version to 6.0.0.

* sender option is now required.

* Default of want_proxmox_nodes_ansible_host changed from true to false.

* username is now an alias of user, and no longer of workspace.

* Remove deprecated return values in favor of end_state.

* Remove debug option.

* Change default of ignore_volatile_options from true to false.

* gitlab_group must now always contain the full path.

* Change default of norc from false to ture.

* Remove deprecated property.

* Add PR URL.

* Adjust bitbucket unit tests.

* Adjust module_helper integration test.
2022-10-25 08:07:21 +02:00
Guillaume MARTINEZ
2680739153
[Scaleway] Add module to manage container registries (#5399)
* [Scaleway] Add module to manage container registries

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* first review

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* lint documentation on return value

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* second review

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* second review *bis

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* second review *ter

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* Fix typo.

Signed-off-by: Lunik <lunik@tiwabbit.fr>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-10-23 17:18:06 +02:00
Alexei Znamensky
baa8bd52ab
pkgng: fix error-handling when upgrading all (#5369)
* pkgng: fix error-handling when upgrading all

* provide for rc=1 in check_mode + test

* fix name of task in test

* add changelog fragment
2022-10-23 11:42:53 +02:00
ThomasGebert
b54483b52e
nmcli: add transport_mode configuration for Infiniband devices (#5361)
* Adds transport_mode configuration for Infiniband devices

Adds transport_mode configuration for Infiniband based ipoib devices,
which is one of:
  - datagram (default)
  - connected

* Remove trailing whitespace

* Add changelog fragment

* Update changelogs/fragments/5361-nmcli-add-infiniband-transport-mode.yaml

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

* Update plugins/modules/net_tools/nmcli.py

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

* Update plugins/modules/net_tools/nmcli.py

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

* Remove default for transport_mode

* Add test for changing Infiniband transport_mode

* remove blank line at end of file

Co-authored-by: Thomas Gebert <thomas.gebert@atos.net>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-10-23 11:30:48 +02:00
Felix Fontein
5aa1e58749
Do not crash when lzma is not around. (#5393) 2022-10-20 20:32:18 +02:00
Alexei Znamensky
6f88426cf1
lxc_container: minor refactor (#5358)
* lxc_container: minor refactor

* add changelog fragment
2022-10-14 22:28:20 +02:00
Felix Fontein
e47845ab3a
Change CI group identifiers. (#5344) 2022-10-11 07:34:36 +02:00
Yuhua Zou
d76392ed2a
New module: iso_customize (#5190)
* add ansible module iso_customize.py

* rerun CI testing due to "Failed to send request to https://api.github.com/repos/ansible/ansible/issues/23642: HTTP Error 403: rate limit exceeded"

* Rerun CI testing due to "Failed to send request to https://api.github....."

* rerun CI testing due to failure "Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/v2/collections/netbox/netbox/versions/3.1.0/': The read operation timed out"

* change document part as  felixfontein's careful review

* modify test file as russoz's comments

* modify comment part of module

* add comment for the example

* add more tests: check the files are deleted / added in customized ISO

* fix it: failed to run ansible.posix.mount in ubuntu

* fix it:  ansible.posix.mount is not working well in some OS.

* change DOCUMENTATION part

* change files according to the comment from code review

* fix issue: E231: missing whitespace after ':'

* modify the description of Document

* modify code for code review

* delete extra blank line in yml file

* Try to fix CI testing issue: "Caught \"'foo' is undefined. 'foo' is undefined\" while evaluating 'b' with item == {'a': 1}"

* delete extra blank line in the end of file

* change code as the comment from code review

* change code from code review

* change type: str to type: path

* change type:str to type:path

* delete unused variable

* fix CI testing error: return-syntax-error: RETURN.dest_iso.type: not a valid value for dictionary value @ data['dest_iso']['type']. Got 'path'

* add testcase: test add files / delete files separately

* add more testcases: test if we can catch exception from error input of users

* change code from code review

* fix issue: E231: missing whitespace after ','

* change code from code review

* add notes to document

* modify notes in document part

* /rebuild_failed

/rebuild_failed

* Try to support running testcases not only in MAC but also in other OS.

* modify document

* change mount to ansible.posix.mount

* skip the test platform which report "Error mounting"

* fix mount failed: Operation not permitted

* change code from code review

* change document from code review

* fix CI testing issue in some platforms

* Update plugins/modules/files/iso_customize.py

* change code from code review

1) change testcase
2) try to fix "mount: not permitted"

* modify aliases file

* change document and rerun CI testing

* add skip/docker as suggested

* add debug task

* fix issue in redhat 7.9: occurred while running the lookup plugin 'file'. ..could not locate file in lookup..

* change code from the code review

* modify function "iso_rr_check_file_exist" to "iso_check_file_exists" to make it works in all types of ISO

1. modify function "iso_rr_check_file_exist" to "iso_check_file_exists" to make it works in all types of ISO

2. run main.yml  with newer python 3.10.6
ansible [core 2.13.4]
  config file = None
  configured module search path = ['/Users/zouy/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/6.4.0/libexec/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/zouy/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.6 (main, Aug 30 2022, 05:12:36) [Clang 13.1.6 (clang-1316.0.21.2.5)]
  jinja version = 3.1.2
  libyaml = True

* delete blank

* simply the code as suggested.

* Two small docs updates.

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-10-10 22:41:04 +02:00
Victor Martinez
8c04133284
opentelemetry: send logs (#4175)
* opentelemetry: logs property

* opentelemetry: support for span events with the Task dump output

* opentelemetry: support property to disable the logs

* bump the version when supported

* add section ini

* test: fix change of signature

* [opentelemetry][callback] changelog fragment

* Apply suggestions from code review

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-10-10 20:54:52 +02:00
manschwetusCS
dc2d3c24fa
Make pfexec become usable for illumos (#3889)
* Experimental change from OpenIndiana

* resolve pfexec problem, by removing superfluous quotes

* reimplement "wrap_exe"

* remove spaces arround keyword argument assignment

* adapted pfexec unit test

* Try to fix quoting of test expression

* Fix quoting of test expression by replacing ' with "

* Add changelog fragment
2022-10-05 08:26:40 +02:00
Kosala Atapattu
beef93f687
Allow terraform module to specify complex variable structures (#4797)
* Adding capability to specify complex variables type to terraform

* Terrform variable types are mapped to ansible veriable types

* Currently handles Dict, List, Str, Int, Bool types

* Updated the documentation accordingly

* Updated with an example.

* Update plugins/modules/cloud/misc/terraform.py

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

* Update plugins/modules/cloud/misc/terraform.py

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

* Update plugins/modules/cloud/misc/terraform.py

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

* Update plugins/modules/cloud/misc/terraform.py

Wonder how that missed the PEP8 checks :).

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

* Update plugins/modules/cloud/misc/terraform.py

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

* Adding the changelog fragment

* Update plugins/modules/cloud/misc/terraform.py

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

* Adding ``integer_types`` from ``module_utils``

Simplified the ``integer_types``,  ``str`` and ``float`` value population through ``json.dumps()``.  Now the strings can have special characters which can break the module execution.

* Update changelogs/fragments/4797-terraform-complex-variables.yml

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

* * Changed to approach to make the code more readble and simple to understand.

    * Maintaining the original for loop for the top_level variables. Therefore the rocess_conplex_args() now only handle second level variables when the type() is either Dict or List.

    * Json dumps are used only for the low level variables. Terraform CLI had issues interpreting escape sequecences from json.dumps()

* Update plugins/modules/cloud/misc/terraform.py

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

* adding boolean explicitly, although boolean is a subclass of integer, adding this for self documentation pupose and the clarity of the code.

* fixing the doc strings

* Update terraform.py

Fixing docstrings

* * Introducing format_args funtion to simplify formatting each argument type for top_level and lower level.

* Terraform Lists of strings, numbers, objects and lists are supported.

* Adding COMMAND: to the fail_json msg, for plan failures to help troubleshoot command line arguments.

* Update plugins/modules/cloud/misc/terraform.py

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

* * Adding full terraform command to fail_json() when the terrafor plan fails
    * Fixing a spelling mistake.

* plan_command if a list, stringifying the list

* * Fixing the new line for the change fragments

* Removed CR (\r) from the output messages. Now output lines carry only LF (\n), not CRLF (\r\n).

* Added integration testing for complex variables.

* Restructured integration testing code to be more expandable.

* Update changelogs/fragments/4797-terraform-complex-variables.yml

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

* Update plugins/modules/cloud/misc/terraform.py

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

* double-quotes are not properly escaped in shell, and python string
escaping are nullified the way terraform handle second tier string
variables (within terraform).

* changing all the task actions to FQCN format.

* integration testing now includes:

1. Top level strings containing, special shell characters, spaces,
   double-quotes.

2. Second level strings containing, special shell characters, spaces,
   double-quotes repeating double-quotes to ensure proper regex
substitution.

* Adding colon ':' to string test casses.

* Added complex_vars to switch between the old and the new variable
interpretations.
Updated the documentations to reflect the changes.
Updated the examples.
Handling '\' as well with the escape sequence.

* Added tests for the new escape sequences.
Added multilines tests.

* Restructuring the documente strings to a shorter string.
Argument_spec changed to 'bool'

* Update changelogs/fragments/4797-terraform-complex-variables.yml

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

* Update plugins/modules/cloud/misc/terraform.py

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

* Update plugins/modules/cloud/misc/terraform.py

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

* Update plugins/modules/cloud/misc/terraform.py

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

* Update plugins/modules/cloud/misc/terraform.py

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

* Update plugins/modules/cloud/misc/terraform.py

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

* Update plugins/modules/cloud/misc/terraform.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-10-03 22:10:16 +02:00
bratwurzt
2cac3ae879
New Module: Keycloak User Rolemapping (#4898)
* keycloak_user_rolemapping: implement user role mapping

* keycloak_user_rolemapping: additional logging

* keycloak_user_rolemapping: move to getters, use names parameters

* keycloak_user_rolemapping: add service account user example

* Add keyring and keyring_info modules (#4764)

* keycloak_user_rolemapping: write tests, address ansibullbot concerns no.1

* keycloak_user_rolemapping: address felixfontein concerns no.1

* keycloak_user_rolemapping: remove rebase mistakes

* keycloak_user_rolemapping: address felixfontein concerns no.2

* keycloak_user_rolemapping: refactor duplicate username usage example

* keycloak_user_rolemapping: fix sanity check errors no.1

* keycloak_user_rolemapping: fix sanity check errors no.2

* keycloak_user_rolemapping: fix sanity check errors no.3

* keycloak_user_rolemapping: fix sanity check errors no.4

* keycloak_user_rolemapping: write tests, address ansibullbot concerns no.1

* keycloak_user_rolemapping: resolve rebase conflicts with origin/main branch

# Conflicts:
#	plugins/module_utils/identity/keycloak/keycloak.py

* keycloak_user_rolemapping: remove keycloak_role_composites from BOTMETA.yml

* keycloak_user_rolemapping: fix sanity check errors no.5

* keycloak_user_rolemapping: address felixfontein reviews concerns no.1

* keycloak_user_rolemapping: address felixfontein reviews concerns no.2

Co-authored-by: Dušan Markovič <dusan.markovic@better.care>
Co-authored-by: ahussey-redhat <93101976+ahussey-redhat@users.noreply.github.com>
2022-10-01 18:16:47 +02:00
Alexei Znamensky
f0ee21b8b2
ini_file: fix lint error (#5307)
* ini_file: fix lint error

* add changelog fragment

* remove line from sanity test ignore files
2022-09-25 16:28:06 +02:00
Felix Fontein
a938c9de65
Add stable-2.14 to CI, adjust to devel version bump (#5298)
* Add stable-2.14 to CI, adjust to devel version bump.

* Thin out matrix a bit.
2022-09-21 07:58:52 +02:00
castorsky
7777b48c99
New module: Proxmox disk management (#5101)
* New module: Proxmox disk management

* Remove misplaced option

* Type missed

* Fixed docs, quotes, 2.7 syntax

* Forgotten comma

* Version added 5.5.0

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

* Italic options

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

* Missed dot

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

* Pythonify python

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

* Shorten command

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

* Action parameter drop. General improvements.

* Add proxmox_disk integration testing

* Shorten getting vmid

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

* Code tag for value

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

* Italic tag for option

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

* Definite ID of the VM

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

* Docs edit and loop condition

* Simplify conditions

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

* Dropped bps options, added idempotency checks

* Documentaion edit

* Rewrite create/import condition

* Trainling comma

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

* Added type field to all choosable arguments

* Description of disk bus ranges

* Fix imports

* Update version

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

* Lowercase YAML boolean

* Rename grown to resized and update documentation

* Documentation updated before actual changes

* Added 'update' flag for 'present' state

* Traling space

* YAML indentation

* Merged 'updated' option into 'present'.

* Doc update.

* Exclude 'import_from' on update

* Version bump

* yaml boolean lowercase

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

* yaml boolean lowercase

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

* More detailed description

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>
2022-09-18 22:06:21 +02:00
Felix Fontein
b371bd6a5b
Fix pkgng tests (#5266)
* Now there are problems with 13.0 as well. But maybe 13.1 works again?

* 13.1 still does not work, maybe 13.2 will (not yet available in CI)...
2022-09-10 11:29:19 +02:00