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

298 commits

Author SHA1 Message Date
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
Alexei Znamensky
da2c87ce0d
fix test helper handling of rc (#8387)
* fix test helper handling of rc

* fix side_effect logic for rc != 0

* fix side_effect func + sanity tests

* fix ignore files

* fix code

* revamp the generator for run_command calls returns in testcase

* remove unused import

* Update tests/sanity/ignore-2.18.txt

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

* Update tests/sanity/ignore-2.17.txt

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-05-24 21:59:00 +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
Kit Ham
3b7f13c58e
homebrew: Move repeated logic from homebrew modules into module_utils (#8324)
* gomebrew: Move repeated logic from homebrew modules into module_utils

Fixes #8323.

* ghangelog + unit test improvement

* Update changelogs/fragments/8323-refactor-homebrew-logic-module-utils.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-05-11 16:52:43 +02:00
John Bond
d75dee3230
8281: puppet waitforlock (#8282)
puppet waitforlock

Add support for the waitforlock[1] puppet argument

[1]https://www.puppet.com/docs/puppet/8/configuration#maxwaitforlock
Co-authored-by: Felix Fontein <felix@fontein.de>
2024-05-04 15:26:56 +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
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
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
Parsa Yousefi
31de16cee3
ipa_otptoken: fix wrong return value string to bool (#7795)
ipa_data is return ipatokendisable in boolean format and the module expects it as a string
this behavior causes a lack of idempotency and the get_diff module will fail in the second run.
2024-01-16 22:14:26 +01:00
Parsa Yousefi
6afe35d263
ipa: ipa_pwpolicy update pwpolicy module (#7723)
* ipa: ipa_pwpolicy support maxrepeat, maxsequence, dictcheck, usercheck, gracelimit

* ipa: ipa_pwdpolicy replace if statements with for loop

* ipa: ipa_pwdpolicy add changelog
2023-12-31 15:21:59 +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
Andrew Hyatt
acc3173030
Add dnf_config_manager module (#7745)
* Add dnf_config_manager module

* add BOTMETA

* document return values

* improve error messages

* fix doc indent

* make regexes raw strings

* formatting improve

* fix indent

* update version_added

* Tweaks from feedback and unit testing

* fix copyright and python2.7

* remove shebang

* documentation updates

* Change return values to not have varying keys

* sort returned lists
2023-12-29 09:42:02 +01:00
castorsky
68051774d8
[proxmox_vm_info] Add ability to retrieve config (#7485)
* feat: add ability to retrieve config

Light refactor of get_vms_from_nodes function.
Added ability to retrieve configuration for existing machines (current or pending).

* Add changelog fragment

* Add changelog fragment (newline missed)

* Update changelogs/fragments/7485-proxmox_vm_info-config.yml

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

* Apply suggestions from code review

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

* Replaced two bool options with one three-state option

* Module args for the three-state option

* Remove trailing newline

* Make use of dict instead of list. Fix uncalled 'get config for lxc'.

* Sanity tests

* A couple of unit tests fixed

* Unit tests fixed

* Unit tests for p2.7 fixed. Test for config parameter added.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-04 05:59:21 +01:00
apecnascimento
88d2a3a1fb
Feat nomad token module (#7523)
* Add nomad_token module

* Updatate nomad maintainers list

* Fix Example docstring

* Fix identations and Flake8 rules

* Fix  trailing whitespace

* Fix SyntaxError error

* change stringh format

* Fix Return doc string

* Fix Examples

* Fix flake8  rule W293

* Fix Doc schema

* Fix argument_spec

* Add maintainer

* Fix Example doc

* Remove token_info

* Change Doc

* Change nomad api acl token link

* Remove return whitespace

* Update plugins/modules/nomad_token.py

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

* Update plugins/modules/nomad_token.py

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

* Update plugins/modules/nomad_token.py

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

* Update plugins/modules/nomad_token.py

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

* Update plugins/modules/nomad_token.py

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

* Update plugins/modules/nomad_token.py

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

* Update plugins/modules/nomad_token.py

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

* Fix add changed state to True

* Update plugins/modules/nomad_token.py

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

* Change suport check mode

* Add unity tests

* Remove unused import

* Remove tests unused import

* Change python-nomad versions

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

* Change acl for ACL

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

* Add ACL to all docs

* Change msg to ansible common return value

* Fix flake8 W291

* Update description.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-03 13:51:39 +01:00
Pino Toscano
af01b462d5
redhat_subscription: use D-Bus registration on RHEL 7 only on 7.4+ (#7624)
subscription-manager does not provide a D-Bus interface in versions of
RHEL 7 older than 7.4.
2023-11-30 05:58:07 +01:00
Boolman
938aec492e
[keycloak_user_federation]: Adding option krbPrincipalAttribute (#7538)
* keycloak_user_federation: Adding support for krbPrincipalAttribute

Signed-off-by: boolman <boolman@gmail.com>

* pr/7538 adding changelogs/fragment file

Signed-off-by: boolman <boolman@gmail.com>

* Update changelogs/fragments/7538-add-krbprincipalattribute-option.yml

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

* Update plugins/modules/keycloak_user_federation.py

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

* Update plugins/modules/keycloak_user_federation.py

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

---------

Signed-off-by: boolman <boolman@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-26 17:20:05 +01:00
Alex Groshev
5147c49498
Add support for loopback type in nmcli module (#7515)
* add support for loopback devices

* add support for loopback devices

* fix yamllint issue in changelog fragment

* Fix yamlint warning and add note about new connectin type in docs

* change order of lines in documentation so they are sorted
2023-11-22 09:11:40 +01:00
Alexei Znamensky
9b16392648
test helper: Helper.from_module() injects test function into test module (#7560) 2023-11-20 23:23:16 +13:00
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
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
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
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
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
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
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
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
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
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
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
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
5988b9acea
npm: changed to cmdrunner (#6989)
* npm: refactor to use CmdRunner

- initial commit, not working

* better handling of parameter "production"

* add changelog frag

* fixed command call and tests

* removed extraneous commented debug code
2023-08-12 09:57:49 +02:00
Felix Fontein
a8809401ee
Avoid direct type comparisons (#7085)
Avoid direct type comparisons.
2023-08-11 09:00:54 +02:00
Sergei Antipov
2089769ccc
[proxmox_vm_info] Return empty list when requested VM doesn't exist (#7049)
* [proxmox_vm_info] Return empty list when requested VM doesn't exist

* Update documentation

* Add changelog fragment

* Address review comments

* Allow to filter by empty name

* Update plugins/modules/proxmox_vm_info.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-08-09 16:12:31 +02:00
Sergei Antipov
d7c1a814ea
[proxmox_vm_info] Re-use cluster resources API to use module without requiring node param (#6976)
* [proxmox_vm_info] Re-use cluster resources API to use module without requiring node param

* More consife if

* Fix use case when requesting all vms from specific node

* Add changelog fragment
2023-07-23 21:32:34 +02:00
Sergei Antipov
f9448574bd
[proxmox_kvm] Don't create VM if name is used without vmid (#6981)
* [proxmox_kvm] Don't create VM if name is used without vmid

* Add changelog and unit tests
2023-07-23 21:31:57 +02:00
Alexei Znamensky
ea6fb9da8f
snap: add param "dangerous" (#6908)
* snap: add param "dangerous"

* adjusted run_command out for simple test case

* add changelog frag
2023-07-15 12:54:39 +02:00