mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 14:20:22 -07:00
* 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>
(cherry picked from commit 5933d28dc4
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
9358640ed9
commit
963bbaccb7
3 changed files with 36 additions and 1 deletions
|
@ -143,6 +143,24 @@ RETURN = '''
|
|||
returned: success
|
||||
type: any
|
||||
sample: '"96" or ["red", "blue", "green"]'
|
||||
cmd:
|
||||
description:
|
||||
- A list with the resulting C(xfconf-query) command executed by the module.
|
||||
returned: success
|
||||
type: list
|
||||
elements: str
|
||||
version_added: 5.4.0
|
||||
sample:
|
||||
- /usr/bin/xfconf-query
|
||||
- --channel
|
||||
- xfce4-panel
|
||||
- --property
|
||||
- /plugins/plugin-19/timezone
|
||||
- --create
|
||||
- --type
|
||||
- string
|
||||
- --set
|
||||
- Pacific/Auckland
|
||||
'''
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.module_helper import StateModuleHelper
|
||||
|
@ -207,6 +225,11 @@ class XFConfProperty(StateModuleHelper):
|
|||
def state_absent(self):
|
||||
with self.runner('channel property reset', check_mode_skip=True) as ctx:
|
||||
ctx.run(reset=True)
|
||||
self.vars.stdout = ctx.results_out
|
||||
self.vars.stderr = ctx.results_err
|
||||
self.vars.cmd = ctx.cmd
|
||||
if self.verbosity >= 4:
|
||||
self.vars.run_info = ctx.run_info
|
||||
self.vars.value = None
|
||||
|
||||
def state_present(self):
|
||||
|
@ -233,6 +256,11 @@ class XFConfProperty(StateModuleHelper):
|
|||
|
||||
with self.runner('channel property create force_array values_and_types', check_mode_skip=True) as ctx:
|
||||
ctx.run(create=True, force_array=self.vars.is_array, values_and_types=(self.vars.value, value_type))
|
||||
self.vars.stdout = ctx.results_out
|
||||
self.vars.stderr = ctx.results_err
|
||||
self.vars.cmd = ctx.cmd
|
||||
if self.verbosity >= 4:
|
||||
self.vars.run_info = ctx.run_info
|
||||
|
||||
if not self.vars.is_array:
|
||||
self.vars.value = self.vars.value[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue