Commit Graph

391 Commits (d887930e4959bea4769614fb1f9b3e0bf19b4d90)

Author SHA1 Message Date
Vladimir Botka 23d97fa4b0
Add inventory plugin iocage (#9262)
* Add inventory plugin iocage #9261

* inventory/iocage.py BOTMETA entry added.

* Remove missing methods from the test.

* Avoid shell mode.

* Parameter host is optional default=localhost

* Fix AnsibleError calls.

* Update plugins/inventory/iocage.py

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

* Update plugins/inventory/iocage.py

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

* Update plugins/inventory/iocage.py

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

* Update plugins/inventory/iocage.py

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

* Update plugins/inventory/iocage.py

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

* Update plugins/inventory/iocage.py

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

* Update plugins/inventory/iocage.py

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

* iocage_data removed. Not necessarily defined at this point.

* Description mentions that remote hosts are contacted via SSH.

* test inventory iocage

* Create get_jails and get_properties in iocage plugin to simplify testing.
* Update test_iocage.py
* Add fixtures iocage_*

* Update documentation.

* Update documentation.

* Update documentation.

* Fix localhost environment.

* Update plugins/inventory/iocage.py

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

* Update plugins/inventory/iocage.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-12-25 21:41:40 +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
Thomas Bechtold 65827bdc96
Drop myself from team_suse (#9259)
I no longer work with ansible and/or SUSE so drop me from the team.
2024-12-16 20:51:38 +01:00
Felix Fontein f6dae1fc4d
CI: Fix some issues pointed out by zizmor (#9250)
Fix some issues pointed out by zizmor.
2024-12-14 14:56:05 +01: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
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
IamLunchbox c38b474982
Add backup module for proxmox (#9197)
* Defined configuration variables, main backup function todo

* Defined configuration variables, main backup function todo

* wip

* permission checks and basic flow done, final request missing

* ansible-test and unit test open

* Improve documentation

* fix pep8 errors

* remove f-string and fix bugs through manual testing

* longer full example

* improve docs

* error message for fail + timeout

* move sleep location

* remove residual debugger

* include newline for better readability

* more linting errors fixed

* Include UPIDs as return value

* Output logs as comma separated value, move exception and create new abstraction for api calls

* pretter logs

* Update project to final version

* Remove accidential placeholder for integration test

* Fix missing explizit string in docstring

* Reorder imports below docstrings

* remove type annotations and fix indendation of options dict

* prettier idendation and aplhabetic ordering of options dict

* aplhabetic ordering of docstring options

* Remove the rest of type hinting as well :(

* fix version

* improve documentation

* add change detection mode

* refactor list comprehension to filter function

* remove storage availability check for node

* refactor to quotation marks

* Fix trailing newline and incorrect RV usage

* rollback filter plugin

* Remove action_group reference and add proxmox_backup to meta/runtime.yml

* Include note about missing idempotency

---------

Co-authored-by: IamLunchbox <r.grieger@hotmail.com>
2024-12-02 20:06:08 +01:00
dependabot[bot] 2a66ac719a
build(deps): bump fsfe/reuse-action from 4 to 5 (#9143)
Bumps [fsfe/reuse-action](https://github.com/fsfe/reuse-action) from 4 to 5.
- [Release notes](https://github.com/fsfe/reuse-action/releases)
- [Commits](https://github.com/fsfe/reuse-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: fsfe/reuse-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-18 19:36:38 +01:00
Björn Bösel 9fb686fe35
add plugin for generic keycloak component (#8826)
* add plugin for generic keycloak component

* add changelog fragment

* fix import in test

* Update plugins/modules/keycloak_component.py

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

* Update plugins/modules/keycloak_component.py

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

* Update plugins/modules/keycloak_component.py

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

* Update plugins/modules/keycloak_component.py

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

* set correct supported diff_mode

* fix line lenght

* Update docblock

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

* Update changelogs/fragments/8826-keycloak-component.yml

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

* Update plugins/modules/keycloak_component.py

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

* Update plugins/modules/keycloak_component.py

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

* update docblocks

* add entry to BOTMETA.yml

* update copyright

* Set Version number

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

* remove changelog fragment

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2024-10-21 20:52:28 +02:00
Connor Newton 064f76c27b
New module: Jenkins node management (#9016)
* New module: Jenkins node management

* Fix sanity errors

* (Try to) fix mock import for Python 2.7

* Remove encoding from XML tostring in hopes of appeasing py27

Default encoding is probably always good enough.

* Turns out that encoding parameter was important for python3...

It's not super obvious how to resolve in a 2 + 3 compatible way,
so branch and omit encoding for 2.

* Implement review fixes and suggestions
2024-10-19 12:51:50 +02:00
Felix Fontein 5874711c6e Fix reuse workflow branches. 2024-10-19 12:35:13 +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
alexander 3de4682193
krb_ticket: Create module (#8953)
* Add kutils module

* PR Fixes

* PR Fixes 2

* PR Fixes

* Fix executables

* Fix comment

* Fix functions

* PR Fix

* PR Fix 2

* Fix list name

* Fix list name 2

* Rever check_for_none func

* Rever check_for_none func 2

* Update tests

* Update tests 2

* Fix principal

* Fix cmdrunner args

* Fix multiline

* Fix backslash

* Fix tests

* Fix elif

* Fix bool arg

* Update doc

* Fix doc

* Add man reference

* Fix doc YAML-quoting

* PR Fixes

* Fix indent

* Fix version_added and name

* Fix units name

* Fix module name
2024-10-10 22:03:30 +02:00
Felix Fontein ec6496024f
Prepare 10.0.0 release (#8921)
* Bump version to 10.0.0, remove deprecated modules and plugins.

* Remove redhat module utils.

* Drop support for ansible-core 2.13 and ansible-core 2.14.
2024-10-07 23:37:44 +02:00
alexander 1d86d49688
ipa_getkeytab: Create module (#8938)
* Add ipa_getkeytab

* Parameters fix

* PR fixes

* PR fixes 2

* Fix unit tests

* Fix doc and unit tests

* Fix doc

* Fix doc 2

* Fix doc 3

* PR fixes

* PR fixes 2

* Fix name

* Fix description typo

* Fix variable names

* Update tests

* Add man reference
2024-10-07 22:12:06 +02:00
Alexei Znamensky c4e2b73193
cmd_runner_fmt: refactor out to its own file (#8964)
* cmd_runner_fmt: refactor out to its own file

* add new file to BOTMETA.yml

* add changelog frag
2024-10-02 21:24:24 +03:00
Felix Fontein bc6ae849b3
Move ansible-core 2.15 tests to EOL tests (#8933)
Move ansible-core 2.15 tests to EOL tests.
2024-09-26 12:14:09 +03:00
Alexei Znamensky e4472b322b
pipx/pipx_info: refactor doc fragment (#8859)
* pipx/pipx_info: refactor doc fragment

* pipx/pipx_info: refactor common options to module_utils
2024-09-14 09:27:12 +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 e3a3c6d58f
ModuleHelper guide (#8771)
* initial commit

* fix initial version

* add quickstart and high-level outline

* MH guide progress

* MH guide progress (up to params,vars,output)

* adjustments

* MH guide progress (up to handling changes)

* MH guide progress (up to Exceptions)

* typo

* change section from note to important

* MH guide progress (added StateModuleHelper)

* minor improvement

* MH guide progress (added decorators)

* typo

* minor adjustments

* remove line

* complete MH guide

* adjustments

* adjustments

* change paragraph into seealso

* rearrange sections, plus wordsmithing

* adjustments

* wordsmithing

* fix references
2024-08-21 17:52:30 +02:00
Kit Ham 2963004991
homebrew: Add support for services functions (#8329)
* Homebrew: Add support for services functions

Fixes #8286.
Add a homebrew.services module for starting and stopping services
that are attached to homebrew packages.

* Address python version compatibility

* Addressing reviewer comments

* Addressing sanity logs

* Address str format issues

* Fixing Python 2.7 syntax issues

* Test alias, BOTMETA, grammar

* Attempt to fix brew in tests

* Address comments by russoz

* Fixing more dumb typos

* Actually uninstall black

* Update version_added in plugins/modules/homebrew_services.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-08-01 17:11:23 +02:00
Thomas Bach 229ed6dad9
Add a keycloak module to query keys metadata (#8605)
* feat(keycloak): module to query keys metadata

* chore: add thomasbach-dev as maintainer in team_keycloak

* test: adding a unit test for keycloak_real_keys_metadata_info module

* fixup! feat(keycloak): module to query keys metadata
2024-08-01 17:10:11 +02:00
Ryan Cook 1a8f172186
Introduce bootc functionality (#8606)
* introduce bootc functionality

Signed-off-by: Ryan Cook <rcook@redhat.com>

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

* fix of test

Signed-off-by: Ryan Cook <rcook@redhat.com>

* switch stdout var

Signed-off-by: Ryan Cook <rcook@redhat.com>

* Feedback on NOTE format

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

* addition of trailing comma

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

* addition of trailing comma

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

* incorporating feedback from russoz

Signed-off-by: Ryan Cook <rcook@redhat.com>

* error in stdout

Signed-off-by: Ryan Cook <rcook@redhat.com>

* proper rc checking and status

Signed-off-by: Ryan Cook <rcook@redhat.com>

* linting

Signed-off-by: Ryan Cook <rcook@redhat.com>

* Update version

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

---------

Signed-off-by: Ryan Cook <rcook@redhat.com>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2024-07-27 09:37:14 +02:00
Vladimir Botka 8990f97b45
New Plugins #8594 (#8595)
* Implement #8594

* Fix lint and BOTMETA entries.

* Fix BOTMETA

* Consolidate argument check, code simplification, and formatting. Remove test vars.

* Fix lint.

* retrigger checks

* Update plugins/plugin_utils/ansible_type.py

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

* Update plugins/test/ansible_type.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-07-13 13:32:36 +02:00
Alexei Znamensky b0797d329c
CmdRunner guide (#8592)
* initial commit

* wip

* WIP

* progressing

* remove copied part

* progressing

* document as_func()

* complete docs about arg formatting

* add PythonRunner documentation

* fix markup

* improve markup

* multiple changes

- revamp the cmd_runner_fmt doc
- add CmdRunner instance and context parameters
- changed formatting of other blocks

* fix typo + reduce tables sizes

* improve text

* fixes and adjustments

* fix sanity

* fix version added
2024-07-08 09:45:24 +02:00
dependabot[bot] 45972c23d4
Bump fsfe/reuse-action from 3 to 4 (#8596)
Bumps [fsfe/reuse-action](https://github.com/fsfe/reuse-action) from 3 to 4.
- [Release notes](https://github.com/fsfe/reuse-action/releases)
- [Commits](https://github.com/fsfe/reuse-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: fsfe/reuse-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 09:11:18 +02:00
Vladimir Botka caecb2297f
Feature. Add chapter 'Lists of dictionaries' to docsite (#8482)
* Feature. Add chapter 'Lists of dictionaries'

* Fix copyright and licensing.

* Add maintainers for docsite chapter 'Lists of dictionaries'.

* Generate docs keep_keys and remove_keys

* Update integration tests of keep_keys and remove_keys
* Update docs helpers of keep_keys and remove_keys

* Fix copyright and licensing.

* Fix remove license from templates. Cleanup.

* Add docs helper replace_keys

* Update integration test filter_replace_keys
* Generate and update:
  filter_guide-abstract_informations-lists_of_dictionaries-replace_keys.rst

* Formatting improved.

* Fix results Jinja quotation marks.

* Update docs/docsite/helper/keep_keys/filter_guide-abstract_informations-lists_of_dictionaries-keep_keys.rst.j2

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

* Update docs/docsite/helper/keep_keys/filter_guide-abstract_informations-lists_of_dictionaries-keep_keys.rst.j2

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

* Fix references.

* Updated helpers.

* Fix licenses. Simplified templates.

* Fix licenses.

* Fix README.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-07-05 08:42:35 +02:00
Ilgmi 03966624ba
Consul implement agent service and check (#7989)
* Implement agent service and check (#7987)

* implement update of service and check

* update tests
update documentation

* update documentation

* add consul_agent_check/service to action_groups

check if unique_identifier of name is in params to get object

add suggested improvements

* update sanity

* fix sanity issues
update documentation

* fix naming

* fix naming

check if response_data has data

* fix sanity extra-docs

* add as ignore maintainer in BOTMETA.yml
update version_added to 8.4

* fix sanity

* add to maintainers

* Update plugins/modules/consul_agent_check.py

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

* Update plugins/modules/consul_agent_check.py

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

* Update plugins/modules/consul_agent_check.py

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

* update version_added

* if create and update return no object as result we read the object again

* get_first_appearing_identifier check the params for the given identifier and return it to simplify id vs name

* add unique_identifiers as a new property and a method to decide which identifier should be used

* fix sanity

* add self to team consul
remove params with no values
add operational_attributes that inherited classes can set them
get identifier value from object

* fix sanity
fix test

* remove the possibility to add checks with consul_agent_check.
check if service has changed

* remove tests for idempotency check because for checks it is not possible

* remove unique_identifier from consul.py
change unique_identifier to unique_identifiers

* get id from params

* Revert "remove unique_identifier from consul.py"

This reverts commit a4f0d0220dd23e95871914b152c25ff352097a2c.

* update version to 8.5

* Revert "Revert "remove unique_identifier from consul.py""

This reverts commit d2c35cf04c8aaf5f0175d772f862a796e22e35d4.

* update description
update test

* fix sanity tests

* fix sanity tests

* update documentation for agent_check

* fix line length

* add documentation

* fix sanity

* simplified check for Tcp

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

* check duration with regex

* fix

* update documentation

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2024-06-16 09:32:55 +02:00
Vladimir Botka 1d61541951
Feature filter replace_keys (#8446)
* Add filter replace_keys.

* Update examples and integration tests.

* Fix examples and copyright.

* Update documentation, examples and integration tests.

* Implement #8445. Add filter replace_keys

* Fix documentation formatting.

* Fix documentation.

* Fix type(target). Formatting improved.

* Instead of a dictionary, _keys_filter_target_dict returns a list

* No target testing in _keys_filter_params
* Interface changed _keys_filter_params(data, matching_parameter)
* If there are items with equal C(before) the B(first) one will be used.

* Update remove_keys. Interface changed _keys_filter_params(data, matching_parameter)

* The target can't be empty also in _keys_filter_target_dict

* Update plugins/filter/replace_keys.py

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

* Update plugins/filter/replace_keys.py

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

* Update plugins/filter/replace_keys.py

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

* Test attributes before and after are strings in the iteration of target.

* Update plugins/filter/replace_keys.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-06-14 21:54:58 +02:00
Alexei Znamensky c31499a411
django_check: new module (#8454)
* django_check: new module

* sanity fix

* working version

* remove unused import

* add note about the module output

* add note on module failing when rc!=0
2024-06-12 19:46:54 +02:00
Vladimir Botka 06f13e79b1
Feature filter remove_keys (#8443)
* Add filter remove_keys.

* Add filter remove_keys integration test, fragment, and maintainer.

* Update with plugins/plugin_utils/keys_filter.py

* Update according PR #8456

* Update maintainers.

* Fix typo in return doc.

* Remove local keys_filter.py. Then rebase.

* Add local keys_filter.py

* Update plugins/filter/remove_keys.py

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

* Update plugins/filter/remove_keys.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-06-06 23:34:31 +02:00
Alexei Znamensky a0ad2d5849
add docs for the vardict module utils (#8460)
* add docs for the vardict module utils

* fix var name

* add entry to BOTMETA

* rollback adjustment in deps guide

* Update docs/docsite/rst/guide_vardict.rst

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

* adjustments

* Update docs/docsite/rst/guide_vardict.rst

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-06-06 07:36:39 +02:00
Vladimir Botka 6f8f12f762
Feature filter keep_keys (#8456)
* Add filter keep_keys. Implement feature request #8438

* Fix comment indentation.

* Fix regex reference.

* Fix indentation.

* Fix isinstance list.

* Update plugins/plugin_utils/keys_filter.py

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

* Update plugins/plugin_utils/keys_filter.py

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

* Update plugins/plugin_utils/keys_filter.py

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

* Update plugins/plugin_utils/keys_filter.py

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

* Update plugins/filter/keep_keys.py

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

* Update documentation, examples, and integration tests.

* _keys_filter_target_str returns tuple of unique target strings if
target is list. Update documentation, function comments, and error
messages.

* Sort maintainers.

* Update plugins/filter/keep_keys.py

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

* Update examples with explicit collection.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-06-04 06:01:25 +02:00
Alexei Znamensky 5a5188a453
deps module_utils: add docs (#8417)
* add docs for the deps module utils

* wordsmithing

* fix reference and filename

* add entries to BOTMETA.yml

* Update docs/docsite/rst/moddev_guide_deps.rst

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

* adjust docs organisation

* adjust docs organisation II

* PR adjustments

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-06-02 00:16:53 +02:00
Alexei Znamensky 54df0c9b3a
django_createcachetable: new module (#8412)
* django_createcachetabe: new module

* add --noinput arg to testcase

* add module to BOTMETA

* rename module class name

* fix examples documentation

* remove unused config

* adjust version_added
2024-06-01 22:45:17 +02:00
kurokobo bb73f28bf5
feat: implement timestamp callback plugin to show simple timestamp for each header (#8308)
* feat: add community.general.timestamp callback plugin

* feat: add minimal integration tests for timestamp callback plugin

* feat: add maintainers for timestamp callback plugin

* fix: correct license

* fix: remove type annotation for the older python environment

* fix: remove unnecessary comment

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

* fix: add trailing period

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

* fix: split long description into list

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

* fix: remove default and add type

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

* fix; add type

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

* fix: split long description into list

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

* fix: improve description for format_string to describe usable format codes

* fix: clarify the original codes and add copyright from that

* fix: shorten long lines

* fix: correct link format

* fix: add seealso section

* fix: add ignore entries for EOL CI

* fix: update seealso to correctly associate with related plugin

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-05-18 15:41:34 +02:00
Alexei Znamensky 1ac94b5f44
Initial commit for django modutils and django_command module (#8349)
* Initial commit for django modutils and django_command module

* Fixed sanity, param settings required

* add stdout, stderr and cmd to django module output

* add examples and return docs to djando_command module

* multiple minor adjustments

* fix typo

* Update plugins/modules/django_command.py

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

* Update plugins/modules/django_command.py

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

* Update plugins/modules/django_command.py

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

* move note to seealso

* add xfailing test

* Update plugins/doc_fragments/django.py

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

* Update plugins/doc_fragments/django.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-05-15 18:51:42 +02:00
Felix Fontein b774435d8d
Pass codecov token to ansible-test-gh-action (#8341)
Pass codecov token to ansible-test-gh-action.
2024-05-11 21:29:37 +02:00
Thomas Sjögren d347bf5fa0
add systemd run0 as a become method (#8306)
* add systemd run0 as a become method

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

* add fragment

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

* remove space after hyphen

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

* replace ansible with collection version

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

* update version_added and remove changelog fragment

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

* update formating

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

* add types

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

* slim super()

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

* imports must appear below docs

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

* add initial unit test

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

* update unit tests

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

---------

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2024-05-11 16:53:44 +02:00
Alexei Znamensky 7051fe3449
PythonRunner: a command runner for python (#8289)
* PythonRunner: a command runner for python

* add changelog frag

* Update changelogs/fragments/8289-python-runner.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-04-29 17:26:14 +02:00
Felix Fontein be3b66c8b5
[9.0.0] Remove deprecated modules and features (#8198)
* Remove deprecated modules.

* Update BOTMETA.

* Update ignore.txt files.

* Bump collection version to 9.0.0.

* Change timeout from 10 to 60.

* Remove the alias autosubscribe of auto_attach.

* Change default of mode from compatibility to new.

* Remove deprecated classes.

* Remove mh.mixins.deps.DependencyMixin.

* Remove flowdock module.

* Remove proxmox_default_behavior option.

* Remove ack_* options.

* Remove deprecated command support.

* Change virtualenv behavior.

* Fix changelog.

* Remove imports of deprecated (and now removed) code.

* Fix tests.

* Fix sanity tests.

* Require Django 4.1.

* Use V() instead of C() for values.

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

* django_manage: improve docs for release 9.0.0

* markup

* fix doc notes in cpanm

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Alexei Znamensky <russoz@gmail.com>
2024-04-22 18:28:22 +02:00
desand01 a5697da29c
Keycloak client role scope (#8252)
* first commit

* minor update

* fixe Copyright

* fixe sanity

* Update plugins/modules/keycloak_client_rolescope.py

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

* fixe sanity 2

* Update plugins/modules/keycloak_client_rolescope.py

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-04-21 20:10:03 +02:00
Felix Fontein 7fd37ea247
inventory plugins: make wrapping variables as unsafe smarter to avoid triggering an AWX bug (#8225)
Make wrapping variables as unsafe smarter to avoid triggering an AWX bug.
2024-04-20 09:39:42 +02:00
Felix Fontein 48b5a7a80a
CI: add stable-2.17, bump devel to 2.18, move stable-2.14 from AZP to GHA (#8179)
* Add stable-2.17 to CI; add ignores for 2.18.

* Move stable-2.14 tests to GHA.

* Update README.
2024-04-03 07:57:25 +02:00
Maxopoly 6298ad4faa
Implement usb_facts module (#8076)
* First implementation of usb module

* Rename to usb_facts

* Working tests

* Appease linter

* Fix author

* Remove splitlines arg for python 2.7 compat

* indent usb test further

* indent usb test a bit less

* Remove trailing whitespace

* Update plugins/modules/usb_facts.py

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

* Update plugins/modules/usb_facts.py

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

* Apply suggestions from code review

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

* Adjust usb_facts PR based on feedback

* Add usage example and extend correct documentation fragment

* Add myself to BOTMETA.yml

* Apply suggestions from code review

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-03-18 21:35:36 +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
dependabot[bot] 98df344017
Bump fsfe/reuse-action from 2 to 3 (#8058)
Bumps [fsfe/reuse-action](https://github.com/fsfe/reuse-action) from 2 to 3.
- [Release notes](https://github.com/fsfe/reuse-action/releases)
- [Commits](https://github.com/fsfe/reuse-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: fsfe/reuse-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-04 19:40:46 +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