* 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>
* 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
* 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>
* 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.
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
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'.
* 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
* 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>
* 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>
* Update lenovoxcc module for compatibility due to redfish spec changes the virtualMedia resource location from Managers to Systems
* Add changelogs fragment for PR 4682
* Update changelogs/fragments/4682-compatibility-virtualmedia-resource-location.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Tami YY3 Pan <panyy3@lenovo.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>
* 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>
* Proxmox inventory plugin - Initial implementation of filters
* This is an attempt at implementing something that would satisfy
issue #3553
* A rather massive code rewrite was needed as adding the host to the
inventory, setting its variables and adding it to various groups
used to be done as soon as the information became available. This is
not possible when it is not known whether the host should be added
to the inventory before all data has been gathered.
* The code for both LXC containers and Qemu VMs was refactored into a
single loop.
* Helper functions to generate group and fact names were added.
* Proxmox inventory plugin - Warnings for filter errors
* When an error occurs while compositing a filter's value and strict
mode is disabled, display a warning.
* Proxmox inventory plugin - Fixed pool groups building
* Hosts that were excluded by the host filters were still being added
to pool groups, causing errors.
* Proxmox inventory plugin - Refactoring
* Split off the VM/container handling code from the
`_populate()` method
* Split off pool group attribution from the `_populate()` method
* Proxmox inventory filters - Changelog fragment
* proxmox inventory - Simplify _can_add_host() method
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Implement change detection for update_cache=true. Add cache_updated return value.
* ...
* Make sure pacman --sync --list is called only as often as necessary.
* Fix linode inventory filtering
There was a regression introduced in the addition of caching. The
`_consume_options` method was added and provided the `config_data`
dictionary. This `pop`s every entry, resulting in an empty `config_data`
dict, which was then reused and expected to be populated.
After reviewing, `_consume_data` doesn't need to be called. Also, once
the ``_read_config_data` method has been called, we no longer need the
config_data dict, and can instead use the `get_option` method throughout.
Once those were removed, the filtering function seemed a bit odd, since
we were no longer using the file. I used that opportunity to move the
filter calls into the populate function directly.
* Remove tests that target removed methods
This removes tests that targeted some custom methods on configuration
file handling. These are no longer necessary since they are now handled
by the BaseInventoryPlugin `_read_config_data` method.
* Add changelog entry for linode inventory bugfix
* Revert filters back to their own method
This moves filters back into their own method, but now uses the
get_option calls to pull filter configuration items.
* npm - add '--production` support to 'npm ci' flag
* add changelog fragement for 4299
* Add backticks
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Remove nmcli modify dependency on type parameter
* Add fragment
* Add newline for lint
* Fixed linting for tests
* Fix fragment
* Move aliases to ip_conn_type function
* Remove connection_map
* Updated fragment
* Fixed fragment
Co-authored-by: Trey West <--local>
* pacman: re-adding support for URL based pkgs
* Update plugins/modules/packaging/os/pacman.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/packaging/os/pacman.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* cmd=cmd in every call to self.fail()
* pacman: integration test for mixed pkg sources
* Add more tests + fix minor bug with URL packages
Version checking for URL packages is left to pacman, so add a check
after the dry run to see if it would actually install anything.
* remove double templating
Co-authored-by: Felix Fontein <felix@fontein.de>