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

634 commits

Author SHA1 Message Date
Maxopoly
23396e62dc
Fix check mode in iptables_state for incomplete iptables-save files along with integration tests (#8029)
* Implement integration test to reproduce #7463

* Make new iptables_state checks async

* Add missing commit to iptable_state integration test

* Remove async when using checkmode in iptables_state integration tests

* Do per table comparison in check mode for iptables_state

* Calculate changes of iptables state per table based on result

* Output target iptables state in checkmode

* Refactor calculation of invidual table states in iptables_state

* Add missing return for table calculation

* Add missing arg to regex check

* Remove leftover debug output for target iptable state

* Parse per table state from raw state string

* Join restored state for extration of table specific rules

* Switch arguments for joining restored iptable state

* Output final ip table state

* Compare content of tables

* Complete iptables partial tables test cases

* Correct order of test iptables data

* Update docu for iptables tables_after

* Add changelog fragment

* Appease the linting gods for iptables_state

* Adjust spelling and remove tables_after from return values
2024-03-24 18:02:48 +01:00
Todd Lewis
4363f8764b
ini_file - support optional spaces around section names (#8075)
* ini_file - support optional spaces between section names and their surrounding brackets

Some ini files have spaces between some of their section names and the
brackets that enclose them. This is documented in the 'openssl.cnf(5)' man
page. In order to manage files such as /etc/ssl/openssl.cnf with ini_file
before now, one would have to include spaces in the section name like this:
    section: ' crypto_policy '
    option: Options
    value: UnsafeLegacyRenegotiation

This change implements matching section headers with such optional spaces.
Existing tasks using the workaround above will continue to work, even in
cases where spaces in section headers are subsequently removed.

* readability improvement in the test content expressions

---------

Co-authored-by: Todd Lewis <todd_lewis@unc.edu>
2024-03-24 18:02:13 +01:00
Felix Fontein
47b4cf766e
CI: Add FreeBSD 13.3 and 14.0 for devel, move FreeBSD 13.2 to stable-2.16 (#8122)
* Add FreeBSD 13.3 and 14.0 for devel, move FreeBSD 13.2 to stable-2.16.

* Skip some targets.

* Skip pkgng jail tests (again :( ).
2024-03-21 22:15:52 +01:00
Felix Fontein
1c4197aa23
Skip cloud_init_data_facts tests on OpenSuSE Leap 15 (#8103)
Skip cloud_init_data_facts tests on OpenSuSE Leap 15.5.
2024-03-17 17:10:20 +01:00
Felix Fontein
23fbc5e241
Fix pacman tests in CI (#8102)
Fix pacman tests.
2024-03-17 16:49:10 +01:00
Florian Apolloner
67736d796a
Fix consul_token usage without accessor_id. (#8091)
* Fix consul_token usage without accessor_id.

* Update changelogs/fragments/8091-consul-token-fixes.yaml

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

* Update plugins/modules/consul_token.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-03-14 23:14:37 +01:00
Alexander Petrenz
0ded1109fe
feat(lookup/merge_variables): Add all hosts mode to collect configuration across multiple hosts (#7999)
* Add Feature to collect variables accross different hosts

* fix merging lists

* adjust unit tests

* lint fixes

* adjusting integration tests

* remove white spaces

* Update plugins/lookup/merge_variables.py

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

* Update plugins/lookup/merge_variables.py

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

* Update plugins/lookup/merge_variables.py

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

* apply suggested changes to correctly handling the initial_value parameter, incl. additional test

* whitespace

---------

Co-authored-by: Alexander Petrenz <alexander.petrenz@posteo.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
2024-03-08 07:25:39 +01:00
Zoran Krleza
f6d0b35bb7
GitLab group and project access token modules (#7964)
* Adding gitlab group and project acess token modules

* Documentation corrections and recreate option change

* Documentation corrections

* Correcting documentation for return objects
2024-02-25 19:44:49 +01:00
cfiehe
102a0857db
New filters to calculate the union, intersection, difference and symmetric difference of lists by preserving the items order (#7985)
New filters lists_union, lists_intersect, lists_difference and lists_symmetric_difference added.

Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
Co-authored-by: Christoph Fiehe <c.fiehe@eurodata.de>
2024-02-23 20:35:09 +01:00
adaniaud
49bd9cbd3c
Add noexec support to sudoers (#7983)
* Add noexec support to sudoers

* Add changelog fragment #7983

* Fix yml formatting in fragment 7983

* Apply suggestions from code review

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-02-23 06:36:45 +01:00
Maxopoly
ffa3d15881
Implement integration tests for apk (#7992)
* Implement integration tests for apk

* Add group for apk integration test

* Adjust integration tests of apk as suggested in PR
2024-02-22 20:48:11 +01:00
desand01
001292c780
Fixes #1226 - keycloak_client detects changes on check_mode but not in run mode (#7881)
* Fix warning integrated

* Update Keycloak version intergrated test

* Exclude metadata from diff test

* Sanity

* Add fragments

* typo

* Add test

* Update changelogs/fragments/7881-fix-keycloak-client-ckeckmode.yml

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

* Remove docker compose

* Update changelogs/fragments/7881-fix-keycloak-client-ckeckmode.yml

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

---------

Co-authored-by: Andre Desrosiers <andre.desrosiers@ssss.gouv.qc.ca>
Co-authored-by: Felix Fontein <felix@fontein.de>
2024-02-17 12:31:45 +01:00
Felix Fontein
980fa36fac
Add default_without_diff callback (#7949)
* Add default_without_diff callback.

* Add examples and BOTMETA entry.
2024-02-14 22:53:16 +01:00
Felix Fontein
549a73bd78
filesize: use 2 TB instead of 4 TB in sparse file tests (#7935)
Use 2 TB instead of 4 TB.

4 TB does not work on the Alpine VMs for some reason
(File too large / cannot seek: Invalid argument).
2024-02-03 15:06:35 +01:00
Florian Apolloner
afd1988810
Consul action group (#7897)
Added action group for new style consul modules.
2024-01-27 10:58:41 +01:00
João Victor Silva
be3bfd6fa5
Detection of already installed homebrew cask (#7870)
* fix: detect already installed cask

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

chore: add changelog fragment

* test: add homebrew cask specific tests

* refactor: change cask used in tests

* chore: apply suggestions to changelog fragment
2024-01-27 10:23:52 +01:00
Florian Apolloner
29f9865497
Add new consul modules and reuse code between them. (#7878)
Refactored consul modules and added new roles.
2024-01-27 10:22:44 +01:00
Gabriele Pongelli
5c72ab34bf
New module: gitlab_label (#7657)
* gitlab project label first commit

* fixes from CI run

* fixing some sanity test

* sanity checks, removing typing

* remove default for required field

* fix indentation

* improving test set

* fixes to pass test set

* reuse compliancy

* fix sanity checks

* fix: method returns group, not project

* refactor: start adding group, test still pass

* updated module and tests to handle group labels

* update name to remove 'project'

* removing default

* typo

* generic name for returned dict

* returns also label object from library invocation

* remove unused var, updated doc

* fix output object name

* version_added

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

* Remove python 2.7

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

* Missing dot

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

* Remove version_added

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

* Remove useless doc

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

* Color is a string

* Fixes from recent PR comments.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-01-26 23:31:22 +01:00
Gabriele Pongelli
4298f2dd92
New module: gitlab_milestone (#7824)
* new module gitlab_milestone

* change BOTMETA

* remove blank line

* version_added field

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

* Update plugins/modules/gitlab_milestone.py

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

* Update description with reference

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

* Dates as string type

* Removed python 2.7 requirement

* Fixes from recent PR comments.

* milestones_obj returned on success

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-01-26 23:30:35 +01:00
Florian Apolloner
44679e71a2
Refactor of consul modules (#7826)
* Extract common functionality.

* Refactor duplicated code into module_utils.

* Fixed ansible-test issues.

* Address review comments.

* Revert changes to consul_acl.

It uses deprecated APIs disabled since Consul 1.11 (which is EOL), don't
bother updating the module anymore.

* Remove unused code.

* Merge token into default doc fragment.

* JSON all the way down.

* extract validation tests into custom file and prep for requests removal.

* Removed dependency on requests.

* Initial test for consul_kv.

* fixup license headers.

* Revert changes to consul.py since it utilizes python-consul.

* Disable the lookup test for now.

* Fix python 2.7 support.

* Address review comments.

* Address review comments.

* Addec changelog fragment.

* Mark ConsulModule as private.
2024-01-21 18:29:29 +01:00
Felix Fontein
002208f425
Make compatible with newer reuse versions (#7858)
Make compatible with newer reuse versions.
2024-01-17 23:17:07 +01:00
Felix Fontein
8891f559ef
Disable timezone tests on Arch Linux (#7831)
Disable timezone tests on Arch Linux.
2024-01-13 10:11:24 +01:00
Felix Fontein
878664778e
CI: fix xml tests on RHEL 8 (#7827)
* Try to fix xml installation on RHEL.

* Install python-lxml on RHEL 8. Should speed up tests considerably.
2024-01-13 09:57:58 +01:00
Felix Fontein
ee8b15708f
Fix failing sanity and integration tests (#7807)
* Remove some Shippable specific code that trips latest shellcheck.

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

* Copy on the remote, not from controller to remote.
2024-01-04 22:46:37 +01:00
Julian
4f92f39720
Proxmox add storage content listing (#7725)
Add module to list content on proxmox storage

We first add a method to list storage content for proxmox, then use that
new methode to add an Ansible module to list content on storage attached
to a proxmox node. User can also use content filtering to define what
they want to list (backup, iso, images,...).

This commit also include the integration and unit test for that new
module.

Co-authored-by: Julian Vanden Broeck <julian.vandenbroeck@dalibo.com>
2023-12-31 15:21:20 +01:00
John Berninger
1a3c93f80c
Add proxmox_node_info module (#7689)
* Add proxmox_node_info module - restarted PR due to erroneous update/push of my local fork.

* Used wrong user ID.

* Changes requested by felixfontein:
- Capitalization and punctuation in documentation section
- trailing comma on line 125
- Re-order BOTMETA so it is alphabetical

* Mis-copied older version of code, correcting actual call

* Add tests for proxmox_node_info module
2023-12-29 09:41:49 +01:00
desand01
e99b5086a8
Keycloak components info (#7694)
* Before test

* first test

* test

* Sanity ok

* Fixe readme

* Refactor

* Sanity

* Fixe doc

* version added

* refactor

* Copyright

* Sanity

* Sanity

* Fixe text

* Encode providerType

* Test for failed ic

* Update plugins/modules/keycloak_component_info.py

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

* Update plugins/modules/keycloak_component_info.py

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

* Update plugins/modules/keycloak_component_info.py

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

* Update plugins/modules/keycloak_component_info.py

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

* Update plugins/modules/keycloak_component_info.py

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

* Update plugins/modules/keycloak_component_info.py

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

* Update plugins/modules/keycloak_component_info.py

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

* Delete changelogs/fragments/7694-Keycloak-components-info.yml

---------

Co-authored-by: Andre Desrosiers <andre.desrosiers@ssss.gouv.qc.ca>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-28 18:11:55 +01:00
Alexander Groß
f7bc6964be
Add keycloak_realm_rolemapping module to map realm roles to groups (#7663)
* Add keycloak_realm_rolemapping module to map realm roles to groups

* Whitespace

* Description in plain English

* Casing

* Update error reporting as per #7645

* Add agross as maintainer of keycloak_realm_rolemapping module

* cid and client_id are not used here

* Credit other authors

* mhuysamen submitted #7645
* Gaetan2907 authored keycloak_client_rolemapping.py which I took as a
  basis

* Add integration tests

* With Keycloak 23 realmRoles are only returned if assigned

* Remove debug statement

* Add test verifying that unmap works when no realm roles are assigned

* Add license to readme

* Change version number this module was added

* Document which versions of the docker images have been tested

* Downgrade version_added

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-28 18:11:32 +01:00
Jakub Danek
fd0d05d6f2
Bugfix: keycloak_identity_provider does not handle mapper changes properly (#7418)
* fix keycloak_identity_provider ITs to actually pass

- wrong identityProviderAlias in mapper configuration

* kc_identity_provider: add mapper reconfiguration regression tests

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

* kc_identity_provider: add bugfixes for mapper reconfigurations

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

* add changelog fragment

* prevent unnecessary update_mapper calls when there is no change

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

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

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

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

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

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

* Update plugins/modules/keycloak_identity_provider.py

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

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

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-28 09:50:01 +01:00
Steffen Scheib
ec12422fae
Adding a new filter: to_ini, which allows conversion of a dictionary to an INI formatted string (#7744)
* Adding a new filter: to_ini, which allows conversion of a dictionary to an INI formatted string

* Adding to_ini maintainers into BOTMETA

* Correcting filter suffix

* Moving filter to correct path

* Adding error handling; Removing quotes from examples; Fixing RETURN documentation

* Removing the last newline char; Adding error handling for an empty dict

* Adding integration tests for to_ini

* Fixing F-String usage

* Fixing formatting

* Fixing whitespace

* Moving import statements below documentation; Adding a more generic Exception handling; Removing unused imports

* Removing not needed set_fact and replacing it with using vars:

* Replacing MutableMapping with Mapping
2023-12-28 08:32:57 +01:00
Stéphane Graber
6d74e0c640
Introduce an Incus connection plugin (#7726)
* plugins/connection/incus: Introduce new plugin

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>

* BOTMETA: Add incus connection plugin

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>

* tests/integration: Add connection_incus test

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>

---------

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-12-28 08:32:31 +01:00
Steffen Scheib
ec6dfe2fcd
Adding a new filter: from_ini, which allows conversion of INI content to a dictionary (#7743)
* Adding a new filter: from_ini, which allows conversion of INI content to a dictionary

* Adding from_ini maintainers into BOTMETA

* Adding error handling; Removing quotes from examples; Fixing RETURN documentation

* Adding integration tests

* Moving imports below documentation; Adding a more general exception handling
2023-12-28 08:32:21 +01:00
mjfinney
6c1eb77f18
Add ssh_config module option for identities_only (#7704)
* Add ssh_config module option for identities_only

* Add changelog fragment for 7704

* remove trailing whitespace

* Apply suggestions from code review

Documentation change suggestions from felixfontein

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

---------

Co-authored-by: Michael Finney <michael.finney@tpwd.texas.gov>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-17 15:14:24 +01:00
mjfinney
5e5e1963c3
ssh_config: Add add_keys_to_agent option (#7703)
* Add ssh_config module option for add_keys_to_agent

* Add changelog fragment for 7703

---------

Co-authored-by: Michael Finney <michael.finney@tpwd.texas.gov>
2023-12-17 15:14:07 +01:00
Felix Fontein
0c7b9e50b5
Fix keytool setup on Debian Bookworm (#7709)
Fix keytool setup on Debian Bookworm.
2023-12-09 23:47:48 +01:00
Felix Fontein
aea238e5d1
Fix integration tests on Arch (#7705)
* Fix ejabberd_user integration tests on Arch Linux.

* Fix odbc integration tests on Arch Linux.

* The old name of systemd_service is systemd.
2023-12-09 17:21:05 +01:00
Laszlo Szomor
a599afa384
lvol: Change `pvs` argument type to list (of str) (#7676)
* lvol: Change ``pvs`` argument type to list (of str)

* Add changelog fragment

* Apply review suggestions
2023-12-04 05:58:55 +01:00
Günther Grill
07bac1777f
git_config: support multiple values for same name (#7260)
* Refactor the existing git_config.py

* Support multiple values for same name
2023-12-03 09:41:34 +01:00
Ondrej Zvara
f4a87fdbcb
New module: gitlab_issue.py (#7539)
* feat(gitlab_issue): adds module for gitlab issues management

* Apply suggestions from code review

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

* Apply suggestions from code review

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

* fix(gitlab_issue): assignee_ids and labels as lists

* docs(gitlab_issue): fix missing element types

* Apply suggestions from code review

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

* chore(gitlab_issue): remove unnecessary parameter checks

* chore(gitlab_issue): renaming milestone_id parameter to milestone_search

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Léo GATELLIER <26511053+lgatellier@users.noreply.github.com>
2023-12-02 20:55:19 +01:00
Felix Fontein
096d36adc5
passwordstore tests: re-enable gopass on Debian-like systems (#7656)
Re-enable gopass on Debian-like systems.
2023-12-01 16:39:51 +00:00
Felix Fontein
0589c84176
Fix and re-enable cmd_runner tests (#7630)
Fix cmd_runner tests.
2023-12-01 12:46:31 +01:00
Günther Grill
1b9d437be8
New module git config info (#7587)
Add new module git_config_info
2023-11-29 08:37:50 +01:00
Felix Fontein
dbba0d1956
Fix osx_defaults tests (#7631)
Fix osx_defaults tests.
2023-11-29 07:40:32 +01:00
Felix Fontein
3b779ecade
Fix bad expressions in tests (#7625)
* Fix bad expressions in tests.

ci_complete

* Disable cmd_runner integration tests.

ci_complete

* Another bad expression.

ci_complete
2023-11-29 06:53:48 +01:00
Felix Fontein
5adb7ab948
interfaces_file: filter by address_familiy when updating method (#7612)
* When updating method, check address_family if provided.

* Also test modifying 'method' without address_family filter.
2023-11-26 19:34:13 +01:00
Felix Fontein
12395732e8
CI: temporarily skip passwordstore tests on Debian/Ubuntu (#7603)
Skip passwordstore tests on Debian/Ubuntu.
2023-11-26 17:19:24 +01:00
Vladimir Botka
2a5e7c33df
Add test fqdn_valid (#7533)
* Add test fqdn_valid

* Add integration test fqdn_valid

* Add changelogs 7533-add-test-fqdn_valid

* Fix changelogs filename 7533-add-test-fqdn_valid.yml

* Add runme.* to install PyPI package fqdn and run the test.

* Remove changelog. New tests are documented by their version_added + short_description.

* Guarded import fqdn.

* Update plugins/test/fqdn_valid.py

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

* Update plugins/test/fqdn_valid.py

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

* Update plugins/test/fqdn_valid.py

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

* Update plugins/test/fqdn_valid.py

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

* Update tests/integration/targets/test_fqdn_valid/aliases

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

* Add tests/fqdn_valid.py maintained by vbotka.

* Fix integration. Add explicit collections to test_fqdn_valid

* Fix integration. Remove unused import ansible.errors

* Fix PEP8 E275

* Fix E402 module level import not at top of file.

* Fix E275 missing whitespace after keyword

* Update plugins/test/fqdn_valid.py

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

* Update plugins/test/fqdn_valid.py

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

* Update plugins/test/fqdn_valid.py

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

* Update plugins/test/fqdn_valid.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-22 09:12:00 +01:00
Felix Fontein
b8ecb1671b
CI: devel supports Fedora 39, and no longer Fedora 38 (#7541)
* devel supports Fedora 39, and no longer Fedora 38.

* Disable 'mail' tests for Python 3.12+.

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

* Fix setupSSLServer to work with Python 3.12.
2023-11-18 14:03:16 +01:00
Felix Fontein
b3c661a9f6
sysrc: FreeBSD jail test no longer works with FreeBSD 13.1 (#7543)
Jail test no longer works with FreeBSD 13.1.
2023-11-18 13:51:00 +01:00
Felix Fontein
89f12c87eb
CI: remove skip/python2.6 from aliases (#7534)
Remove skip/python2.6 from aliases.

Since 8.0.0 we no longer support any ansible-core version that supports Python 2.6.
2023-11-16 21:02:40 +01:00