Commit Graph

726 Commits (main)

Author SHA1 Message Date
Felix Fontein dd4268e0d9
CI: Add macOS 15.3 (#9805)
* Add macOS 15.3.

* Install setuptools on macOS 15.
2025-02-26 21:30:22 +01:00
Nocchia 8425464c0a
Add new systemd_info module (#9764)
* add systemd_info module

* fix object results

* apply review changes

* apply module change and add doc_fragments

* removed use_unsafe_shell and doc_fragments/systemd

* fix unitname description doc

* fixed doc, replaced systemctl show syntax, added base prop result doc

* fix documentation

* fix RV values in description

* fix RV() description values

* add get_bin_path try/fail and remove list()

* fix doc, removed try block

* add Archlinux in integration test
2025-02-23 17:39:52 +01:00
Felix Fontein 217a18839d
locale_gen: enable tests for Arch Linux, make sure they don't even try to run on RHEL and Fedora VMs (#9796)
Enable locale_gen tests for Arch Linux, make sure they don't even try to run on RHEL and Fedora VMs.
2025-02-23 15:17:49 +01:00
Stephen Bradshaw 961c9b7f4c
Ssh config other options (#9684)
* Add other_options support to ssh_config module

* Changelog fragment

* Fix missing and modified stuff

* Minor changes

* Update fragment with PR URL

* Fix PEP8 issue

* Fix idempotency issue

* Update changelogs/fragments/ssh_config_add_other_options.yml

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

* Update plugins/modules/ssh_config.py

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

* Update plugins/modules/ssh_config.py

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

* Incorporate suggestions

* Missed removing str conversion

* PEP8

* Update plugins/modules/ssh_config.py

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

* Add fail condition, fix codestyle

* Force lower case key values only

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-02-22 08:41:05 +01:00
Felix Fontein a3fd357d81
Make apache2_mod_proxy work with Python 3, half-way modern Apache 2 versions, and add basic tests (#9762)
* Move Apache 2 installation to setup role.

* Make module work with Python 3.

* Add basic tests.

* Add changelog fragment.

* Simplify change.

* Pass referer.
2025-02-18 07:12:44 +01:00
Mark Armstrong 910c57aaa0
keycloak: repair integration tests by removing jinja2 templating from conditionals (#9726) (#9727)
* fix: remove jinja2 templating from conditionals in keycloak_role module integration tests (#9726)

* fix: remove jinja2 templating in conditional in keycloak clientsecret info integration test (#9726)

This test needs a further fix; see #9744. Left for a future PR for now.

* fix: remove jinja2 templating in conditional in keycloak clientsecret regenerate integration test (#9726)

* chore: remove jinja2 templating in conditional in keycloak user federation integration test (#9726)

These instances of templating were not causing failures,
but this removes the warnings.

* chore: remove jinja2 templating in conditional in keycloak user rolemapping integration test (#9726)

These instances of templating were not causing failures,
but this removes the warnings.

* docs: add changelog fragment (#9726)

* docs: repair changelog fragment yaml (#9726)

* docs: actually repair changelog fragment yaml (#9726)

* chore: remove changelog fragment for test only pr (#9726)
2025-02-15 22:53:23 +13:00
Marcel Freundl 1beee87961
lvg: Add parameter to disable removal of extra physical volumes (#9698)
* Add parameter to disable removal of extra physical volumes

Signed-off-by: Massl123 <Massl123@users.noreply.github.com>

* Set PR number in changelog fragment

Signed-off-by: Massl123 <Massl123@users.noreply.github.com>

* Fix tests

Signed-off-by: Massl123 <Massl123@users.noreply.github.com>

* Apply suggestions from code review

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

* Add comment in pvs

Signed-off-by: Massl123 <Massl123@users.noreply.github.com>

---------

Signed-off-by: Massl123 <Massl123@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-02-10 21:51:45 +01:00
Thibaut Decombe 75ffae43e6
More resilient brew formulae name handling (#9665)
* Remove update_homebrew=False (it's the default)

* Fix handling of irregular cases (brew does lowercase normalization)

* Fix handling of tap with no public fallback

* Add changelog fragment

* Add missing cleanup step

* Fix typo

* Check re-install and re-uninstall too
2025-02-10 18:59:02 +01:00
Felix Fontein efe0c464ff
Disable failing copr tests (#9705)
Disable failing copr tests.
2025-02-09 12:35:08 +01:00
Felix Fontein 10c15d31f7
filesystem tests: reiserfsprogs is no longer available on Arch Linux (#9699)
reiserfsprogs is no longer available on Arch Linux.
2025-02-08 20:06:50 +01:00
Felix Fontein 0b4337c13d
Also disable snap_alias tests for RHEL 8.8 (#9686)
Also disable snap_alias tests for RHEL 8.8.
2025-02-04 17:23:27 +01:00
Felix Fontein 54eec2cb09
Disable snap tests on RHEL 8.8 (#9679)
Disable snap tests on RHEL 8.8.
2025-02-03 10:45:01 +01:00
amPrimeSign 250dc1139c
Fb keycloak client improvement (#9644)
* Fix for failed test

TASK [keycloak_client : Assert changes not detected in last two tasks (desire when same, and check)] ***
task path: /root/ansible_collections/community/general/tests/output/.tmp/integration/keycloak_client-p3ttqf7d-ÅÑŚÌβŁÈ/tests/integration/targets/keycloak_client/tasks/main.yml:79
fatal: [testhost]: FAILED! => {
    "assertion": "check_client_when_present_and_same is not changed",
    "changed": false,
    "evaluated_to": false,
    "msg": "Assertion failed"
}

* Improved test data to test more scenarios, e.g documentation uses True in examples

* Normalize values in config

* add changelog

* Apply suggestions from code review

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

* Update tests/integration/targets/keycloak_client/vars/main.yml

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

* Update changelogs/fragments/9644-kc_client-test-improvement-and-fix.yaml

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

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-02-01 19:16:54 +01:00
Alexei Znamensky 03dfed4c35
pipx: use global in state=latest (#9623)
* pipx: use global in state=latest

* add changelog frag
2025-01-27 05:24:38 +01:00
Mark Armstrong af0118278b
Keycloak modules retry request on authentication error, support refresh token parameter (#9494)
* feat: begin refactor to support refresh token in keycloak modules

* chore: add start of tests for shared token usage

* feat: progress towards supporting refresh token; token introspection not yet working [8857]

* chore: reset to main branch previous state; a different approach is needed [8857]

* feat: add request methods to keycloak class, which will be expanded with retry logic [8857]

* feat: all requests to keycloak use request methods instead of open_url [8857]

* fix: data argument is optional in keycloak request methods [8857]

* feat: add integration test for keycloak module authentication methods [8857]

* chore: refactor get token logic to separate logic using username/pass credentials [8857]

* chore: refactor token request logic further to isolate request logic [8857]

* chore: fix minor lint issues [8857]

* test: add (currently failing) test for request with invalid auth token, valid refresh token [8857]

* chore: allow realm to be provided to role module with refresh_token, without username/pass [8857]

* feat: add retry logic to requests in keycloak module utils [8857]

* chore: rename keycloak module fail_open_url method to fail_request [8857]

* chore: update all keycloak modules to support refresh token param [8857]

* chore: add refresh_token param to keycloak doc_fragments [8857]

* chore: restore dependency between auth_realm and auth_username,auth_password params [8857]

* chore: rearrange module param checks to reduce future pr size [8857]

* chore: remove extra comma [8857]

* chore: update version added for refresh token param [8857]

* chore: add changelog fragment [8857]

* chore: re-add fail_open_url to keycloak module utils for backward compatability [8857]

* fix: do not make a new request to keycloak without reauth when refresh token not provided (#8857)

* fix: only make final auth attempt if username/pass provided, and return exception on failure (#8857)

* fix: make re-auth and retry code more consistent, ensure final exceptions are thrown (#8857)

* test: fix arguments for invalid token, valid refresh token test (#8857)

* feat: catch invalid refresh token errors during re-auth attempt (#8857)

Add test to verify this behaviour works.

* test: improve test coverage, including some unhappy path tests for authentication failures (#8857)

* chore: store auth errors from token request in backwards compatible way (#8857)

* fix: ensure method is still specified for all requests (#8857)

* chore: simplify token request logic (#8857)

* chore: rename functions to request tokens using refresh token or username/password (#8857)

To emphasize their difference from the `get_token` function,
which either gets the token from the module params
*or* makes a request for it.

* doc: add docstrings for new or significantly modified functions (#8857)

* test: repair unit test following change to exception message upon key error during auth request (#8857)
2025-01-26 15:23:39 +01:00
Stanislav Meduna f5c1b9c70f
add json_patch, json_patch_recipe and json_diff filters (#9565)
* add json_patch, json_patch_recipe and json_diff filters

* fix copyright notices

* fix documentation

* fix docs, add maintainer

* fix review remarks

* add integration test

* fix docs (positional)

* add input validation

* formatting fixes

* more typing tweaks

* documentation fix

* fix review comments

* simplicfy input checking

* accept bytes and bytearray input

* add the fail_test argument

* fix docs format

* fix typing hints

* remove unneeded __future__ imports
2025-01-21 20:51:21 +01:00
Nils cee62a4069
Proxmox remote pct connection (#8424)
* First Revision (squashed)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

* Second Revision (squashed)

* implement data_in

* Removed quot()
There is no need for quoting, exec_command gets the command already quoted with shell from Ansible

* Use shell from self._shell

* Improved error handling

* updated docs

* Use Int for Container ID

* Updated docs to include detailed description for non root usage

* Fix ansible_user var in example

* Fix become method
We need to differentiate between become method used in Proxmox and the one inside the container.

* Implement review findings
- f-Strings
- lower() when input
- yaml indent
- consistent quotes
- use to_text()
- Enhanced examples
- Ansibullbot findings

* remove ssh cache

* Ensure we delete the tempfile

* use octal mode

* Use FileLock().lock_file

* ansibullbot findings

* refactor _connect()

* Update plugins/connection/pct_remote.py

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

* Apply suggestions from code review

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

* renamed plugin to proxmox_pct_remote

* Use ansible.builtin.ping as example

* added unit tests

* fixed bugs in close()

* catch invalid host key

* test invalid host key

* Added integration test

* cleanup

* setup test via ansible

* Revised notes based on review feedback

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

* gather_facts hint in example

* Update tests/integration/targets/connection_proxmox_pct_remote/aliases

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

* Fix FreeBSD, deactivate macOS

* Test and Fix: Hang on copy with empty content

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-01-18 16:27:06 +01:00
Thibaut Decombe 114deae3e4
Fix homebrew tap name handling (#9546)
* Add failing test

* Use fully qualified names

* Add changelog fragment

* Remove unnecessary initial cleanup

* Fix tests/integration/targets/homebrew/tasks/formulae.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-01-13 18:09:06 +01:00
Felix Fontein bf69dc46ff
CI: Add Fedora 41, Alpine 3.21, RHEL 9.5, FreeBSD 14.2 to CI for devel (#9552)
* Add Fedora 41, Alpine 3.21, RHEL 9.5, FreeBSD 14.2 to CI for devel.

* Add some ignores that are likely needed.

* Try to fix/ignore various errors.

* Fix redis setup on Fedora 41.

* Undo disable yum_versionlock since it's already globally disabled.
2025-01-08 18:53:13 +01:00
Felix Fontein 1e28302a66
htpasswd: let changed reflect updated permissions (#9490)
* Let changed reflect updated permissions.

* Make pylint happy.
2024-12-31 12:19:55 +13:00
Alexei Znamensky 6bb7a1cc73
locale_gen: fix/improvements (#9238)
* locale_gen: fix/improvements

* fix sanity

* add RV doc

* add integration test forcing mechanism=debian

- test is failing

* fix RETURN doc

* reformat yaml

* comment out the test for ubuntu_mode=True

* multiple changes:

- add changelog fragment
- improved docs

* normalize docs after rebasing

* Update changelogs/fragments/9131-locale-gen-rewrite.yml

* apply recommendations from review

* Update plugins/modules/locale_gen.py

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

* Update changelogs/fragments/9238-locale-gen-rewrite.yml

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

* Update plugins/modules/locale_gen.py

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

* Update plugins/modules/locale_gen.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-12-30 21:54:50 +01:00
Philippe Duveau adb4b3c8a5
Add module ldap inc (#9275)
* Add module ldap_inc

This module adds the ‘modify-increment’ capability corresponding to the extension implemented by OpenLdap described in RFC-4525. It can be used to increment an integer attribute and read it atomically. It is an help for posix userId definition while relying only on the directory server.

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>

Update plugins/modules/ldap_inc.py

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

Update plugins/modules/ldap_inc.py

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

Update plugins/modules/ldap_inc.py

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

Fix the check mode support

Check mode documentation fix

* Update plugins/modules/ldap_inc.py

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

* Update plugins/modules/ldap_inc.py

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

* Update plugins/modules/ldap_inc.py

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

* Update plugins/modules/ldap_inc.py

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

* Update plugins/modules/ldap_inc.py

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

* Update plugins/modules/ldap_inc.py

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

* Update plugins/modules/ldap_inc.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-12-30 21:19:10 +01:00
Thomas Sjögren 482a90e8b4
add support for systemd creds encrypt/decrypt (#9383)
* add support for systemd creds encrypt/decrypt

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* add __metaclass__

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* Python 2.7 issues

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* update version_added and ci test aliases

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* switch to container

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* run tests in docker as well

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* move tasks into tasks/

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* no need to call echo

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* lint and add become:

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* dont append a newline

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* don't clean newlines

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* only use module name

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* clean

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* change msg to value

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* add return values

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* update attributes and description

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* Update plugins/modules/systemd_creds_decrypt.py

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

* set newline default

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* Update plugins/modules/systemd_creds_encrypt.py

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

* Update plugins/modules/systemd_creds_encrypt.py

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

* Update plugins/modules/systemd_creds_encrypt.py

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

* update required and spelling

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* use single backslash

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

---------

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2024-12-29 21:15:57 +01:00
Felix Fontein 2adcc34dd5
CI: Arch Linux updated to Python 3.13 (#9310)
* Arch Linux updated to Python 3.13.

* Skip lmdb_kv lookup on Arch Linux.

Ref: https://github.com/jnwatson/py-lmdb/issues/362
2024-12-22 21:53:25 +01:00
Stanislav Shamilov 2b2872f0ef
Add android sdk module (#9236)
* adds simple implementation of adding and removing android sdk packages

* adds package update

* adds simple installed packages parsing

* moves parsing logic to a separate class

* adds absent state for sdkmanager packages and setup for tests

* adds output for installing and removing packages

* removes version from Package object since it is not possible to specify version for a package while using sdkmanager

* adds 'latest' state

* adds tests

* fixes crash when sdkmanager is invoked from python with LC_ALL=C

* fixes latest state

* adds sdk_root parameter

* adds channel parameter

* simplifies regexps, removes unused named groups

* minor refactoring of sdkmanager parsing

* adds java dependency variable for different distributions

* adds RETURN documentation

* adds check for nonexisting package

* adds check for non-accepted licenses

* removes excessive methods from sdkmanager

* removes unused 'update' module parameter, packages may be updated using 'latest' state

* minor refactoring

* adds EXAMPLES doc section

* adds DOCUMENTATION section and license headers

* fixes formatting issues

* removes diff_params

* adds maintainer

* fixes sanity check issues in sdkmanager

* adds java dependency for macos and moves some tests to a separate FreeBSD configuration

* fixes dependencies setup for OSX

* fixes dependencies setup for OSX (2)

* fixes dependencies setup for OSX (3)

* Apply minor suggestions from code review

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

* applies code review suggestions

* changes force_lang from C.UTF-8 to auto in sdkmanager (as per discussion https://github.com/ansible-collections/community.general/pull/9236#discussion_r1881114326)

* Revert "changes force_lang from C.UTF-8 to auto in sdkmanager (as per discussion https://github.com/ansible-collections/community.general/pull/9236#discussion_r1881114326)"

This reverts commit 619f28dd58.

* fixes some more comments from review

* minor sanity issue fix

* uses the 'changed' test instead of checking the 'changed' attribute

* adds 'accept_licenses' parameter. Installation is now performed independently for each package specified.

* removes "Accept licenses" task from examples

* fixes docs sanity issues

* applies minor suggestions from code review

* fixes regexps. The previous version didn't match versions like "32.1.0 rc1". Also, this allows to simplify the parsing logic as there is no need to skip table headers anymore.

* renamed sdkmanager.py to android_sdkmanager.py

* applies minor suggestions from code review

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

* updates BOTMETA

* reordered BOTMETA

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2024-12-20 22:55:12 +01:00
Thibaut Decombe 9452a2c8ac
homebrew: fix incorrect handling of aliases (#9255)
* Add failing test (See commit description)

Second assert returns this:

changed: [localhost] => changed=true
  changed_pkgs:
  - sqlite3
  msg: 'Changed: 1, Unchanged: 1'
  unchanged_pkgs:
  - sqlite

* Extract proper package_name from brew info using alisases

* Add changelog fragment

* Fix pep8

* Make sure sqlite is uninstalled beforehand

* Use `package_result is (not) changed` syntax in assertions

* Register more explicit names

* Fix handling of casks
2024-12-20 22:53:41 +01:00
Felix Fontein 50b25f8c01
random_words integration tests: avoid test failure due to valid result (#9271)
Avoid test failure due to valid result.
2024-12-17 21:20:19 +01:00
Felix Fontein 9df4ef9a9c
sysrc: add another exclusion for ezjail (#9243)
Add another exclusion.
2024-12-13 21:09:58 +00:00
Max Gautier a789bd128f
Add the accumulate filter (#9133)
* Add the accumulate filter

- Add myself as a maintainer for it.
- Some integration tests.

* accumulate: fix documentation and add test aliases

The aliases file was copied over from
tests/integrations/targets/filter_dict/aliases as the documentation[1]
suggests to use the same group as existing similar tests.

[1]: https://docs.ansible.com/ansible/latest/dev_guide/testing/sanity/integration-aliases.html

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

* accumulate: documentation: markup consistency with other plugins

Suggested-by: Felix Fontein <felix@fontein.de>
Suggested-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

* filter/accumulate: Validate input is a Sequence

Accepting arbitrary iterables might lead to surprising behavior so we
are stricter on what we accept in the filter.
Relaxing those requirements is easier than retrofitting them, in terms
of backwards compatibility.

Suggested-by: Felix Fontein <felix@fontein.de>
Signed-off-by: Max Gautier <mg@max.gautier.name>

* filter/accumulate: Document the behavior with a string

Signed-off-by: Max Gautier <mg@max.gautier.name>

---------

Signed-off-by: Max Gautier <mg@max.gautier.name>
2024-12-02 20:20:13 +01:00
ONODERA Masaru 34010a788a
Add dynamicforward option (#9192)
* Add dynamicforward option

* Add fragment

* Modify fragment
2024-12-02 20:18:56 +01:00
Thibaut Decombe fddccea940
Greatly speed up homebrew module when multiple packages are passed in the `name` key (#9181)
* Increase test coverage and assert output more strictly

* Remove unused `_current_package_is_installed_from_head`

* Remove `un/changed_count` and infer from un/changed_pkgs length

* Track `installed` & `outdated` package state once

* Validate package names beforehand

* Install packages in 1 brew call instead of N

This also has the side effect of fixing the check message so that it prints every packages that will be installed instead of only the first one.

* Uninstall packages in 1 brew call instead of N

* Link packages in 1 brew call instead of N

* Unlink packages in 1 brew call instead of N

* Upgrade packages in 1 brew call instead of N

* Remove dangling checks

* Remove `_status` method and directly return the tuple

* Add changelog fragment

* Fix invalid format string (nice catch pylint!)

* Update changelogs/fragments/9181-improve-homebrew-module-performance.yml

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

* Update brew info parsing for casks

* Update changelogs/fragments/9181-improve-homebrew-module-performance.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>
2024-12-02 20:17:04 +01:00
Stanislav Shamilov 41b6a281e1
Add decompress module (#9175)
* adds simple implementation of `decompress` module

* adds simple test, fixes src and dest arg types

* minor refactoring

* adds support for common file operations
adds integration test for gz decompressing

* makes tests parametrized to test all supported compression formats

* checks that target file exists

* writes to decompressed file now uses atomic_move

* adds idempotency for decompression

* refactoring, removed classes

* adds support for check mode

* adds check for destination file. If it exists and it is a directory, the module returns error

* refactoring, moves code to a class. Also, simplifies tests (now only tests related to the module core functionality run as parametrized, tests for idempotency and check mode run only for one format)

* adds 'remove' parameter that deletes original compressed file after decompression

* adds documentation

* fixes bug with 'remove' parameter in check mode

* makes dest argument not required. Dest filename now can be produced from the src filename

* adds dest to output

* updates the documentation, adds "RETURN" block

* fixes test

* adds support for python2

* removes some of the test files that can be generated during testing. Adds copyright header to test files

* adds maintainer

* apply minor suggestions from code review

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

* fixes code review comments (idempotency issue with non existing src, existing dest and remove=true; fixes the issue and adds test)

* refactors the module to use ModuleHelper

* refactors lzma dependency manual check to use 'deps.validate'

* minor fix

* removes registered handlers check

* minor refactoring

* adds aliases

* changes setup for tests

* tests: ignores macos and fixes tests for FreeBSD

* tests: reverts ignore for macos and fixes issue with centos7

* tests: adds liblzma dependency for python2

* tests: adds backports.lzma

* fixes bz2 decompression for python2

* tests: install xz for osx

* tests: install xz for osx (2)

* fixes code review comments

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-12-02 20:16:00 +01:00
Alexei Znamensky a9449ccc2e
pipx/pipx_info: add return value version (#9180)
* pipx/pipx_info: add return value version

* add changelog frag
2024-11-24 22:10:19 +01:00
Alexei Znamensky 47637cdec7
locale_gen: add testcase for de_CH.utf8 (#9176) 2024-11-23 10:47:22 +13:00
Alexei Znamensky bf6ae7bf59
pipx: add testcase for upgrade --global (#9170) 2024-11-22 18:36:16 +13:00
Stanislav Shamilov 523439ab62
alternatives: add support for "family" parameter (#9096)
* alternatives: added parsing and setting of 'family' for an alternative

* alternatives: added checks for path nullability

* alternatives: added idempotence when setting alternative using family

* alternatives: added family to diff mode

* alternatives: added tests for family

* alternatives: updated documentation and examples

* alternatives: added constraints for 'path' and 'family' parameters.

in any invariants at least one of the parameters must be specified

* alternatives: added changelog fragment

* removed unnecessary check

* added version

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-11-16 18:34:09 +01:00
Felix Fontein 04c2ad18da
Add FreeBSD 13.4 to CI (#9109)
* Add FreeBSD 13.4 to CI.

* iso_extract won't work.

* pkgng: jail won't work either.
2024-11-08 23:05:35 +01:00
Alexei Znamensky 2429e228a4
pipx/pipx_info: multiple fixes (#9044)
* pipx_info: factored process_list out

* pipx_info: no need to pass param to _list

* pipx_info: minor adjustment

* pipx mod utils: make_process_list parameters

* fix test for state=install_all

* fix assertions

* pipx tests: fix detection of pipx 1.7.0

* pipx: use make_process_output

* add testcase

* pipx: remove import json

* pinned in pipx list is not always there

* Update plugins/modules/pipx_info.py

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

* remove ensurepath and --user from pipx install

* add changelog frag

* Update changelogs/fragments/9044-pipx-fixes.yml

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

* Update changelogs/fragments/9044-pipx-fixes.yml

* Update changelogs/fragments/9044-pipx-fixes.yml

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

* Update changelogs/fragments/9044-pipx-fixes.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-11-02 17:50:24 +01:00
lewismiddleton 5b3b7a1fb1
github_app_access_token: add support for private key fact (#8989)
* github_app_access_token: add support for private key fact

Adds support for specifying the GitHub App private key via an ansible
fact instead of a path to a file.

This is useful when you want to generate registration tokens for a
remote host but don't want to put secrets on the host.

* Add license file

* Fix pep8 formatting

* Add changelog fragment

* Run sanity tests on changelog

* Apply suggestions from code review

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>

* Add input validation check

* Add import

* Apply suggestions from code review

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

* Add error for mutually exclusive options

* Update plugins/lookup/github_app_access_token.py

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>
2024-10-21 20:53:18 +02:00
Felix Fontein b1f4604067
Skip timezone test on RHEL 7.9 VMs (#9035)
Skip timezone test on RHEL 7.9 VMs.
2024-10-19 14:05:48 +02:00
TobiasZeuch181 410288401b
Add zypper_repository_info module (#8778)
* Adding the list-option for reading the registered repodata

* adding a parameter list
* if the parameter is set, return the output (as a dictionary)
* adjusting the documentation for the new parameter

* Adding changelot-fragment

and link to the issue in the issue-tracker https://github.com/ansible-collections/community.general/issues/8777

* Adding description and example for the new list parameter

* Adding type for new parameter list to argument_spec

* Revert "Adding type for new parameter list to argument_spec"

This reverts commit 6b86e8ba447a9b53e434c79d33c7fe260485b342.

* Revert "Adding description and example for the new list parameter"

This reverts commit db06dafb958f6aeffa38adeee85623904b26bbb1.

* Adding a new module for reading the list of regiestered repositories

I created a new module for reading the repositories based on a sub-procedure from the existing zypper_repository

* Removing the changes to module zypper_repository

because the list-option is not supposed to go into this module

* removing the last change from the zypper_repository module

* Fixing linter errors

Adding extra lines before definitions
adding the missing dash in the documentation
removing the unused imports

* Adding maintainer under BOTMETA, adding test and fixing suggestions

I added the maintainer to BOTMETA
I applied the suggestions on the code form the review
I added a test for the new module to the existing zypper_repository-tests

* Adding maintainer under BOTMETA, adding test and fixing suggestions

I added the maintainer to BOTMETA
I applied the suggestions on the code form the review
I added a test for the new module to the existing zypper_repository-tests

* Deleting the fragment because this will be created automatically

I deleted the fragment because this will be created automatically based on the short_description and version_added

* removing foreign commits from history that accidentily sneaked in with the last rebase

* Update plugins/modules/zypper_repository_info.py

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

* Update .github/BOTMETA.yml

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

* Update plugins/modules/zypper_repository_info.py

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

* Update plugins/modules/zypper_repository_info.py

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

* Update plugins/modules/zypper_repository_info.py

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

* Update plugins/modules/zypper_repository_info.py

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

* removing irrelevant return fields from the sample

* Quoting the line with the colon

* fixing syntax errors in sam

* removing duplicate Note section

* Removing newline on sample-code

* Update version_added to 9.5.0

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

* Update description (notespelling)

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

* Update .github/BOTMETA.yml

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

* Update descriptino (notespelling URL)

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

* use module_utils.deps to include the parseString/parseXML module

* clean up module and botmeta

cleanup:
* remove duplicate entry from botmeta
* move imports below DOCUMENTATION
* remove unused imports
* add required key 'returned'

* moving import and fixing syntax

In this documentation example the return type is dict instead of dictionary: https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_documenting.html#return-block
Also the from __future__ import should be at the beginning of the file, according to lint

* Enabling check-mode

because the module doesn't change anything anyways

* indicate empty dictionary

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

* Update version_added

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>
2024-10-12 10:05:34 +02:00
Felix Fontein 29a2df8e6b
udm_user, homectl: use legacycrypt on Python 3.13+ (#8987)
Use legacycrypt on Python 3.13+.
2024-10-07 21:56:37 +02:00
alexander fea0ffa5aa
one_image/one_image_info: refactor (#8889)
* Refactor one_image

* Refactor one_image_info

* Add examples one_image

* Add CHANGELOG fragment

* Add integration tests for one_image

* Add integration tests for one_image_info

* Update one_image DOC

* Update one_image_info DOC

* Update one_image DOC

* Update one_image_info DOC

* Fix f-strings for one_image

* Update CHANGELOG fragment

* PR fixes

* PR fixes
2024-10-05 15:02:01 +02:00
Alexei Znamensky a7d1b0fc52
python_runner/django_command: bugfixes (#8944)
* python_runner/django_command: bugfixes

* fix indentation

* join path_prefix with : when concatenating with PATH

* add changelog frag
2024-09-30 09:45:32 +03:00
Felix Fontein fe18b05f08
10.0.0: remove deprecated features (#8918)
* Remove pool option from redhat_subscription.

* Remove proxmox_default_behavior option from proxmox_kvm.

* Remove the logging option from ejabberd_user.

* Remove the ack_params_state_absent option from consul.

* irc: change defaults of use_tls and validate_certs to true.

* rhsm_repository: remove states present and absent.

* Re-add 'using'.

* Fix typo.
2024-09-28 08:11:21 +03:00
Alexei Znamensky 002f137134
10.0.0: CmdRunner: remove deprecated feature (#8928)
* remove deprecated feature

* remove deprecated feature from tests as well

* Adjust the integration test

* add changelog frag
2024-09-26 12:01:36 +03:00
Alexei Znamensky 76ebda7faf
snap tests: re-enable test for --dangerous using smaller snap (#8861) 2024-09-13 22:46:48 +02:00
Eike Waldt 529af4984c
keycloak_userprofile: new module (#8651)
keycloak_userprofile: new keycloak module to manage user profiles (#8651)
2024-09-09 13:51:07 +02:00
alexander d9b0c42f5f
Add one_vnet module (#8769)
* Add one_vnet module

* Add one_vnet integration tests

* Update BOTMETA.yml

* Update aliases

---------

Co-authored-by: Александр Бакановский <abakanovskii@astralinux.ru>
2024-09-08 14:24:33 +02:00
Alexei Znamensky 43f8adf1a5
pipx: add new states (#8809)
* ensure minimum version of pip

* ensure pipx 1.7.0 is installed

* pipx: add new states/params

* add tests

* add license to json file

* Update plugins/modules/pipx.py

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

* fix uninject tests

* add changelog frag

* fix doc per review

* refactor license out of pipx spec file

* Update plugins/modules/pipx.py

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

* Update tests/integration/targets/pipx/files/spec.json.license

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-09-07 09:49:16 +12:00