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

928 commits

Author SHA1 Message Date
Alexei Znamensky
fc817601bc
django_manage: add extra tests (#5476) 2022-11-06 11:38:38 +01:00
Sam Doran
be0b5e5f8c
onepassword - Support v2 (#4728)
* Begin building out separate classes to support  different op cli versions

Create separet base classes for each major version.
Define the main interface in the base class.
Create methods for getting the current version and instantiating the
appropriate class based on the found version.

* First pass at mostly working CLI version classes

* Correct mismathched parameters

* Update _run() method to allow updating enviroment

This allows passing in the app secret as an env var, which is more
secure than using a command line arg.

* Continuing to improve the interface

* Tear existing tests down to the studs

These tests were based off of the LastPass unit tests. I’m going to
just start from scratch given the new plugin code is vastly diffenent.

* Fix sanity test

* CLI config file path can be None

* Improve required param checking

- only report missing params
- use proper grammer based on number of missing params

* Change assert_logged_in() method return value

Return a boolean value indicating whether or not account is signed in

* Improve full login for v2

Have to do a bit of a dance to avoid hitting the interactive prompt
if there are no accounts configured.

* Remove unused methods

* Add some tests

* Fix linting errors

* Move fixtures to separate file

* Restructure mock test data and add more tests

* Add boilerplate

* Add test scenario for op v2 and increase coverage

* Fix up copyright statements

* Test v1 and v2 in all cases

* Use a more descriptive variable name

* Use docstrings rather than pass in abstract class

This adds coverage to abstract methods with the least amount of hackery.

* Increase test coverage for CLI classes

* Sort test parameters to avoid collection errors

* Update version tested in docs

* Revere test parameter sorting for now

The parameters need to be sorted to avoid the issue in older Python
versions in CI, but I’m having trouble working out how to do that
currently.

* Allow passing kwargs to the lookup module under test

* Favor label over id for v2 when looking for values

Add tests

* Display a warning for section on op v2 or greater

There is no “value” in section fields. If we wanted to support sections
in v2, we would also have to allow specifying the field name in
order to override “value”.

* Move test cases to their own file

Getting a bit unwieldy having it in the test file

* Move output into JSON files fore easier reuse

* Switch to using get_options()

* Add licenses for fixture files

* Use get_option() since get_options() was added in Ansible Core 2.12

* Rearrange fixtures

* Add changelog

* Move common classes to module_utils

* Move common classes back to lookup

The plugin relies on AnsibleLookupError() quite a bit which is not available
in module code.

Remove use of display for errors since section isn’t actually deprecated.

* Properly handle sections

Still room for improvement, but this is at least a start.

* Remove some comments that won’t be addressed

* Make test gathering more deterministic to avoid failures

* Update changelog fragment

* Simple fix for making tests reliable
2022-11-06 11:32:35 +01:00
Guillaume MARTINEZ
1e17ec13b8
[Scaleway] Add module to manage container namespaces (#5416)
* [Scaleway] Add module to manage container namespaces

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* Fix CI

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix botmeta

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix typo in loop var name

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* Add missing required lib check

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix integration tests assertions

Signed-off-by: Lunik <lunik@tiwabbit.fr>

Signed-off-by: Lunik <lunik@tiwabbit.fr>
2022-11-05 20:44:33 +00:00
Guillaume MARTINEZ
db7e5f12f5
[Scaleway] Add module to manage functions (#5463)
* [Scaleway] Add module to manage function

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix integration tests assertions

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* Update plugins/modules/scaleway_function.py

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

Signed-off-by: Lunik <lunik@tiwabbit.fr>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-05 20:43:47 +00:00
Alexei Znamensky
8dc82b1890
sorted content of sanity/ignore-*.txt files (#5473) 2022-11-05 11:35:39 +01:00
Guillaume MARTINEZ
c181f2dd08
[Scaleway] Fix function namespace integration tests assertions (#5464)
Signed-off-by: Lunik <lunik@tiwabbit.fr>

Signed-off-by: Lunik <lunik@tiwabbit.fr>
2022-11-03 06:45:37 +01:00
Felix Fontein
b531ecdc9b
Unflatmap community.general (#5461)
* Move files.

* Update imports and references.

* Move wrongly placed files.

* Reverse redirects, deprecate long → short name redirects.

* Simplify contribution guidelines for new modules.

* Rewrite BOTMETA.

* Add changelog fragment.

* Fix ignore.txt files.
2022-11-02 20:42:29 +00:00
Felix Fontein
faf4ec7fa6
passwordstore lookup: allow to pass options as lookup options (#5444)
* Allow to pass options as lookup options.

* Adjust tests.
2022-11-02 20:17:08 +01:00
Guillaume MARTINEZ
5fe0f57033
[Scaleway] Add module to manage function namespaces (#5415)
* [Scaleway] Add module to manage function namespaces

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* rename short_descriptions

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* handle changed verification on hashed secret values

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix syntax for python 2.6

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix missing argon2 in unittest

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix missing value on description field

Signed-off-by: Lunik <lunik@tiwabbit.fr>

Signed-off-by: Lunik <lunik@tiwabbit.fr>
2022-11-02 20:11:04 +01:00
Felix Fontein
e718bd8445
Lookups: use Ansible's config manager whenever possible (#5440)
* Start using Ansible's config manager to handle options.

* Docs improvements.

* Fix documentation, make options actual lookup options.

* The cyberarkpassword lookup does too strange things.

* The onepassword lookups are converted in #4728, let's not interfere.

* Improve docs.

* Skip shelvefile as well.

* Convert lmdb_kv.

* Convert and fix credstash.

* Convert manifold.

* Drop chef_databag.

* Convert dig.

* Update examples.

* Forgot the most important part.

* Fix lmdb_kv docs.

* Python 2.6 compatibility.

* Convert AnsibleUnicode to str.

* Load lookup with lookup loader.

* Fix environment handling and error message checking.

* Improve docs formatting.
2022-11-01 21:58:46 +01:00
Alex Groshev
dc66aefa40
fix int options idempotence bug and add new test to check it (#5443) 2022-11-01 21:40:17 +01:00
Felix Fontein
5f4e593116 Revert "Fix non-matching defaults in docs (#5446)"
This reverts commit a978bff2c7.
2022-11-01 19:12:21 +01:00
Felix Fontein
a978bff2c7
Fix non-matching defaults in docs (#5446)
* Allow to pass options as lookup options.

* Adjust tests.

* Fix non-matching defaults.
2022-11-01 18:11:02 +01:00
Brian Coca
20b84fc709
linnode inventory, remove redundant (#5438)
* remove redundant

templar is already in base class
env var is already consulted in via config resolution

* more whites

* no need to import templar again

* Add changelog fragment.

* Try to update tests.

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-01 07:33:43 +01:00
Felix Fontein
a1f75efee2
Fix iso_customize tests. (#5447) 2022-10-31 21:15:03 +01:00
Felix Fontein
fa924aae31
Prepare un-flatmapping (#5350)
* Add module name into fixtures directory name.

* Rename conftest.py to avoid collisions.

* Match filenames inside directories.
2022-10-26 07:32:00 +02:00
Felix Fontein
2830a3452d
Remove deprecated features, bump version to 6.0.0 (#5326)
* Bump version to 6.0.0.

* sender option is now required.

* Default of want_proxmox_nodes_ansible_host changed from true to false.

* username is now an alias of user, and no longer of workspace.

* Remove deprecated return values in favor of end_state.

* Remove debug option.

* Change default of ignore_volatile_options from true to false.

* gitlab_group must now always contain the full path.

* Change default of norc from false to ture.

* Remove deprecated property.

* Add PR URL.

* Adjust bitbucket unit tests.

* Adjust module_helper integration test.
2022-10-25 08:07:21 +02:00
Guillaume MARTINEZ
2680739153
[Scaleway] Add module to manage container registries (#5399)
* [Scaleway] Add module to manage container registries

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* first review

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* lint documentation on return value

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* second review

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* second review *bis

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* second review *ter

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* Fix typo.

Signed-off-by: Lunik <lunik@tiwabbit.fr>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-10-23 17:18:06 +02:00
Alexei Znamensky
baa8bd52ab
pkgng: fix error-handling when upgrading all (#5369)
* pkgng: fix error-handling when upgrading all

* provide for rc=1 in check_mode + test

* fix name of task in test

* add changelog fragment
2022-10-23 11:42:53 +02:00
ThomasGebert
b54483b52e
nmcli: add transport_mode configuration for Infiniband devices (#5361)
* Adds transport_mode configuration for Infiniband devices

Adds transport_mode configuration for Infiniband based ipoib devices,
which is one of:
  - datagram (default)
  - connected

* Remove trailing whitespace

* Add changelog fragment

* Update changelogs/fragments/5361-nmcli-add-infiniband-transport-mode.yaml

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

* Update plugins/modules/net_tools/nmcli.py

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

* Update plugins/modules/net_tools/nmcli.py

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

* Remove default for transport_mode

* Add test for changing Infiniband transport_mode

* remove blank line at end of file

Co-authored-by: Thomas Gebert <thomas.gebert@atos.net>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-10-23 11:30:48 +02:00
Felix Fontein
5aa1e58749
Do not crash when lzma is not around. (#5393) 2022-10-20 20:32:18 +02:00
Alexei Znamensky
6f88426cf1
lxc_container: minor refactor (#5358)
* lxc_container: minor refactor

* add changelog fragment
2022-10-14 22:28:20 +02:00
Felix Fontein
e47845ab3a
Change CI group identifiers. (#5344) 2022-10-11 07:34:36 +02:00
Yuhua Zou
d76392ed2a
New module: iso_customize (#5190)
* add ansible module iso_customize.py

* rerun CI testing due to "Failed to send request to https://api.github.com/repos/ansible/ansible/issues/23642: HTTP Error 403: rate limit exceeded"

* Rerun CI testing due to "Failed to send request to https://api.github....."

* rerun CI testing due to failure "Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/v2/collections/netbox/netbox/versions/3.1.0/': The read operation timed out"

* change document part as  felixfontein's careful review

* modify test file as russoz's comments

* modify comment part of module

* add comment for the example

* add more tests: check the files are deleted / added in customized ISO

* fix it: failed to run ansible.posix.mount in ubuntu

* fix it:  ansible.posix.mount is not working well in some OS.

* change DOCUMENTATION part

* change files according to the comment from code review

* fix issue: E231: missing whitespace after ':'

* modify the description of Document

* modify code for code review

* delete extra blank line in yml file

* Try to fix CI testing issue: "Caught \"'foo' is undefined. 'foo' is undefined\" while evaluating 'b' with item == {'a': 1}"

* delete extra blank line in the end of file

* change code as the comment from code review

* change code from code review

* change type: str to type: path

* change type:str to type:path

* delete unused variable

* fix CI testing error: return-syntax-error: RETURN.dest_iso.type: not a valid value for dictionary value @ data['dest_iso']['type']. Got 'path'

* add testcase: test add files / delete files separately

* add more testcases: test if we can catch exception from error input of users

* change code from code review

* fix issue: E231: missing whitespace after ','

* change code from code review

* add notes to document

* modify notes in document part

* /rebuild_failed

/rebuild_failed

* Try to support running testcases not only in MAC but also in other OS.

* modify document

* change mount to ansible.posix.mount

* skip the test platform which report "Error mounting"

* fix mount failed: Operation not permitted

* change code from code review

* change document from code review

* fix CI testing issue in some platforms

* Update plugins/modules/files/iso_customize.py

* change code from code review

1) change testcase
2) try to fix "mount: not permitted"

* modify aliases file

* change document and rerun CI testing

* add skip/docker as suggested

* add debug task

* fix issue in redhat 7.9: occurred while running the lookup plugin 'file'. ..could not locate file in lookup..

* change code from the code review

* modify function "iso_rr_check_file_exist" to "iso_check_file_exists" to make it works in all types of ISO

1. modify function "iso_rr_check_file_exist" to "iso_check_file_exists" to make it works in all types of ISO

2. run main.yml  with newer python 3.10.6
ansible [core 2.13.4]
  config file = None
  configured module search path = ['/Users/zouy/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/6.4.0/libexec/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/zouy/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.6 (main, Aug 30 2022, 05:12:36) [Clang 13.1.6 (clang-1316.0.21.2.5)]
  jinja version = 3.1.2
  libyaml = True

* delete blank

* simply the code as suggested.

* Two small docs updates.

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-10-10 22:41:04 +02:00
Victor Martinez
8c04133284
opentelemetry: send logs (#4175)
* opentelemetry: logs property

* opentelemetry: support for span events with the Task dump output

* opentelemetry: support property to disable the logs

* bump the version when supported

* add section ini

* test: fix change of signature

* [opentelemetry][callback] changelog fragment

* Apply suggestions from code review

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-10-10 20:54:52 +02:00
manschwetusCS
dc2d3c24fa
Make pfexec become usable for illumos (#3889)
* Experimental change from OpenIndiana

* resolve pfexec problem, by removing superfluous quotes

* reimplement "wrap_exe"

* remove spaces arround keyword argument assignment

* adapted pfexec unit test

* Try to fix quoting of test expression

* Fix quoting of test expression by replacing ' with "

* Add changelog fragment
2022-10-05 08:26:40 +02:00
Kosala Atapattu
beef93f687
Allow terraform module to specify complex variable structures (#4797)
* Adding capability to specify complex variables type to terraform

* Terrform variable types are mapped to ansible veriable types

* Currently handles Dict, List, Str, Int, Bool types

* Updated the documentation accordingly

* Updated with an example.

* Update plugins/modules/cloud/misc/terraform.py

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

* Update plugins/modules/cloud/misc/terraform.py

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

* Update plugins/modules/cloud/misc/terraform.py

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

* Update plugins/modules/cloud/misc/terraform.py

Wonder how that missed the PEP8 checks :).

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

* Update plugins/modules/cloud/misc/terraform.py

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

* Adding the changelog fragment

* Update plugins/modules/cloud/misc/terraform.py

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

* Adding ``integer_types`` from ``module_utils``

Simplified the ``integer_types``,  ``str`` and ``float`` value population through ``json.dumps()``.  Now the strings can have special characters which can break the module execution.

* Update changelogs/fragments/4797-terraform-complex-variables.yml

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

* * Changed to approach to make the code more readble and simple to understand.

    * Maintaining the original for loop for the top_level variables. Therefore the rocess_conplex_args() now only handle second level variables when the type() is either Dict or List.

    * Json dumps are used only for the low level variables. Terraform CLI had issues interpreting escape sequecences from json.dumps()

* Update plugins/modules/cloud/misc/terraform.py

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

* adding boolean explicitly, although boolean is a subclass of integer, adding this for self documentation pupose and the clarity of the code.

* fixing the doc strings

* Update terraform.py

Fixing docstrings

* * Introducing format_args funtion to simplify formatting each argument type for top_level and lower level.

* Terraform Lists of strings, numbers, objects and lists are supported.

* Adding COMMAND: to the fail_json msg, for plan failures to help troubleshoot command line arguments.

* Update plugins/modules/cloud/misc/terraform.py

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

* * Adding full terraform command to fail_json() when the terrafor plan fails
    * Fixing a spelling mistake.

* plan_command if a list, stringifying the list

* * Fixing the new line for the change fragments

* Removed CR (\r) from the output messages. Now output lines carry only LF (\n), not CRLF (\r\n).

* Added integration testing for complex variables.

* Restructured integration testing code to be more expandable.

* Update changelogs/fragments/4797-terraform-complex-variables.yml

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

* Update plugins/modules/cloud/misc/terraform.py

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

* double-quotes are not properly escaped in shell, and python string
escaping are nullified the way terraform handle second tier string
variables (within terraform).

* changing all the task actions to FQCN format.

* integration testing now includes:

1. Top level strings containing, special shell characters, spaces,
   double-quotes.

2. Second level strings containing, special shell characters, spaces,
   double-quotes repeating double-quotes to ensure proper regex
substitution.

* Adding colon ':' to string test casses.

* Added complex_vars to switch between the old and the new variable
interpretations.
Updated the documentations to reflect the changes.
Updated the examples.
Handling '\' as well with the escape sequence.

* Added tests for the new escape sequences.
Added multilines tests.

* Restructuring the documente strings to a shorter string.
Argument_spec changed to 'bool'

* Update changelogs/fragments/4797-terraform-complex-variables.yml

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

* Update plugins/modules/cloud/misc/terraform.py

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

* Update plugins/modules/cloud/misc/terraform.py

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

* Update plugins/modules/cloud/misc/terraform.py

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

* Update plugins/modules/cloud/misc/terraform.py

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

* Update plugins/modules/cloud/misc/terraform.py

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

* Update plugins/modules/cloud/misc/terraform.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-10-03 22:10:16 +02:00
bratwurzt
2cac3ae879
New Module: Keycloak User Rolemapping (#4898)
* keycloak_user_rolemapping: implement user role mapping

* keycloak_user_rolemapping: additional logging

* keycloak_user_rolemapping: move to getters, use names parameters

* keycloak_user_rolemapping: add service account user example

* Add keyring and keyring_info modules (#4764)

* keycloak_user_rolemapping: write tests, address ansibullbot concerns no.1

* keycloak_user_rolemapping: address felixfontein concerns no.1

* keycloak_user_rolemapping: remove rebase mistakes

* keycloak_user_rolemapping: address felixfontein concerns no.2

* keycloak_user_rolemapping: refactor duplicate username usage example

* keycloak_user_rolemapping: fix sanity check errors no.1

* keycloak_user_rolemapping: fix sanity check errors no.2

* keycloak_user_rolemapping: fix sanity check errors no.3

* keycloak_user_rolemapping: fix sanity check errors no.4

* keycloak_user_rolemapping: write tests, address ansibullbot concerns no.1

* keycloak_user_rolemapping: resolve rebase conflicts with origin/main branch

# Conflicts:
#	plugins/module_utils/identity/keycloak/keycloak.py

* keycloak_user_rolemapping: remove keycloak_role_composites from BOTMETA.yml

* keycloak_user_rolemapping: fix sanity check errors no.5

* keycloak_user_rolemapping: address felixfontein reviews concerns no.1

* keycloak_user_rolemapping: address felixfontein reviews concerns no.2

Co-authored-by: Dušan Markovič <dusan.markovic@better.care>
Co-authored-by: ahussey-redhat <93101976+ahussey-redhat@users.noreply.github.com>
2022-10-01 18:16:47 +02:00
Alexei Znamensky
f0ee21b8b2
ini_file: fix lint error (#5307)
* ini_file: fix lint error

* add changelog fragment

* remove line from sanity test ignore files
2022-09-25 16:28:06 +02:00
Felix Fontein
a938c9de65
Add stable-2.14 to CI, adjust to devel version bump (#5298)
* Add stable-2.14 to CI, adjust to devel version bump.

* Thin out matrix a bit.
2022-09-21 07:58:52 +02:00
castorsky
7777b48c99
New module: Proxmox disk management (#5101)
* New module: Proxmox disk management

* Remove misplaced option

* Type missed

* Fixed docs, quotes, 2.7 syntax

* Forgotten comma

* Version added 5.5.0

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

* Italic options

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

* Missed dot

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

* Pythonify python

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

* Shorten command

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

* Action parameter drop. General improvements.

* Add proxmox_disk integration testing

* Shorten getting vmid

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

* Code tag for value

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

* Italic tag for option

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

* Definite ID of the VM

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

* Docs edit and loop condition

* Simplify conditions

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

* Dropped bps options, added idempotency checks

* Documentaion edit

* Rewrite create/import condition

* Trainling comma

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

* Added type field to all choosable arguments

* Description of disk bus ranges

* Fix imports

* Update version

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

* Lowercase YAML boolean

* Rename grown to resized and update documentation

* Documentation updated before actual changes

* Added 'update' flag for 'present' state

* Traling space

* YAML indentation

* Merged 'updated' option into 'present'.

* Doc update.

* Exclude 'import_from' on update

* Version bump

* yaml boolean lowercase

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

* yaml boolean lowercase

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

* More detailed description

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

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-09-18 22:06:21 +02:00
Felix Fontein
b371bd6a5b
Fix pkgng tests (#5266)
* Now there are problems with 13.0 as well. But maybe 13.1 works again?

* 13.1 still does not work, maybe 13.2 will (not yet available in CI)...
2022-09-10 11:29:19 +02:00
Felix Fontein
dde0b55f1a
Restrict Python packages for nomad tests. (#5262) 2022-09-10 11:08:13 +02:00
Chih-Hsuan Yen
946c48d148
nmcli: honor IP options for VPNs (#5228)
* nmcli: honor IP options for VPNs

This can be used for split tunneling - I extended a test as an example.

* Add changelog
2022-09-08 07:44:54 +02:00
Mike Moerk
2a449eb163
WDC Redfish support for setting the power mode. (#5145)
* WDC Redfish support for setting the power mode.

* Apply suggestions from code review

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

* Add change fragment.

* Add extension to changelog fragment.

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-09-03 12:45:03 +02:00
Chih-Hsuan Yen
6ff594b524
nmcli: avoid changed status for most cases with VPN connections (#5126)
* nmcli: avoid changed status for most cases with VPN connections

Follow-up https://github.com/ansible-collections/community.general/pull/4746

* `nmcli connection show` includes vpn.service-type but not vpn-type.
  Switching to vpn.service-type removes unneeded diffs while keeping
  the same functionality, as vpn-type is an alias of vpn.service-type
  per nm-settings-nmcli(1).

  NetworkManager also adds `org.freedesktop.NetworkManager.` prefix for
  known VPN types [1]. The logic is non-trivial so I didn't implement it
  in this commit. If a user specifies `service-type: l2tp`, changed will
  be always be True:

    -    "vpn.service-type": "org.freedesktop.NetworkManager.l2tp"
    +    "vpn.service-type": "l2tp"

* The vpn.data field from `nmcli connection show` is sorted by keys and
  there are spaces around equal signs. I added codes for parsing such
  data.

Tests are also updated to match outputs of nmcli commands.

[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/1.38.4/src/libnm-core-impl/nm-vpn-plugin-info.c#L619

* Add changelog

* Some suggested changes

* Make space stripping more flexible - works for cases without equal
  signs.
* Keep vpn.data in a test case with no spaces

* nmcli: allow any string for vpn service-type
2022-09-03 12:02:03 +02:00
Alexei Znamensky
7ffe6539c0
New module: pipx_info (#5196)
* pipx_info: new module

* pipx_info: add integration tests

* ensure apps are uninstalled after tests

* Update plugins/modules/packaging/language/pipx_info.py

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

* rework module output, add docs

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-09-03 12:00:04 +02:00
Felix Fontein
fa49051912
Catch more broader error messages. (#5212) 2022-09-03 11:25:41 +02:00
Felix Fontein
8e59e52525
[TEMP] Fix RHEL 8 issues by restricting bcrypt to < 4.0.0 (#5183) 2022-08-25 07:30:28 +02:00
Felix Fontein
8027bc5335
filesystem: create temp directory outside /tmp to avoid problems with tmpfs. (#5182) 2022-08-25 06:43:07 +02:00
Julien Riou
8e9ec610c3
feat: Add crc32 filter (#5062)
* feat: Add crc32 filter

Compute CRC32 checksum of a string and return its hex representation. Can be
use to create short checksums.

Signed-off-by: Julien Riou <julien@riou.xyz>

* Update license lines

* Improve string check of a crc32 value

Signed-off-by: Julien Riou <julien@riou.xyz>

Signed-off-by: Julien Riou <julien@riou.xyz>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-21 12:10:31 +02:00
Felix Fontein
02d9a1de9e
Make reuse conformant (#5138)
* Add .license files.

* Add reuse test.

* Update README.

* Also remove .yaml changelog fragments.

* Add changelog fragment.

* Normalize licenses extra sanity test.

* Declare REUSE conformance.

* Update README.md
2022-08-21 08:27:01 +02:00
Michal Hybner
3c2d7eb193
dig: Fix evaluation of boolean parameters (#5129)
* Add lookup_dig tests

* Fix boolean evaluation

* Add changelog fragment

* Apply review changes

* Add license
2022-08-20 14:31:15 +02:00
Felix Fontein
98ea27847f
Increase xfs size to 300 MB. This seems to be new minimal size. (#5133) 2022-08-20 13:42:45 +02:00
Alexei Znamensky
3c960ac620
pipx: add state latest (#5105)
* pipx: add state latest

* add changelog fragment

* Update plugins/modules/packaging/language/pipx.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-18 06:44:18 +02:00
Felix Fontein
c8925058aa
Update copyright statements. (#5106) 2022-08-13 16:56:40 +02:00
Felix Fontein
3dcff121c4
Try to install virtualenv via pip on Arch. (#5116)
ci_complete
2022-08-13 12:08:07 +02:00
Felix Fontein
a54af8909c
Fix linting errors; fix some real bugs (#5111)
* Fix linting errors.

* Fix bugs.

* Another linter error ignored.

* More fixes.

* Ignore sanity errors with older versions.

ci_complete

* Forgot to commit more changes.
2022-08-12 11:07:30 +02:00
Alexei Znamensky
83317419d7
pipx: add required_if fo upgrade and reinstall (#5100)
* pipx: add required_if for upgrade and reinstall

* add changelog fragment
2022-08-09 10:15:51 +02:00
Felix Fontein
aab22e7f32
Add remaining copyright statements, add licenses sanity test (#5098)
* Add sanity test (currently fails).

* doc_fragments can also be non-GPLv3+.

* Replace 'Author:' by 'Copyright:' in some specific cases.

* Avoid matching string for license checkers.

* Reformulate not to throw license detection off.

* Add PSF copyright notice for plugins/module_utils/_mount.py.

* Add generic copyright notices.

* Update changelog fragment.
2022-08-08 23:23:08 +02:00
Felix Fontein
424d706f92
Fix more copyright lines, add more default copyright lines (#5095)
* Fix copyright lines.

* Add default copyright line.
2022-08-08 14:24:58 +02:00
Felix Fontein
9327b12c4d
Add more default license and copyright notices (#5087)
* Add more default license and copyright notices.

* Fix tests.

* Fix typos.

* Fix task type.

* Add URL to changelog fragment.

* Improve headers for setup_wildfly_server.
2022-08-08 08:44:19 +02:00
Felix Fontein
2a9fd7359f
Add more license statements (#5079)
* Add more license statements. These were modified manually incorporating existing data.

* Remove accidentally added line.
2022-08-07 13:37:23 +02:00
Mike Moerk
6062ae8fae
WDC Redfish support for chassis indicator LED toggling. (#5059)
* WDC Redfish support for chassis indicator LED toggling.

* Added changelog fragment.

* Apply suggestions from code review

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-07 09:56:07 +02:00
Felix Fontein
68e7e52557
Add simple license headers, not completely at top. (#5080) 2022-08-05 21:31:34 +02:00
Felix Fontein
fa6c009ff0
Make sure all files have trailing newline (#5076)
* Make sure all files have trailing newline.

* Adjust tests.
2022-08-05 21:08:41 +02:00
Felix Fontein
79b201ae49
Remove superfluous empty file. (#5077) 2022-08-05 18:46:35 +00:00
Felix Fontein
1ab2a5f1bc
Add default license header to files which have no copyright or license header yet (#5074)
* Add default license header to files which have no copyright or license header yet.

* yml extension should have been xml...
2022-08-05 14:03:38 +02:00
Felix Fontein
123c7efe5e
Move licenses to LICENSES/, run add-license.py, add LICENSES/MIT.txt (#5065)
* Move licenses to LICENSES/, run add-license.py, add LICENSES/MIT.txt.

* Replace 'Copyright:' with 'Copyright'

sed -i 's|Copyright:\(.*\)|Copyright\1|' $(rg -l 'Copyright:')

Co-authored-by: Maxwell G <gotmax@e.email>
2022-08-05 12:28:29 +02:00
Felix Fontein
b5eae69e36
Set CARGO_NET_GIT_FETCH_WITH_CLI=true for cargo on Alpine. (#5053) 2022-08-01 23:08:10 +02:00
Alexei Znamensky
5933d28dc4
xfconf: add command output to results (#5037)
* xfconf: add command output to results

* add changelog fragment

* add docs for return value cmd

* Update plugins/modules/system/xfconf.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-01 11:21:06 +02:00
Jonathan Lung
ab0cd83bb1
New lookup plug-in: bitwarden (#5012)
* Basic support for Bitwarden lookups

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>

* Update plugins/lookup/bitwarden.py

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

* Update plugins/lookup/bitwarden.py

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

* Update plugins/lookup/bitwarden.py

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

Co-authored-by: jonathan lung <lungj@heresjono.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2022-08-01 10:00:05 +02:00
Jonathan Lung
e8e6b9bbd7
lastpass lookup: use config manager, improve documentation (#5022)
* LastPass lookup: use config manager, improve documentation

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

* Update changelogs/fragments/5022-lastpass-lookup-cleanup.yml

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

Co-authored-by: jonathan lung <lungj@heresjono.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-01 09:36:07 +02:00
grembo
74f2e1d28b
passwordstore: Add some real gopass integration tests (#5030)
* passwordstore: Add some real go tests

This is work in progress.

* passwordstore: Fix gopass init

* Init gopass store in explicit path in integration test

* passwordstore: Show versions of tools in integration test

* passwordstore: Install gopass from different location on Debian

Part of integration tests

* passwordstore: Add changelog fragment for #5030

* passwordstore: Address review feedback
2022-07-31 22:13:27 +02:00
PKehnel
c273498a03
Module listen ports facts extend output (#4953)
* Initial Rework of netstat and ss to include additional information.
State, foreign address, process.

* Fixed sanity tests. Python 2 compatible code. pylint errors resolved.

* Sanity tests. ss_parse fix minor error I created before.

* Rename variable for clarity

* Python2 rsplit takes no keyword argument. -> remove keyword argument

* Generic improvments for split_pid_name. Added changelog

* Sanity Test (no type hints for python2.7)

* add include_non_listening param. Add param to test. Add documentation. Only return state and foreign_address when include_non_listening

* Update changelogs/fragments/4953-listen-ports-facts-extend-output.yaml

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

* Add info to changelog fragment. Clarify documentation.

* The case where we have multiple entries in pids for udp eg: users:(("rpcbind",pid=733,fd=5),("systemd",pid=1,fd=30)) is not in the tests. So roll back to previous approach where this is covered. Fix wrong if condition for include_non_listening.

* Rewrite documentation and formatting.

* Last small documentation adjustments.

* Update parameters to match description.

* added test cases to check if include_non_listening is set to no by default. And test if ports and foreign_address exists if set to yes

* undo rename from address to local_address -> breaking change

* Replace choice with bool, as it is the correct fit here

* nestat distinguishes between tcp6 and tcp output should always be tcp

* Minor adjustments in the docs (no -> false, is set to yes -> true)

Co-authored-by: Paul-Kehnel <paul.kehnel@ocean.ibm.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-07-31 22:12:38 +02:00
Minei3oat
9f3841703f
Pacman: Add support for install reason (#4956)
* Pacman: Add support for setting install reason

* Improved description

* Fix documentation

* Add changelog fragment

* Use source for installation

* Get all reasons at once

* Removed default for reason

* Added version info to documentation

* Fix NameError

* Moved determination of reason to _build_inventory

* Fix duplication and sanity errors

* adjust tests for changed inventory

* Documentation: remove empty default for reason

* mention packages with changed reason in exit params/info

* Added integration tests for reason and reason_for

Inspired by the integration tests for url packages

* Correct indentation

* Fix indentation

* Also sort changed packages in normal mode

* Also sort result in unit test

* Apply suggestions from code review

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-07-31 22:10:49 +02:00
wilfriedroset
d214f49be7
consul: add support for session TTL (#4996)
Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>
2022-07-31 13:17:43 +02:00
Sylvia van Os
3eb29eb4b6
Fix returnall for gopass (#5027)
* Fix returnall for gopass

Gopass was always given the --password flag, despite there being no need for this.

* Add changelog fragment

Co-authored-by: Sylvia van Os <sylvia.van.os@politie.nl>
2022-07-29 14:24:15 +02:00
Alexei Znamensky
618fab5f9c
vmadm: add comment to ignore file (#5025) 2022-07-29 11:31:26 +02:00
Alexei Znamensky
1c167ab894
xfconf: add unit test for bool value (#5014) 2022-07-28 09:21:23 +02:00
Minei3oat
76b235c6b3
Pacman: Improve url integrity test (#4968)
* Fix typo

* Host url package

* Delete cached files

* Add cases for cached url package

* Rename file_pkg for clarification

* Change port to 8080, as 80 is already used in pipeline

* Added fragment

* Change port to 8000, as 8080 is already used in pipeline

* Fixed changelog fragment

* Change port to 53280, as 8000 is already used in pipeline

* Change port to 27617 (copied from get_url), as 53280 is already used in pipeline

* Also download the signature of url package

Co-authored-by: Jean Raby <jean@raby.sh>

* Fix duplication errors

Co-authored-by: Jean Raby <jean@raby.sh>

* Copied waiting from get_url; applyed output redirection from jraby

* Fix signature filename

* Use correct cache dir

* Add missing assertions for uninstall_1c

* Fix typo

* Delete changelog fragment

* Make python server true async with 90 sec timeout

Copied from ainsible.builtin.get_url

Co-authored-by: Jean Raby <jean@raby.sh>
2022-07-26 17:59:52 +02:00
Felix Fontein
8f5a8cf4ba
Temporarily disable the yum_versionlock tests. (#4978) 2022-07-23 12:14:29 +02:00
Felix Fontein
e1cfa13a1b
python-daemon 2.3.1 requires Python 3+. (#4977) 2022-07-23 12:02:18 +02:00
Mike
be70d18e3f
Redfish modules for Western Digital UltraStar Data102 storage enclosures (#4885)
* WDC Redfish Info / Command modules for Western Digital Ultrastar Data102 storage enclosures.
Initial commands include:
* FWActivate
* UpdateAndActivate
* SimpleUpdateStatus

* delete unnecessary __init__.py modules

* PR Feedback

Notes list not guaranteed to be sorted
Use EXAMPLES tos how specifying ioms/basuri
Import missing_required_lib

* Apply suggestions from code review

Suggestions that could be auto-committed.

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

* Remove DNSCacheBypass

It is now the caller's responsibility to deal with stale IP addresses.

* Remove dnspython dependency.

Fix bug that this uncovered.

* Apply suggestions from code review

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

* PR Feedback

* Documentation, simple update status output format, unit tests.

Add docs showing how to use SimpleUpdateStatus
Change the format of SimpleUpateStatus format, put the results in a sub-object.
Fix unit tests whose asserts weren't actually running.

* PR Feedback

register: result on the 2nd example

* Final adjustments for merging for 5.4.0

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-07-16 22:59:13 +02:00
Felix Fontein
ade54bceb8
Adjust to b1dd2af4ca. (#4949) 2022-07-12 17:02:30 +02:00
Abhijeet Kasurde
bf94f08bc4
Misc. typo fixes (#4940)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-07-08 23:11:57 +02:00
Felix Fontein
674b1da8bf
Improve hwclock support test. (#4904) 2022-06-30 07:30:12 +02:00
Felix Fontein
1eee35dffb
Disable opentelemetry installation for unit tests. (#4871) 2022-06-21 21:39:00 +02:00
Felix Fontein
297de3011c
Fix CI due to pycdlib dropping Python 2 support. (#4865) 2022-06-21 14:12:21 +02:00
Jon Ellis
97c72f88b7
Sudoers validate (#4794)
* Use visudo to validate sudoers rules before use

* Replace use of subprocess.Popen with module.run_command

* Switch out apt for package

* Check file mode when verifying file to determine whether something needs to change

* Only install sudo package for debian and redhat environments (when testing)

* Attempt to install sudo on FreeBSD too

* Try just installing sudo for non-darwin machines

* Don't validate file ownership

* Attempt to install sudo on all platforms

* Revert "Attempt to install sudo on all platforms"

This reverts commit b9562a8916.

* Remove file permissions changes from this PR

* Add changelog fragment for 4794 sudoers validation

* Add option to control when sudoers validation is used

* Update changelog fragment

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

* Add version_added to validation property

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

* Also validate failed sudoers validation error message

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

* Make visudo not executable instead of trying to delete it

* Update edge case validation

* Write invalid sudoers file to alternative path to avoid breaking sudo

* Don't try to remove or otherwise modify visudo on Darwin

* Update plugins/modules/system/sudoers.py

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

* Remove trailing extra empty line to appease sanity checker

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-21 12:41:24 +02:00
ahussey-redhat
45362d39a2
Add keyring and keyring_info modules (#4764) 2022-06-20 19:15:08 +02:00
s-hamann
44e21dd407
sudoers: fix handling of state: absent (#4852) (#4853)
* sudoers: fix handling of state: absent (#4852)

* typo fixes
2022-06-19 15:34:24 +02:00
grembo
006f3bfa89
passwordstore: Make compatible with shims (#4780)
* passwordstore: Make compatible with shims, add backend config

This allows using the passwordstore plugin with scripts that wrap other
password managers. Also adds an explicit configuration (`backend` in
`ini` and `passwordstore_backend` in `vars`) to set the backend to `pass`
(the default) or `gopass`, which allows using gopass as the backend
without the need of a wrapper script. Please be aware that gopass
support is currently limited, but will work for basic operations.

Includes integrations tests.

Resolves #4766

* Apply suggestions from code review
2022-06-15 08:08:04 +02:00
pastral
7f4c11cd64
Add scw_compute_private_network (#4727)
* Add scw_compute_private_network

* fix argument required and BOTMETA

* little fix in commentary/doc

* test with link for ansible-doc check

* remove unwanted file

* fix entry missing in  meta/runtime.yml

* scaleway_compute_private_network add some check in test and  some fic in doc

* a=add missing  del os.environ

* fix whitespace

* test_scaleway_compute_private_network : fix test

* test_scaleway_compute_private_network : fix pep8

* scaleway_compute_private_network

add . in description

* scaleway_compute_private_network: fix var name

* [scaleway_compute_private_network] add name for the example's task

* Update plugins/modules/cloud/scaleway/scaleway_compute_private_network.py

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

* Update plugins/modules/cloud/scaleway/scaleway_compute_private_network.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-15 08:07:02 +02:00
Alexei Znamensky
739ca737f1
cmd_runner: add __call__ method to invoke context (#4791)
* cmd_runner: add __call__ method to invoke context

* change xfconf to use the callable form

* add changelog fragment

* Update changelogs/fragments/4791-cmd-runner-callable.yaml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-15 08:06:26 +02:00
Felix Fontein
84d8ca9234
Fix alternatives module (#4836)
* Only pass subcommands when they are specified as module arguments.

* When 'subcommands' is specified, 'link' must be given for every subcommand.

* Extend subcommand tests.
2022-06-14 16:02:31 +02:00
Pino Toscano
a45b90e93f
redhat_subscription: call 'remove' instead of 'unsubscribe' (#4809)
The 'unsubscribe' command of 'subscription-manager' was deprecated
already in subscription-manager 1.11.3, shipped with RHEL 5.11.
As it was removed in subscription-manager 1.29.x, unsubscribing from
pools was thus broken.

The simple fix is to call the proper command, 'remove'.
2022-06-14 07:26:38 +02:00
Marius Rieder
57e83ac80b
alternatives: Fix bug with priority default (#4810)
* alternatives: Fix bug with priority default

If neigther the priority nor the subcommands where specified the module decided to update the priority with the default value anyway. This resulted in bug #4803 and #4804

* Add changelog fragment.

* Distinguish None from 0.

* Address review comments.

* Update plugins/modules/system/alternatives.py

Co-authored-by: Pilou <pierre-louis@libregerbil.fr>

* Remove unrelated issues from changelog.

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Pilou <pierre-louis@libregerbil.fr>
2022-06-13 21:40:02 +02:00
geichelberger
72faebffc6
nmcli: do not convert undefined lists to empty strings (#4813)
* do not convert undefined lists to empty strings

* add changelog fragment (#4813)
2022-06-13 11:56:10 +02:00
Jon Ellis
2d1e58663c
Ensure managed sudoers config files have 0440 permissions (#4814)
* Ensure sudoers config files are created with 0440 permissions to appease visudo validation

* Remove change not required by the bugfix

* Add changelog fragment for 4814 sudoers file permissions

* Update changelogs/fragments/4814-sudoers-file-permissions.yml

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

* Have less oct casting

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-12 08:17:56 +02:00
Felix Fontein
c8a2c5d375
requests drops support for older Python (#4818)
* requests drops support for older Python.

* Work around CentOS 6 pip bugs.
2022-06-11 22:35:11 +02:00
Jeffrey van Pelt
71745b8024
Added conditional to only collect qmpstatus on qemu VMs (#4816)
* Added conditional to only collect qmpstatus on qemu VMs

* Processed feedback, added changelog

* Initial change to unit tests

* Made Sanity tests happy again

* Missed a function call, removed superfluous function

* Derp, no need to mock get_vm_status anymore

* Added detail checks whether hosts are mapped to the paused/prelaunch groups

* Fix sanity check

* Processed feedback

* Processed feedback - noqa
2022-06-11 13:46:17 +02:00
Felix Fontein
dd24c98fe5
CI: Disable repo URL test for OpenSuSE 15.4 (#4805)
* Disable repo URL test for OpenSuSE 15.4.

* Forgot some places.
2022-06-08 12:48:55 +02:00
José Roberto Emerich Junior
e5e485390d
add support to create L2TP and PPTP VPN connection (#4746)
* add support to create L2TP and PPTP VPN connection

* Update plugins/modules/net_tools/nmcli.py

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

* Update plugins/modules/net_tools/nmcli.py

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

* Update plugins/modules/net_tools/nmcli.py

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

* Update plugins/modules/net_tools/nmcli.py

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

* Update plugins/modules/net_tools/nmcli.py

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

* Update plugins/modules/net_tools/nmcli.py

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

* Update plugins/modules/net_tools/nmcli.py

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

* Update plugins/modules/net_tools/nmcli.py

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

* apply changes pointed on tests and review

- add changelog fragment
- change example code to use jinja2 in place of shell command

* removes trailing whitespace

* Update plugins/modules/net_tools/nmcli.py

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

* Update plugins/modules/net_tools/nmcli.py

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

* removes linux command from examples

* remove unnecessary brakets

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

* remove unnecessary brakets

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

* simplify psk encoding on example

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

* Update plugins/modules/net_tools/nmcli.py

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

* Update plugins/modules/net_tools/nmcli.py

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

* add unit tests

- test unchenged l2tp and pptp vpn connections
- test create l2tp and pptp vpn connections
- fix is_connection_changed to remove default ifname attribuition

* improve tests on vpn.data param

- fix _compare_conn_params to handle vpn.data as lists

* removes block and set_fact from example

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

* makes line shortter to better reading

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

* Update plugins/modules/net_tools/nmcli.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-06 21:16:27 +02:00
Marius Rieder
373da56b5b
Add subcommands parameter for module alternatives. (#4654)
* Add slaves parameter for module alternatives.

* alternatives: Improve documentation abous slaves parameter

* alternatives: Apply suggestions from code review

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

* alternatives: Add schangelog for slaves parameter

* alernatives: Add integration tests

* alternatives: Improv tests

* alternatives: Update tests/integration/targets/alternatives/tasks/slaves.yml

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

* alternatives: Rework logic to support updating priority and subcommands

* alternatives: Use more inclusive naming

* alternatives: Fix linter warnings

* alternatives: Dont fail if link is absent

* alternatives: Update changelog fragment

* alternatives: Add tests for prio change and removing

* alternatives: Apply suggestions from code review

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

* alternatives: Add `state=auto`to reset mode to auto

* alternatives: Fix linter warnings

* alternatives: Fix documentation.

* alternatives: Combine multiple messages.

* alternatives: Set command env for all commands.

* alternatives: Do not update subcommands if parameter is omited

* alternatives: Fix a bug with python 2.7 var scoping

* alternatives: Improce diff before generation

* alternatives: Fix linter warnings

* alternatives: Fix test names

* alternatives: Simplify subcommands handling and improve diffs

* aliases: Only test for subcommand changes if subcommands parameter is set.

* Update plugins/modules/system/alternatives.py

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

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-06 10:33:39 +02:00
Alexei Znamensky
2d38c8d892
cmd_runner: deprecate fmt as the name for the format class (#4777)
* cmd_runner: deprecate fmt as the name for the format class

* added changelog fragment

* fixing the deprecation comment
2022-06-05 18:37:59 +02:00
Ilija Matoski
b556b142ec
Proxmox Inventory: added new statuses for qemu (#4723)
* added new statuses for qemu

* added document fragment

* lint fixes

* replaced f strings with %

* move the qmpstatus for qemu to a dedicated group

* added documentation to explain the new addition

* update changelog fragment to reflect the change correctly

* update changelog fragment to reflect the change correctly

* Apply suggestions from code review

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

* added a switch to get the qemu extended status

* Apply suggestions from code review

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

* groups created when qemu_extended_statuses is true and added tests to make sure they are there

* added test to make sure the groups are not present when qemu_extended_statuses is false

* Apply suggestions from code review

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-04 09:15:02 +02:00
Alexei Znamensky
49836bb484
gconftool2_info: new module (#4743)
* gconftool2_info: new module

* fixed imports

* fixed docs for gconftool2_info

* fixed docs for gconftool2_info

* minor adjustment in docs

* added tests

* adjustments
2022-06-04 09:13:53 +02:00
Alexei Znamensky
be69f95f63
cmd_runner: added flag check_mode_skip to context (#4736)
* cmd_runner: added flag skip_if_check_mode to context

* added changelog fragment

* adjusted param name and added new one
2022-06-04 09:13:37 +02:00
Felix Fontein
0be68bf04b
Add simplified_bsd.txt license file (#4759)
* Add simplified_bsd.txt and adjust references.

* Add changelog.
2022-06-02 07:30:06 +02:00