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

1115 commits

Author SHA1 Message Date
mark-tomich
d0870a022e
infiniband and bond interfaces can receive MTU settings too (#7499)
* infiniband and bond interfaces can receive MTU settings too

* adding test for default mtu setting

* the mtu parameter for infiniband is different than for ethernet

* adding changelog fragment

* Update changelogs/fragments/7499-allow-mtu-setting-on-bond-and-infiniband-interfaces.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-15 22:01:35 +01:00
Marcel
c2f08c57e0
[ssh_config] Add support for ControlMaster (#7456)
* [ssh_config] Add support for ControlMaster

* Create separate function to convert bool

* Allow str values with yes/no options to also use bool
2023-11-11 12:04:06 +01:00
Alexei Znamensky
c2e578cb14
pipx: change parameter formatter for pip_args (#7506)
* change parameter formatter for pip_args

* add changelog frag
2023-11-11 11:59:44 +01:00
Felix Fontein
74e941e432
Disable nomad tests (#7480)
Disable nomad tests.
2023-11-04 13:44:05 +01:00
Felix Fontein
57e36d7dc2
timezone tests: do not restore original timezone if it wasn't known (value 'n/a') (#7476)
Do not restore original timezone if it wasn't known (value 'n/a').
2023-11-04 13:07:49 +01:00
Felix Fontein
8055dd1c9b
Revert "Disable ansible_galaxy_install tests until Galaxy is fixed (#7440)" (#7446)
This reverts commit f7532c7d9d.
2023-10-29 20:43:15 +01:00
Felix Fontein
2b62826082
Fix more typos (#7439)
* Fix more typos in plugins/.

* Fix typos in tests/unit/.

* Fix typos in tests/integration/.

* Fix more typos.

Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>

---------

Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
2023-10-29 18:04:44 +01:00
Felix Fontein
f7532c7d9d
Disable ansible_galaxy_install tests until Galaxy is fixed (#7440)
Disable ansible_galaxy_install tests until Galaxy is fixed.
2023-10-29 09:30:16 +01:00
njutn95
6ee1f27304
Add modify_inactive_option option to ini_file module to ignore matching commented key:value pairs (#7401)
* Add `modify_inactive_option` option to `ini_file` module to ignore matching commented key:value pairs

* Add changelog fragment

* Apply suggestions from code review

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

* Minor comment fix

* Apply suggestions from code review

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-25 08:48:49 +02:00
Alexei Znamensky
3b87f58070
Test helper more (#7421)
* facter: add option to return facts instead of output variables

* Update plugins/modules/facter.py

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

* add output doc

* add changelog frag

* reversed facter.py, created facter_facts.py

* remove chglog fragment for new module

* test helper: add Helper.from_module()

* change case in variable name

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-23 23:04:18 +02:00
Alexei Znamensky
bb59962061
facter_facts: new module (#7356)
* facter: add option to return facts instead of output variables

* Update plugins/modules/facter.py

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

* add output doc

* add changelog frag

* reversed facter.py, created facter_facts.py

* remove chglog fragment for new module

* add BOTMETA entry

* adjust facters code to facters_fact, add unit test

* Update plugins/modules/facter_facts.py

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

* Update plugins/modules/facter_facts.py

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

* Update plugins/modules/facter_facts.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-22 18:11:00 +02:00
Corubba
3ae19aa28f
Handle remote_addr change in lxc connection plugin (#7373)
* Stopped container error test

* Handle remote_addr change

Detect if the remote_addr option changed, and properly "reconnect" aka
update the internal state of the plugin instance.

* Add changelog fragment

* Apply suggestions from code review

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-18 20:54:24 +02:00
Alexei Znamensky
33133f3ba9
kernel_blacklist: bugfix (#7382)
* kernel_blacklist: bugfix

* add fix + changelog frag

* skip aix,freebsd,macos,osx in integration test

* Update changelogs/fragments/7382-kernel-blacklist-bugfix.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-18 20:53:31 +02:00
Felix Fontein
91fdc8e06a
Skip odbc tests on Python 2.6 and CentOS 7 (#7385)
Skip odbc tests on Python 2.6 and CentOS 7.
2023-10-11 09:23:19 +02:00
Felix Fontein
40809ed953
Bump version of main to 8.0.0; remove deprecations, deprecate some leftovers (#7358)
* Remove disable_facts from xfconf module.

* Remove deprecated module_helper CmdMixin and users.

* Deprecate ArgFormat as well, which wasn't explicitly deprecated yet.

* Remove state=get from gconftool2.

* Remove default of access_level in gitlab_runner.

* Remove state=list from manageiq_polices.

* Remove state=list from manageiq_tags.

* Consul: when state=absent, certain options can no longer be specified.

* Remove support for Ansible 2.9 and ansible-base 2.10 from ansible_galaxy_install.

* Bump community.general version to 8.0.0.

* Fix gconftool2 tests.

* Remove mh.mixins.cmd module_utils completely.

* Re-add removed anchor on its first non-removed usage.

* remove references in return doc, refactor method _setup210plus

* remove no longer needed check in function parse_check

* improve expression

* Fix YAML.

* Lint.

---------

Co-authored-by: Alexei Znamensky <russoz@gmail.com>
2023-10-09 13:31:27 +02:00
Corubba
1bf5a44a77
Fix lxc plugin options (#7369)
* Fixture for liblxc

Add a fixture to allow testing the lxc connection plugin both with and
without liblxc being present.

Also change the test from unittest to pytest.

* Update liblxc error message

The error is not specific to python2, so remove the version. Also add
a test for it.

* Migrate to options

Because the lxc plugin was only using PlayContext properties, using host
vars like `ansible_lxc_host` didn't work. This is fixed by instead using
the `get_option` method inherited from `AnsiblePlugin`.
The options are not yet available in the `__init__` function, so the
determination of the container name is moved to the `_connect` method,
which is the first time it is actually needed.
The default for the `remote_addr` option is removed, because the string
`inventory_hostname` is not very useful. At all. This seams to have been
spread with copy&paste and a bit of cargo culting. The variable priority
already takes care of setting the value.

* Add changelog fragment

* Fix for Py2.7

`TypeError: super() takes at least 1 argument (0 given)`

* Add plugin type to changelog fragment.

* Restore untemplated default

This partially reverts commit 429d8c8cfb.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-09 09:11:11 +02:00
Alexei Znamensky
323a1dcff8
snap: detect change by checking final state (#7340)
* snap: detect change by checking final state

* detect change in snap_status variable

* add changelog frag
2023-10-08 12:03:31 +02:00
radek-sprta
0ca07b0b05
Add executable option to cargo (#7352)
* Add `executable` option to cargo

Add `executable` option to cargo to make the module easier to use with
cargo installed by rustup.

* Add changelog fragment

* Add license to integration test

* Do not test on CentOS 6

CentOS 6 cannot even validate the certificate in https://sh.rustup.rs.

* Fix condition to skip tests on CentOS 6

* Add version_added to path

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

* Update plugins/modules/cargo.py

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

* shell → command

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-06 07:41:02 +02:00
Felix Fontein
6c9713b36c
Fix Python 3.12 unit tests (#7348)
* Re-enable Python 3.12 unit tests.

* Stop using deprecated alias.

* Stop using long deprecated subset comparison function.

* Avoid another alias.

* Fix name, add Python 2 compatibility.

* Properly make backwards compatible.
2023-10-04 23:23:11 +02:00
Aritra Sen
39895a6d38
pnpm: version should not be latest when state is latest (#7339)
* (fix) don't set version at latest at state: latest

If version is forcefully set at latest when state is latest, the package
will always be changed, as there is no version "latest" will ever be
detected. It is better to keep it None.

* (fix) fixed tests to reflect recent changes

* Apply suggestions from code review

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

* (feat) added changelog fragment for pull #7339

* (fix) apply correct punctuation to changelog

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-04 08:34:27 +02:00
Val V
8dc5a60294
Support for simpleinit-msb init system (#6618)
* Support for simpleinit-msb init system

* Drop unused imports

* Correct regex

* Fix documentation

* Address BOTMETA

* PEP8 compliance

* Drop irrelevant snippet

* Add missing option type in docs

* PEP8 compliance

* Update plugins/modules/simpleinit_msb.py

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

* Update plugins/modules/simpleinit_msb.py

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

* Update plugins/modules/simpleinit_msb.py

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

* Daemonize commands in service control to handle telinit broken behavior

* Update plugins/modules/simpleinit_msb.py

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

* Update plugins/modules/simpleinit_msb.py

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

* Update plugins/modules/simpleinit_msb.py

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

* Update plugins/modules/simpleinit_msb.py

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

* Unify examples section

* Add unit tests for service state detection

* Drop unused import

* Add service enable/disable tests

* Test get_service_tools()

* Do not shadow fail_json()

* Reuse module init

* Implement service_enabled() and associated tests

* Update plugins/modules/simpleinit_msb.py

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

* Indent

* Bump version_added

* Bump requirements

* Reword and move to notes

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-03 06:37:46 +02:00
Grégoire Martini
43396efa2c
feat(redis_info): use module_utils redis to support TLS (#7267)
feat(redis_info): use redis module_utils to support TLS
2023-09-28 21:04:58 +02:00
Felix Fontein
522fb23e06
xinetd no longer exists; use mdadm instead (#7309)
xinetd no longer exists; use mdadm instead.
2023-09-24 21:18:15 +02:00
Felix Fontein
c4009deeb1 Add ignore for 2.17. 2023-09-20 19:39:24 +02:00
Alexei Znamensky
9489a1ea1c
New Module: gio_mime (#7271)
* gio_mime: new module

* multiple changes

- fixed gio_mime module utils handler detection
- add message to test helper assertion
- add unit test

* gio mime output uses unicode smart quotes

* test helper: do not use skip/xfail reason messages - break in old pytest

* Update plugins/modules/gio_mime.py

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

* change exist variables to meet standards

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-09-20 19:29:05 +02:00
Samuli Seppänen
9a7a7a9658
Add keycloak_realm_key module (#7127)
* Add keycloak_realm_key module

* keycloak_realm_key: make "ansible-test sanity" happy

Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>

* keycloak_realm_key: support check_mode

* keycloak_realm_key: add integration tests

* keycloak_realm_key: remove FIXME comment

* keycloak_realm_key: fix EOL in integration test variables

* keycloak_realm_key: remove unused import

* keycloak_realm_key: remove integration test realm at the end of test suite

* keycloak_realm_key: add version_added metadata

* keycloak_realm_key: add documentation for end_state

* keycloak_realm_key: support the "certificate" parameter

As with "private_key" changing the certificate after creation is not possible
because we can't compare the current value to the desired value.

* keycloak_realm_key: document default for certificate parameter

Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>

* keycloak_realm_key: implement diff mode

* Update plugins/modules/keycloak_realm_key.py

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

* Update plugins/modules/keycloak_realm_key.py

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

* Update plugins/modules/keycloak_realm_key.py

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

* Update plugins/modules/keycloak_realm_key.py

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

* Update plugins/modules/keycloak_realm_key.py

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

* keycloak_realm_key: remove note about literal linefeeds

* keycloak_realm_key: remove defaults from priority and certificate

* keycloak_realm_key: mark diff and check modes as partially supported

* keycloak_realm_key: implement "force" parameter

This ensures that the desired state is always enforced on keys that should be,
and are, present.

* keycloak_realm_key: fix yaml parsing error in documentation

* keycloak_realm_key: document why check_mode support is partial

* Update plugins/modules/keycloak_realm_key.py

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

* Update plugins/modules/keycloak_realm_key.py

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

* keycloak_realm_key: documentation and metadata fixes

* keycloak_realm_key: small documentation fix

* keycloak_realm_key: change version_added to 7.5.0

* Update plugins/modules/keycloak_realm_key.py

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

---------

Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-09-19 18:08:10 +02:00
Samuli Seppänen
721108d92e
Add keycloak_authz_custom_policy module (#7126)
* Add keycloak_authz_custom_policy module

* keycloak.py: add linefeed to keep linter happy

* keycloak_authz_custom_policy: add basic integration tests

* keycloak_authz_custom_policy: add support for check_mode

* keycloak_authz_custom_policy: add check_mode-specific integration tests

Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>

* keycloak_authz_custom_policy: improve logging

Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>

* keycloak_authz_custom_policy: fix typo

* keycloak_authz_custom_policy: add licensing information

This should make this module REUSE compliant

* keycloak_authz_custom_policy: remove comment markers from license files

* keycloak_authz_custom_policy: fix typo in the example

* keycloak_authz_custom_policy: fix typos in metadata

* keycloak_authz_custom_policy: change version_added to 7.5.0

* Update plugins/modules/keycloak_authz_custom_policy.py

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

---------

Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-09-19 18:07:25 +02:00
Felix Fontein
b38423c059
Add ansible-core 2.16 to the matrix (#7286)
* Add ansible-core 2.16 to the matrix.

* Re-order entries.
2023-09-19 18:03:26 +02:00
Valerio Poggi
d0f229f5d8
Add consul_role module from domant PR (#6972)
* Update as per PR comments

* Move common code to module_utils

* Break up long import line

* Fix pipeline errors

* Inital version of check_mode support

* Fix updating a role, add tests

* Fix line spacing

* Fix line indentation

* Add consul-role tests

* Fixes for role update

* Apply suggestions from code review

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

* Update as per MR comments

* Update as per MR comments

* Fix documentation issues

* Add types for sub-options

* Allow setting of policy, service and node id fields by specifying a value, or leaving them unchanged by omitting them

* Fix typo in test

* Apply suggestions from code review

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

* Reset and force push to get rid of merge

* Corrected unit tests

* Apply suggestions from code review

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

* Add suboptions documentation for node and service identities

* Fix PEP errors from pipeline

* Fix pipeline errors.

* Fix more pipeline errors

* Apply suggestions from code review

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

* Fix line that is too long

* Not specifying a value for description during update now leaves existing value unchanged

* Fixes for pipeline errors

* Add test cases to verify handling description works

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-09-17 14:35:00 +02:00
Jonathan Kamens
8a9b98273d
Add ignore_spaces option to ini_file to ignore spacing changes (#7273)
* Add `ignore_spaces` option to `ini_file` to ignore spacing changes

Add a new `ignore_spaces` option to the `ini_file` module which, if
true, prevents the module from changing a line in a file if the only
thing that would change by doing so is whitespace before or after the
`=`.

Also add test cases for this new functionality. There were previously
no tests for `ini_file` at all, and this doesn't attempt to fix that,
but it does add tests to ensure that the new behavior implemented here
as well as the old behavior in the affected code are correct.

Fixes #7202.

* Add changelog fragment

* pep8 / pylint

* remove unused import

* fix typo in comment in integration test file

* Add symlink tests to main.yml

It appears that #6546 added symlink tests but neglected to add them to
main.yml so they weren't being executed.

* ini_file symlink tests; create output files in correct location

* Add integration tests for ini_file ignore_spaces

* PR feedback
2023-09-17 13:22:22 +02:00
Alexei Znamensky
e7ff0acdac
refactor test helper context class (#7266) 2023-09-15 21:36:59 +12:00
Wouter Klein Heerenbrink
1beb38ceff
Use get(..) instead of [..] for safe lookup of value (Fixes #7240) (#7241)
A OnePassword field item might not have a value (property) when the user has omitted it (on purpose).
2023-09-13 07:48:36 +02:00
Alexei Znamensky
17c7687283
DRY: using YAML anchors and aliases (#7248) 2023-09-13 00:49:23 +12:00
Alexei Znamensky
6e3a56ffce
encapsulate test function in the helper class (#7247) 2023-09-13 00:24:10 +12:00
Alexei Znamensky
bdf8852e8d
test helper: create static methods .from_file() and .from_list() (#7239)
create static methods .from_file() and .from_list()
2023-09-12 06:42:33 +02:00
Juan Manuel Casanova González
afeeb89af6
Improvements to the jenkins_build module and new jenkins_build_info module (#7204)
* Add detach option so the task doesn't wait until the Jenkins job is finished

* Add new time_between_checks to be able to configure the sleep time between requests

* New jenkins_build_info to get information about a specific build

* Add version_added to the new module

* Add changelog fragment for jenkins_build changes

* Fix tests that required the python-jenkins module

* Remove tests that failed

Doesn't really make sense to test that with a mock

* Fix pep8 error

* Update maintainers for the jenkins_build and jenkins_build_info modules

* Improve format and add link to PR

* Move version_added documentation to the right file

* Fix incorrect examples

* Improve text format

* Fix incorrect code style

* Fix incorrect YAML for documentation

* Add version_added documentation to the new options
2023-09-10 21:28:55 +02:00
Alexei Znamensky
517e2d48eb
cpanm: using yaml-specified unit tests (#7231)
* cpanm: using yaml-specified unit tests

* add quote around URLs to appease pyaml@py26

* add changelog frag
2023-09-10 21:24:59 +02:00
xshen1
6012d2623e
feat: pagerduty_alert: Adds in use of v2 api provided (#7183)
* feat: pagerduty_alert: Adds in use of v2 api provided

* doc: Adds xishen1 to maintainer

* Pagerduty_alert: documentation change

* pagerduty_alert: update documentation

* pagerduty_alert: update periods

* pagerduty_alert: update documentation
2023-09-10 07:41:55 +02:00
Alexei Znamensky
8fa667eeb7
CmdRunner bugfix (#7200)
* cmd_runner module utils: fix bug when passing absolute path not in standard search paths

* improved tests

* changed /usr/bin/echo to /bin/echo for the sake of alpine

* fixed error messaging for last testcase

* add condition to test cases, and remove macos from troubling ones

* fix templating

* fix templating

* exclude centos 6 from testcases copying echo to tmp dir

* try different way of specifying version

* trying trick for old jinjas

* use os.path.isabs() to determine if path is absolute

* add changelog frag

* Update plugins/module_utils/cmd_runner.py

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

* Update changelogs/fragments/7200-cmd-runner-abs-path.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-09-10 07:41:04 +02:00
Aritra Sen
568814fc3e
New module: pnpm package manager (#6741)
* (feat) New module pnpm added

A new module for pnpm is added. Necessary entries were written to
BOTMETA.yml.

* (feat) Basic tests added

* (feat) reduced nesting of ifs

* (fix) trying to fix up CI pipelines

* (fix) incorrect indentation of alias fixed

* (feat) fixed further indentations

* Apply suggestions from code review

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

* (fix) various linting and CI errors fixed/ignored

* (feat) reduced restriction, new install method

Some restrictions on OS are reduced. New installation method, similar to
the official installation method, is provided.

* (fix) ignoring CentOS 6 for CI.

* retrigger checks

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-09-08 13:15:34 +02:00
Alexei Znamensky
40cad3e7a9
gconftool2: using yaml-specified unit tests (#7196)
* gconftool2: using yaml-specified unit tests

* gconftool2_info: using yaml-specified unit tests

* adjust code for skip and xfail
2023-09-02 23:30:15 +12:00
Alexei Znamensky
41bd07e372
puppet: using yaml-specified unit tests (#7193) 2023-09-02 17:41:21 +12:00
Alexei Znamensky
14bc13ba3c
further improvements (#7192)
* further improvements

* some renaming
2023-09-02 14:26:39 +12:00
Alexei Znamensky
c2d3302fc4
snap: using yaml-specified unit tests (#7191)
* snap: using yaml-specified unit tests

* remove extraneous code
2023-09-02 10:44:58 +12:00
Alexei Znamensky
ce6b2bc362
remove extraneous unused constant (#7185) 2023-09-01 06:32:31 +02:00
Alexei Znamensky
d6ebba1aea
cmd tests improvement (#7181)
* cmd tests improvement

* fix sanity

* remove commented line

* fixed class init code
2023-09-01 06:32:11 +02:00
Alexei Znamensky
6303096648
xfconf*: using yaml-specified unit tests (#7170) 2023-08-29 21:06:38 +02:00
Felix Fontein
f3a02b3efb
CI: make sure EXTERNALLY-MANAGED is absent on Arch Linux (#7172)
Make sure EXTERNALLY-MANAGED is absent on Arch.
2023-08-29 21:05:34 +02:00
Alexei Znamensky
8652fd9528
Refactored unit tests for modules based on CmdRunner (#7154)
* refactored unit tests for modules based on CmdRunner

* improved/fixed test helper

* fixed sanity

* refactored yaml spec out of the python file

* small adjustments
2023-08-29 22:13:52 +12:00
Alexei Znamensky
33998a5b70
snap: fix case when snap list is empty (#7124)
* fix case when snap list is empty

* add changelog frag
2023-08-18 07:36:06 +02:00