* Add 'activate' parameter for alternatives
Allow alternatives to be installed without being set as the current
selection.
* add changelog fragment
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
* rename 'activate' -> 'selected'
* rework 'selected' parameter -> 'state'
* handle unsetting of currently selected alternative
* add integration tests for 'state' parameter
* fix linting issues
* fix for Python 2.7 compatibility
* Remove alternatives file.
Co-authored-by: Felix Fontein <felix@fontein.de>
* Parse lxc key from api data for lxc containers
When configuring containers in the `/etc/pve/lxc/` file, the API
adds a 'lxc' key that caused the plugin to crash as it tried to
split a list on ','.
This commit introduces logic to convert the list of lists in the
returned data to a dict as with the other keys.
```
'lxc': [['lxc.apparmor.profile', 'unconfined'],
['lxc.cgroup.devices.allow', 'a']]
```
becomes
```
"proxmox_lxc": {
"apparmor.profile": "unconfined",
"cap.drop": "",
"cgroup.devices.allow": "a"
}
```
* Add changelog fragment
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Philippe Pepos Petitclerc <peposp@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
* initial commit, passing unit tests
* passing one very silly integration test
* multiple changes:
- updated copyright year
- cmd_runner
- added fmt_optval
- created specific exceptions
- fixed bug in context class where values from module params were not
being used for resolving cmd arguments
- changed order of class declaration for readability purpose
- tests
- minor improvements in integration test code
- removed some extraneous code in msimple.yml
- minor improvements in unit tests
- added few missing cases to unit test
* multiple changes
cmd_runner.py
- renamed InvalidParameterName to MissingArgumentFormat
- improved exception parameters
- added repr and str to all exceptions
- added unpacking decorator for fmt functions
- CmdRunner
- improved parameter validation
- _CmdRunnerContext
- Context runs must now pass named arguments
- Simplified passing of additional arguments to module.run_command()
- Provided multiple context variables with info about the run
Integration tests
- rename msimple.py to cmd_echo.py for clarity
- added more test cases
* cmd_runner: env update can be passed to runner
* adding runner context info to output
* added comment on OrderedDict
* wrong variable
* refactored all fmt functions into static methods of a class
Imports should be simpler now, only one object fmt, with attr access to all callables
* added unit tests for CmdRunner
* fixed sanity checks
* fixed mock imports
* added more unit tests for CmdRunner
* terminology consistency
* multiple adjustments:
- remove extraneous imports
- renamed some variables
- added wrapper around arg formatters to handle individual arg ignore_none behaviour
* removed old code commented out in test
* multiple changes:
- ensure fmt functions return list of strings
- renamed fmt parameter from `option` to `args`
- renamed fmt.mapped to fmt.as_map
- simplified fmt.as_map
- added tests for fmt.as_fixed
* more improvements in formats
* fixed sanity
* args_order can be a string (to be split())
and improved integration test
* simplified integration test
* removed overkill str() on values - run_command does that for us
* as_list makes more sense than as_str in that context
* added changelog fragment
* Update plugins/module_utils/cmd_runner.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* adjusted __repr__ output for the exceptions
* added superclass object to classes
* added additional comment on the testcase sample/example
* suggestion from PR
Co-authored-by: Felix Fontein <felix@fontein.de>
* Allow restoring of snapshots
* Fix formatting
* Add documentation for new feature
* Revert unrelated reformatting
* Add documentation for snapshot change
* Remove redundant multiple call to status API
* Remove unneccesary indent
* Add documentation for timeout fix
* Update changelog fragment to reflect real changes
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelog fragment to reflect real changes
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add Tests for Snapshot rollback
* Update tests/unit/plugins/modules/cloud/misc/test_proxmox_snap.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelogs/fragments/4377-allow-proxmox-snapshot-restoring.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/misc/proxmox_snap.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* nmcli: Deprecate default hairpin mode
Deprecate the default hairpin mode for a bridge.
Plain nmcli/bridge tools defaults to no, but for some reason ansible
defaults to yes.
We deprecate the default value so we can switch to default 'no' in
ansible 6.0.0
* Code review fixes
Co-authored-by: Felix Fontein <felix@fontein.de>
* Fix comments
* Update changelogs/fragments/4320-nmcli-hairpin.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelogs/fragments/4320-nmcli-hairpin.yml
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>
* Implement contructable support for opennebula inventory plugin: keyed_groups, compose, groups
* Fixed templating mock issues in unit tests, corrected some linting errors
* trying to make the linter happy
* Now trying to make python2.7 happy
* Added changelog fragment
* changelog fragment needs pluralization
* Update changelogs/fragments/4524-update-opennebula-inventory-plugin-to-match-documentation.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* pacman: Fix removing locally installed packages
Without this, using `absent` state for a locally installed package (for example from AUR, or from a package that was dropped from repositories) would return that package is already removed, despite remaining installed
* Undo unwanted whitespace removal
* Add changelog fragment
* Update changelogs/fragments/4464-pacman-fix-local-remove.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add test.
Co-authored-by: Felix Fontein <felix@fontein.de>
If `all=True` is not set then by default only 20 records will be
returned when calling `list()`. Use `all=True` so that all records
will be returned.
For the `list()` use where do not desire to retrieve all entries then
use`all=False` to show explicityly that we don't want to get all of
the entries.
Fixes: #3729Fixes: #4460
* Adds optional `-upgrade` flag to terraform init.
This allows Terraform to install provider dependencies into an existing project when the provider constraints change.
* fix transposed documentation keys
* Add integration tests for terraform init
* Revert to validate_certs: yes for general public testing
* skip integration tests on irrelevant platforms
* skip legacy Python versions from CI tests
* add changelog fragment
* Update plugins/modules/cloud/misc/terraform.py
Adds version_added metadata to the new module option.
Co-authored-by: Felix Fontein <felix@fontein.de>
* Change terraform_arch constant to Ansible fact mapping
* correct var typo, clarify task purpose
* Squashed some logic bugs, added override for local Terraform
If `existing_terraform_path` is provided, the playbook will not download Terraform or check its version.
I also tested this on a local system with Terraform installed, and squashed some bugs related to using of an
existing binary.
* revert to previous test behavior for TF install
* readability cleanup
* Update plugins/modules/cloud/misc/terraform.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Only get monitor if it is not null api response
* Add changelog fragment
* Update changelogs/fragments/4459-only-get-monitor-if-it-is-not-null-api-response.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/net_tools/dnsmadeeasy.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: drevai <revai.dominik@gravityrd.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
* add support for datadog monitors of type event-v2
See https://docs.datadoghq.com/events/guides/migrating_to_new_events_features/
* add changelog fragement for PR
* typos
* add link to PR
* minor_fetaure, not bugfix
* add to description when we added event-v2 type
* Update changelogs/fragments/4457-support-datadog-monitors-type event-v2.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add error handling to check correct SDK version installed
* Fix CI errors
* Added changelog fragment
* Changed exeption type
* Update changelogs fragment
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* fixed issue with specified package versions
zypper.py was doing nothing on state=present, when ALL requestet/checked packages had a specific version stated. This was caused by get_installed_state() being called with an empty package list, which in this case returns information about all ALL installed packages. This lead to an exessive filter list prerun_state, essentially removing all packages that are installed in ANY version on the target system from the request list.
* Create 4421-zypper_package_version_handling_fix
added changelog fragment for https://github.com/ansible-collections/community.general/pull/4421
* Delete 4421-zypper_package_version_handling_fix
* Create 4421-zypper_package_version_handling_fix.yml
* added templating to the url, user, and password
* added changelog fragment
* typo in description for url, and password
* clarify in the changelog what can you change
* update documentation and added an example
* missing quote from examples
* Apply suggestions from code review
Changed to I for option names
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/inventory/proxmox.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix: missing `validate_certs` parameters for `open_url` calls
As stated in the documentation, the `validate_certs` parameter can be
used to verify (or not) the TLS certificates. But, for some modules (at
least for the `keycloak_authentication` module), this parameter is not
used with the `open_url` function.
* add changelog fragment
* Update changelogs/fragments/4382-keycloak-add-missing-validate_certs-parameters.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Laurent Meunier <lme@atolcd.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Proxmox inventory plugin - Fix tags parsing
* In some cases the Proxmox API returns a tags string that consists in
a single space. The Proxmox inventory plugin parsed that into a
single, empty tag. Stripping the initial string then checking
whether it actually contains something fixes that.
* Do not call `_to_safe` on the concatenation of a known safe string
and a string that was already made safe.
* Changelog fragment for Proxmox inventory plugin tags fix
* Proxmox inventory plugin - Include link to PR in fragment
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* feat: sudoers module supports runas parameter with default of root
* fix: sudoers tests now pass
* chore: add changelog fragment for 4380
* fix: runas feature now a non-breaking change wh no def with no default
* fix: no trailing space in sudoers.py
* Update plugins/modules/system/sudoers.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* plugins/inventory/lxd.py: fix listing of containers without os / release
In some cases, a container might be present, that was initialized empty, therefore lacking meta information about the os or the release.
Test if the data entry is None to avoid calling lower on it.
* Update plugins/inventory/lxd.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/inventory/lxd.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Create 4351-inventory-lxd-handling_metadata_wo_os_and_release.yml
* fix yaml readability of changelog fragment
* Update changelogs/fragments/4351-inventory-lxd-handling_metadata_wo_os_and_release.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Malte Kuhn <mkuhn@maxcluster.de>