* sysctl will now return an error if the value is invalid
sysctl can fail to set a value even if it returns an exit status 0. More
details: https://bugzilla.redhat.com/show_bug.cgi?id=1264080. Because of
this in case of an invalid value or a read-only file system, sysctl
module would return OK, even though it didn't set anything. To be sure
that sysctl correctly applied the changes we also need to check the
output of stderr.
* Run sysctl with LANG=C
Because we are parsing sysctl stderr we need to make sure that errors
are persistent across different system language settings.
* Add changelog fragment for sysctl
* remove deprecated get_md5 from stat
fixes#55309
* removed get_md5 from tests involving stat
* keep get_md5 but hide it
* rst it
* ammended comment
* ws
* added ignore for hidden md5
* Make ansible adhoc work with include_role
Fix logic condition so that include_role works
without
```
ERROR! 'async_val' is not a valid attribute for a IncludeRole
The error appears to be in 'None': line 0, column 0, but may
be elsewhere in the file depending on the exact syntax problem.
(could not open file to display line)
```
* Add include_role test for adhoc
* XenServer: Minor changes and fixes in xenserver_guest
- xenserver_guest module: ignore wait_for_ip_address when
state=absent (fixes#55348). Module docs are updated to reflect this.
- xenserver_guest module: show proper error message when maximum number
of network interfaces is reached and multiple network interfaces are
added at once (fix for changes introduced in #54697).
- xenserver_guest module: fixed a bug in reconfigure() where VM would
be powered off even though check mode is used when reconfiguration
needs VM to be powered off.
* Added changelog fragment
mem_reservation and memory_reservation has redundant implementation.
Combining them together.
Fixes: #54335
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* remove external grep call and parse with python
* use function for repeated code
* use module.get_bin_path() for iscsiutil on HPUX
* some code opt for HPUX
* clean up non-module code, module being defined is a requirement for this code
* import get_bin_path() directly and use without module prefix
* Add integration tests for AIX and HP-UX
* add changelog fragment
* Apply suggestions from code review
Co-Authored-By: mator <matorola@gmail.com>
* Apply suggestions from code review #2
Co-Authored-By: Sam Doran <sdoran@redhat.com>
* Remove strict requirement on executable to exist for get_bin_path() as
it will allow facts gathering to continue without an error. Almost all
other files under facts do not have "required=True" (except 2 files,
which should be probably fixed). And check return value for
get_bin_path() , before run attempt.
* add check for AIX lsattr run_command return code
The ACI MultiSite PATCH API has a deficiency requiring some objects to be referenced by index.
This can cause silent corruption on concurrent access when changing/removing on object as
the wrong object may be referenced.
This PR removes some references by index, and documents this issue for
others.
* nxos_snmp_traps: fix 'group: all' for N35 platforms
- `group: all` attempts to enable traps for all features defined in the module's `feature_list`
- `N35` platforms do not support `snmp-server enable traps bfd`; so removing `bfd` from the `feature_list` for that platform
- Minor cleanup in `sanity.yaml` test file
* whitespace lint fix
<!--- Your description here -->
The arguments for certificate, private_key and password are marked as required in the ArgumentSpec, but not in the documentation.
+label: docsite_pr
* Fixes Netconf_config single parameter bug
Fixes 56022
fixed get_config to not require multiple parameters to just run a backup
* Add Integration test for netconf_config
Associated with #56022
tests backup through netconf only using one parameter.
* Added debug to the begin and end of file
* Fix formatting of save config. #56022
* removed blank line at end: #56022
* Update include_role description to discuss tasks: use
The previous description in this statement's description really threw me off, and is IMO ambiguous at best. 'Loads and executes a role as a task dynamically. This frees roles from the roles: directive and allows them to be treated more as tasks.'
For reference, I spent a long time trying to make include_role, with a loop, work under a roles: section. It doesn't work, but this documentation and its use of the roles: keyword in the opening, and the phrase '"more" as a task' muddies the waters.
+label: docsite_pr
* add vmware_evc_mode module
* alter result message for absent/absent
* Apply suggestions from code review
Co-Authored-By: CastawayEGR <36353334+CastawayEGR@users.noreply.github.com>
* add idempotency test
* change result dict to evc_mode_msg
* refactor to use pyvmomi class
* fix update to only process task on update
* minimize update code
* add single quotes around vars to match other code
* pass datacenter to cluster find
* add check_mode to disable test
Make a small documentation cleanup for the package_facts module to use
the current YAML style and remove unnecessary quotes around `auto`.
Signed-off-by: Major Hayden <major@redhat.com>
When `vmware_datastore_facts` does not fine any datastore, it raises an error.
This is not consistent with the other _facts modules. It should just return
an empty list instead.
In a multi-host context, `changed_list` will record all the changes
done on any host. So as soon as ONE host is changed, it will be `True`.
A host can potentially already have a parameter set, in this case
`change_option_list` will be empty.
This commit uses `change_option_list` instead of `changed_list` to
decided if a given host should be updated.
* Fix loading namespaced doc_fragments
The syntax for specifying a different fragment name was already
using '.' as a separator, so the code needed to be tweaked to
avoid choking on names like `testns.testcoll.fragname` and
`testns.testcoll.fragname.altvar`.
`get_plugin_class()` returns 'docfragment' for the fragment loader;
mangling `subdir` provides consistent alignment with the normal plugin
directory names and avoids needing special handling of plugin types
with 'module' in the name.
* Add changelog entry
* Modified vcenter_license to accept vSAN license and assign to
the given cluster.
* review comments
Fixes: #55711
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Add GetBootOverride as possible Systems command
* Add conditional to call get_boot_override if command == GetBootOverride
* Implement get_boot_override() in redfish_utils
* Implement get_multi_boot_override() and modify get_boot_override() to support the multi wrapper
* Update GetBootOverride to use get_multi_boot_override
* Add example for new command in docstring
* fix indent
* Update lib/ansible/module_utils/redfish_utils.py
Co-Authored-By: xmadsen <xander.madsen@gmail.com>
* Add GetChassisPower as viable Chassis command in redfish_facts
* Add conditional to catch command == 'GetChassisPower'
* Implement get_chassis_power() retrieving Watts-related and other useful power data from each Chassis
* Add RelatedItem property and remove MemberId property
* Check for length of data['PowerControl'] to be > 0 before checking index 0 of the list.
* Fix return statement being inside loop and result key not being 'entries' as is expected
* Update lib/ansible/module_utils/redfish_utils.py
Co-Authored-By: xmadsen <xander.madsen@gmail.com>
* Update lib/ansible/module_utils/redfish_utils.py
Co-Authored-By: xmadsen <xander.madsen@gmail.com>
* Update redfish_facts.py
The `nxos_vlan` module may raise with regex error `sre_constants.error: multiple repeat` in the non_structured codepath if the device has existing vlan names with certain regex control characters; e.g.
```
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Eth1/3
14 my-vlan-name-is-*** active
```
* `nxos_acl` may fail with `IndexError: list index out of range` while attempting to delete a non-existent ACL.
The failure occurs when the `acl` var is an empty list.
* nxos_acl: catch 501 'Structured output unsupported' when no ACLs present
With some older image versions, `show ip access-list | json` will raise a 501 error indicating `'Structured output unsupported'` when there are no access-lists configured. This change turns off the `check_rc` and then looks for the failure condition.
* Fix kwarg
* Fix lint issues
* Add new method to encode parameters in the URL
- I'm not really encoding, I'm sure this is broke
- There maybe an Ansible native way to do this
* Fix whitepace
* Added urlencode support
- Relies on urllib module
- Fixed string delimiter
* Enable URL params
- construct_params_list() creates a list of parameters to encode
- encode_url_params() does encoding in a simple manner
* Added proper methods for urlencoding
* Remove duplicate functions
* Remove blank line for PEP8
* add multi-node manipulation, delete on xpath match only and count capability to win_xml
* fix pep8 and yamllint errors identified by ci tests
* fixed bugs when handling multiple elements, multiple attribute nodes and handling for attribute nodes when using xpaths that only select attributes like //@lang. Added more tests and tweaked documentation.
* fixed line-too-long error
* fixed trailing space errors
* trailing whitespace expunged
* bump version_added to 2.9 for new changes
* fix PSAvoidUsingPositionalParameters sanity check failure
* refix sanity check as it broke the msg return value
* Check variables are defined before using combine filter
* Add tests for the combine filter
* Remove dependencies that should already be installed
* relocate the function to recursively check for undefined vars
add another test
* changelog
* Add GetSupportedFirmwareUpdateMethods to update category commands list
* Add condition when command == GetSupportedFirmwareUpdateMethods to call the forthcoming rf_utils function get_supported_firmware_update_methods
* Implement get_supporte_firmware_update_methods() in redfish_utils
* rename command to GetFirmwareUpdateCapabilities
* rename comand get_firmware_update_capabilities()
* Rename command get_firmware_update_capabilities()
* Group update protocols by the type of Action they are associated with.
* remove trailing whitespace
* Use safer method to get 'title' for each action type and its allowablevalues
* Add example to docstring for using GetFirmwareUpdateCapabilities
* fix line too long
* fix line too long and trailing whitespace
* Update redfish_utils.py
* remove trailing whitespace
* fix overindent
* Use self.update_uri instead of hard-coding '/redfish/v1' in get_firmware_update_capabilities()
* Add GetChassisThermals command to Chassis list
* Add GetChassisThermals conditional and point to rf_utils.get_chassis_thermals() function
* Implement get_chassis_thermals() in redfish_utils
* Remove trailing whitespace
* Add more properties, including RelatedItem tto distinguish entries' contexts from each other.
* Remove trailing whitespace
* Add custom action class for version info
* Use args from CLI as prog for ArgumentParser object
* Make prog a required parameter of create_base_parser() and update all uses to pass in the newly required parameter.
* Add unit test for checking ansible --version
* Update other related unit tests
The bare minimum example in the docs (i.e. only supplying name, state, and cluster) results in the error `state is present but all of the following are missing: task_definition, desired_count`.