* 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>
* keycloak: fix creating a user federation w/ idempotent id
Creating a user federation while specifying an id (that doesn't exist
yet) will fail with a 404. This commits fix this behavior.
* keycloak: fix user federation mapper duplication
This commit fixes a bug where mappers are duplicated instead of
configured when creating a user federation.
When creating a user federation, some mappers are autogenerated by
keycloak. This commit lets the keycloak_user_federation module recompute
mappers final values after the user federation is created so that the
module can try to merge them by their name.
* add missing fragment for pr #4212
* pmem: Add namespace and namespace_append options
- namespace: Configure the namespace of PMem. PMem should be configured
by appdirect/memmode, or socket option in advance.
- namespace_append: Enables to append the new namespaces.
* Add changelog fragment entry
* Update the changelog fragment
* Update changelog fragment entry
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update to use human_to_bytes
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update to fix the description of namespace_append
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update to release v4.5.0
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update to fix the typo in the description of namespace_append
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add new module: pmem
This commit introduces to pmem module to configure Intel Optane
Persistent Memory modules (PMem).
* Add botmeta
* Update plugins/modules/storage/pmem/pmem.py
* Convert to snake_case options
* Update related to xmltodict
* Update to use list instead of string
* Update to use single quote to the string
* Update plugins/modules/storage/pmem/pmem.py
* begin add private network
* scaleway_private_network , basic add and remove ok, work in progress
* scaleway_private_network : add search in next page
* scalewy_private_network add tags
* scaleway_private_network fix correct return value for register
* scaleway_privat_network change some text
* fix some sanity
* fix line too long
* fix line too long SCALEWAY_LOCATION
* some change for sanity
* fix sanity again
* add author in BOTMETA
* fix error in name in fike BOTMETA
* Update plugins/modules/cloud/scaleway/scaleway_private_network.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/scaleway/scaleway_private_network.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/scaleway/scaleway_private_network.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/scaleway/scaleway_private_network.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/scaleway/scaleway_private_network.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/scaleway/scaleway_private_network.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/scaleway/scaleway_private_network.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/scaleway/scaleway_private_network.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/scaleway/scaleway_private_network.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* add test for scaleway_private_network
* Update plugins/modules/cloud/scaleway/scaleway_private_network.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/scaleway/scaleway_private_network.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/scaleway/scaleway_private_network.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/scaleway/scaleway_private_network.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* pacman: rewrite with a cache to speed up execution
- Use a cache (or inventory) to speed up lookups of:
- installed packages and groups
- available packages and groups
- upgradable packages
- Call pacman with the list of pkgs instead of one call per package (for
installations, upgrades and removals)
- Use pacman [--sync|--upgrade] --print-format [...] to gather list of
changes. Parsing that instead of the regular output of pacman, which
is error prone and can be changed by user configuration.
This can introduce a TOCTOU problem but unless something else calls
pacman between the invocations, it shouldn't be a concern.
- Given the above, "check mode" code is within the function that would
carry out the actual operation. This should make it harder for the
check code and the "real code" to diverge.
- Support for specifying alternate package name formats is a bit more
robust. pacman is used to extract the name of the package when the
specified package is a file or a URL.
The "<repo>/<pkgname>" format is also supported.
For "state: latest" with a list of ~35 pkgs, this module is about 5
times faster than the original.
* Let fail() actually work
* all unhappy paths now end up calling fail()
* Update copyright
* Argument changes
update_cache_extra_args handled as a list like the others
moved the module setup to its own function for easier testing
update and upgrade have no defaults (None) to let required_one_of() do
its job properly
* update_cache exit path
Shift successful exit without name or upgrade under "update_cache".
It is an error if name or upgrade isn't specified and update_cache wasn't specified
either. (Caught by ansiblemodule required_one_of but still)
* Add pkgs to output on success only
Also align both format, only pkg name for now
* Multiple fixes
Move VersionTuple to top level for import from tests
Add removed pkgs to the exit json when removing packages
fixup list of upgraded pkgs reported on upgrades (was tuple of list for
no reason)
use list idiom for upgrades, like the rest
drop unused expand_package_groups function
skip empty lines when building inventory
* pacman: add tests
* python 2.x compat + pep8
* python 2.x some more
* Fix failure when pacman emits warnings
Add tests covering that failure case
* typo
* Whitespace
black failed me...
* Adjust documentation to fit implicit defaults
* fix test failures on older pythons
* remove file not intended for commit
* Test exception str with e.match
* Build inventory after cache update + adjust tests
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/packaging/os/pacman.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* changelog
* bump copyright year and add my name to authors
* Update changelogs/fragments/3907-pacman-speedup.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* maintainer entry
Co-authored-by: Felix Fontein <felix@fontein.de>
* Added new feature for ansible_user and ansible_port
* Replaced 'try' and 'except' with 'if' condition
* Replace '!=' with 'is not'
* Fixed if condition
* Implement the constructed interface
* Correction at the suggestion of felixfontein
* Added new options in unit test for icinga2 inventory
* Added blank lines in unit test for icinga2 inventory
* Added default filter in example
Co-authored-by: Felix Fontein <felix@fontein.de>
* Fixed variable name in example
Co-authored-by: Felix Fontein <felix@fontein.de>
* Added a changelog fragment
* Fixed changelog fragment
Co-authored-by: Felix Fontein <felix@fontein.de>
* Updated documentation options
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* linode: Allow templating token for dynamic inventory
Template the value for the access_token if it's a Jinja template.
Allows for looking up tokens from files or pulling from secrets stores like Vault.
* add Linode changelog fragment
* Fix lookup example for newer versions of Ansible
Co-authored-by: Felix Fontein <felix@fontein.de>
* Rename test case for clarity
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* nmcli: add wireguard connection type
* nmcli: fix wireguard unit tests
* nmcli: set ipv4.method to disabled if ip4 not set
Method 'auto' is not supported for WireGuard
* nmcli: add wireguard documentation
* nmcli: clean up wireguard documentation
* nmcli: add wireguard changelog fragment
* nmcli: fix wireguard documentation
* Apply suggestions from code review
Co-authored-by: Andrew Pantuso <ajpantuso@gmail.com>
Co-authored-by: Andrew Pantuso <ajpantuso@gmail.com>
* LXD 4.x compatibility (Containers and VMs)
* add changelog fragment
* update fixture
* update plugin options
* backwards compatible alias
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelogs/fragments/3519-inventory-support-lxd-4.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* add lxd 4.0 requirement
* filter for type of virtualization added. due to duplication in the namespace, "type" is not used as the keyword but "nature".
* add type filter
Since the first version of this inventory plugin only supports containers,
a filter function was added to filter between containers and
virtual machines or both.
By default only containers are displayed, as in the first version of the plugin.
This behavior will change in the future.
* rename C(nature) to C(type)
The term "nature" does not fit into the lxd namespace.
Therefore i renamed nature to type.
* update changelog fragment
* Update plugins/inventory/lxd.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
* rename typefilter to type_filter
* fix tests with type_filter
* Update plugins/inventory/lxd.py
* Update plugins/inventory/lxd.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Frank Dornheim <“dornheim@posteo.de@users.noreply.github.com”>
* rebase
* Add changelog fragment
* add suggestions
* split PR into two
* Add multiple address support but with #3768 fiexed
* rebase
* clean some merge artifacts
* update the wording
* interfaces_file: fixed unit tests and added README, added test cases for #3862
* typo fix for interfaces_file unit tests README.md
Co-authored-by: Felix Fontein <felix@fontein.de>
* typo fix for interfaces_file unit tests README.md
Co-authored-by: Felix Fontein <felix@fontein.de>
* typo fix for interfaces_file unit tests README.md
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add support for addr-gen-mode and ip6-privacy options
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
* try to solve conflict
* add suggested code + fix some of its issues
* Update plugins/modules/net_tools/nmcli.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* monit - invoke run_command passing list
* added changelog fragment
* fixed unit test
* further adjustments
* fixed handling of command_args
* better handling of command_args
* change ip6 type to list of str and fix problem with setting addresses without netmask
* change ip6 type to list of str and fix problem with setting addresses without netmask
* Add changelog fragment
* add suggestions
* fix no mask using bug
* Make change independed from feature branch
* Xen orchestra inventory: Added groups, keyed_groups and compose support
* Update plugins/inventory/xen_orchestra.py
Remove extra params declaration
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>