mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-08 11:40:32 -07:00
parent
2f1df973a6
commit
4123934b46
2 changed files with 150 additions and 153 deletions
|
@ -8,26 +8,27 @@
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = """
|
||||||
|
---
|
||||||
module: xfconf
|
module: xfconf
|
||||||
author:
|
author:
|
||||||
- "Joseph Benden (@jbenden)"
|
- "Joseph Benden (@jbenden)"
|
||||||
- "Alexei Znamensky (@russoz)"
|
- "Alexei Znamensky (@russoz)"
|
||||||
short_description: Edit XFCE4 Configurations
|
short_description: Edit XFCE4 Configurations
|
||||||
description:
|
description:
|
||||||
- This module allows for the manipulation of Xfce 4 Configuration with the help of
|
- This module allows for the manipulation of Xfce 4 Configuration with the help of xfconf-query. Please see the xfconf-query(1) man page for more
|
||||||
xfconf-query. Please see the xfconf-query(1) man page for more details.
|
details.
|
||||||
seealso:
|
seealso:
|
||||||
- name: xfconf-query(1) man page
|
- name: xfconf-query(1) man page
|
||||||
description: Manual page of the C(xfconf-query) tool at the XFCE documentation site.
|
description: Manual page of the C(xfconf-query) tool at the XFCE documentation site.
|
||||||
link: 'https://docs.xfce.org/xfce/xfconf/xfconf-query'
|
link: 'https://docs.xfce.org/xfce/xfconf/xfconf-query'
|
||||||
|
|
||||||
- name: xfconf - Configuration Storage System
|
- name: xfconf - Configuration Storage System
|
||||||
description: XFCE documentation for the Xfconf configuration system.
|
description: XFCE documentation for the Xfconf configuration system.
|
||||||
link: 'https://docs.xfce.org/xfce/xfconf/start'
|
link: 'https://docs.xfce.org/xfce/xfconf/start'
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
|
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
|
@ -38,55 +39,50 @@ attributes:
|
||||||
options:
|
options:
|
||||||
channel:
|
channel:
|
||||||
description:
|
description:
|
||||||
- A Xfconf preference channel is a top-level tree key, inside of the
|
- A Xfconf preference channel is a top-level tree key, inside of the Xfconf repository that corresponds to the location for which all application
|
||||||
Xfconf repository that corresponds to the location for which all
|
properties/keys are stored. See man xfconf-query(1).
|
||||||
application properties/keys are stored. See man xfconf-query(1).
|
|
||||||
required: true
|
required: true
|
||||||
type: str
|
type: str
|
||||||
property:
|
property:
|
||||||
description:
|
description:
|
||||||
- A Xfce preference key is an element in the Xfconf repository
|
- A Xfce preference key is an element in the Xfconf repository that corresponds to an application preference. See man xfconf-query(1).
|
||||||
that corresponds to an application preference. See man xfconf-query(1).
|
|
||||||
required: true
|
required: true
|
||||||
type: str
|
type: str
|
||||||
value:
|
value:
|
||||||
description:
|
description:
|
||||||
- Preference properties typically have simple values such as strings,
|
- Preference properties typically have simple values such as strings, integers, or lists of strings and integers. See man xfconf-query(1).
|
||||||
integers, or lists of strings and integers. See man xfconf-query(1).
|
|
||||||
type: list
|
type: list
|
||||||
elements: raw
|
elements: raw
|
||||||
value_type:
|
value_type:
|
||||||
description:
|
description:
|
||||||
- The type of value being set.
|
- The type of value being set.
|
||||||
- When providing more than one O(value_type), the length of the list must
|
- When providing more than one O(value_type), the length of the list must be equal to the length of O(value).
|
||||||
be equal to the length of O(value).
|
- If only one O(value_type) is provided, but O(value) contains more than on element, that O(value_type) will be applied to all elements of
|
||||||
- If only one O(value_type) is provided, but O(value) contains more than
|
O(value).
|
||||||
on element, that O(value_type) will be applied to all elements of O(value).
|
- If the O(property) being set is an array and it can possibly have only one element in the array, then O(force_array=true) must be used to
|
||||||
- If the O(property) being set is an array and it can possibly have only one
|
ensure that C(xfconf-query) will interpret the value as an array rather than a scalar.
|
||||||
element in the array, then O(force_array=true) must be used to ensure
|
- Support for V(uchar), V(char), V(uint64), and V(int64) has been added in community.general 4.8.0.
|
||||||
that C(xfconf-query) will interpret the value as an array rather than a
|
|
||||||
scalar.
|
|
||||||
- Support for V(uchar), V(char), V(uint64), and V(int64) has been added in community.general 4.8.0.
|
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
choices: [ string, int, double, bool, uint, uchar, char, uint64, int64, float ]
|
choices: [string, int, double, bool, uint, uchar, char, uint64, int64, float]
|
||||||
state:
|
state:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The action to take upon the property/value.
|
- The action to take upon the property/value.
|
||||||
- The state V(get) has been removed in community.general 5.0.0. Please use the module M(community.general.xfconf_info) instead.
|
- The state V(get) has been removed in community.general 5.0.0. Please use the module M(community.general.xfconf_info) instead.
|
||||||
choices: [ present, absent ]
|
choices: [present, absent]
|
||||||
default: "present"
|
default: "present"
|
||||||
force_array:
|
force_array:
|
||||||
description:
|
description:
|
||||||
- Force array even if only one element.
|
- Force array even if only one element.
|
||||||
type: bool
|
type: bool
|
||||||
default: false
|
default: false
|
||||||
aliases: ['array']
|
aliases: ['array']
|
||||||
version_added: 1.0.0
|
version_added: 1.0.0
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
|
---
|
||||||
- name: Change the DPI to "192"
|
- name: Change the DPI to "192"
|
||||||
xfconf:
|
xfconf:
|
||||||
channel: "xsettings"
|
channel: "xsettings"
|
||||||
|
@ -110,60 +106,58 @@ EXAMPLES = """
|
||||||
force_array: true
|
force_array: true
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = """
|
||||||
channel:
|
---
|
||||||
description: The channel specified in the module parameters
|
channel:
|
||||||
returned: success
|
description: The channel specified in the module parameters
|
||||||
type: str
|
returned: success
|
||||||
sample: "xsettings"
|
type: str
|
||||||
property:
|
sample: "xsettings"
|
||||||
description: The property specified in the module parameters
|
property:
|
||||||
returned: success
|
description: The property specified in the module parameters
|
||||||
type: str
|
returned: success
|
||||||
sample: "/Xft/DPI"
|
type: str
|
||||||
value_type:
|
sample: "/Xft/DPI"
|
||||||
description:
|
value_type:
|
||||||
- The type of the value that was changed (V(none) for O(state=reset)).
|
description:
|
||||||
Either a single string value or a list of strings for array types.
|
- The type of the value that was changed (V(none) for O(state=reset)). Either a single string value or a list of strings for array types.
|
||||||
- This is a string or a list of strings.
|
- This is a string or a list of strings.
|
||||||
returned: success
|
returned: success
|
||||||
type: any
|
type: any
|
||||||
sample: '"int" or ["str", "str", "str"]'
|
sample: '"int" or ["str", "str", "str"]'
|
||||||
value:
|
value:
|
||||||
description:
|
description:
|
||||||
- The value of the preference key after executing the module. Either a
|
- The value of the preference key after executing the module. Either a single string value or a list of strings for array types.
|
||||||
single string value or a list of strings for array types.
|
- This is a string or a list of strings.
|
||||||
- This is a string or a list of strings.
|
returned: success
|
||||||
returned: success
|
type: any
|
||||||
type: any
|
sample: '"192" or ["orange", "yellow", "violet"]'
|
||||||
sample: '"192" or ["orange", "yellow", "violet"]'
|
previous_value:
|
||||||
previous_value:
|
description:
|
||||||
description:
|
- The value of the preference key before executing the module. Either a single string value or a list of strings for array types.
|
||||||
- The value of the preference key before executing the module.
|
- This is a string or a list of strings.
|
||||||
Either a single string value or a list of strings for array types.
|
returned: success
|
||||||
- This is a string or a list of strings.
|
type: any
|
||||||
returned: success
|
sample: '"96" or ["red", "blue", "green"]'
|
||||||
type: any
|
cmd:
|
||||||
sample: '"96" or ["red", "blue", "green"]'
|
description:
|
||||||
cmd:
|
- A list with the resulting C(xfconf-query) command executed by the module.
|
||||||
description:
|
returned: success
|
||||||
- A list with the resulting C(xfconf-query) command executed by the module.
|
type: list
|
||||||
returned: success
|
elements: str
|
||||||
type: list
|
version_added: 5.4.0
|
||||||
elements: str
|
sample:
|
||||||
version_added: 5.4.0
|
- /usr/bin/xfconf-query
|
||||||
sample:
|
- --channel
|
||||||
- /usr/bin/xfconf-query
|
- xfce4-panel
|
||||||
- --channel
|
- --property
|
||||||
- xfce4-panel
|
- /plugins/plugin-19/timezone
|
||||||
- --property
|
- --create
|
||||||
- /plugins/plugin-19/timezone
|
- --type
|
||||||
- --create
|
- string
|
||||||
- --type
|
- --set
|
||||||
- string
|
- Pacific/Auckland
|
||||||
- --set
|
"""
|
||||||
- Pacific/Auckland
|
|
||||||
'''
|
|
||||||
|
|
||||||
from ansible_collections.community.general.plugins.module_utils.module_helper import StateModuleHelper
|
from ansible_collections.community.general.plugins.module_utils.module_helper import StateModuleHelper
|
||||||
from ansible_collections.community.general.plugins.module_utils.xfconf import xfconf_runner
|
from ansible_collections.community.general.plugins.module_utils.xfconf import xfconf_runner
|
||||||
|
|
|
@ -7,17 +7,18 @@
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = """
|
||||||
|
---
|
||||||
module: xfconf_info
|
module: xfconf_info
|
||||||
author:
|
author:
|
||||||
- "Alexei Znamensky (@russoz)"
|
- "Alexei Znamensky (@russoz)"
|
||||||
short_description: Retrieve XFCE4 configurations
|
short_description: Retrieve XFCE4 configurations
|
||||||
version_added: 3.5.0
|
version_added: 3.5.0
|
||||||
description:
|
description:
|
||||||
- This module allows retrieving Xfce 4 configurations with the help of C(xfconf-query).
|
- This module allows retrieving Xfce 4 configurations with the help of C(xfconf-query).
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
- community.general.attributes.info_module
|
- community.general.attributes.info_module
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
version_added: 3.3.0
|
version_added: 3.3.0
|
||||||
|
@ -40,10 +41,11 @@ options:
|
||||||
- If not provided and a O(channel) is provided, then the module will list all available properties in that O(channel).
|
- If not provided and a O(channel) is provided, then the module will list all available properties in that O(channel).
|
||||||
type: str
|
type: str
|
||||||
notes:
|
notes:
|
||||||
- See man xfconf-query(1) for more details.
|
- See man xfconf-query(1) for more details.
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
|
---
|
||||||
- name: Get list of all available channels
|
- name: Get list of all available channels
|
||||||
community.general.xfconf_info: {}
|
community.general.xfconf_info: {}
|
||||||
register: result
|
register: result
|
||||||
|
@ -66,63 +68,64 @@ EXAMPLES = """
|
||||||
register: result
|
register: result
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = """
|
||||||
channels:
|
---
|
||||||
description:
|
channels:
|
||||||
- List of available channels.
|
description:
|
||||||
- Returned when the module receives no parameter at all.
|
- List of available channels.
|
||||||
returned: success
|
- Returned when the module receives no parameter at all.
|
||||||
type: list
|
returned: success
|
||||||
elements: str
|
type: list
|
||||||
sample:
|
elements: str
|
||||||
- xfce4-desktop
|
sample:
|
||||||
- displays
|
- xfce4-desktop
|
||||||
- xsettings
|
- displays
|
||||||
- xfwm4
|
- xsettings
|
||||||
properties:
|
- xfwm4
|
||||||
description:
|
properties:
|
||||||
- List of available properties for a specific channel.
|
description:
|
||||||
- Returned by passing only the O(channel) parameter to the module.
|
- List of available properties for a specific channel.
|
||||||
returned: success
|
- Returned by passing only the O(channel) parameter to the module.
|
||||||
type: list
|
returned: success
|
||||||
elements: str
|
type: list
|
||||||
sample:
|
elements: str
|
||||||
- /Gdk/WindowScalingFactor
|
sample:
|
||||||
- /Gtk/ButtonImages
|
- /Gdk/WindowScalingFactor
|
||||||
- /Gtk/CursorThemeSize
|
- /Gtk/ButtonImages
|
||||||
- /Gtk/DecorationLayout
|
- /Gtk/CursorThemeSize
|
||||||
- /Gtk/FontName
|
- /Gtk/DecorationLayout
|
||||||
- /Gtk/MenuImages
|
- /Gtk/FontName
|
||||||
- /Gtk/MonospaceFontName
|
- /Gtk/MenuImages
|
||||||
- /Net/DoubleClickTime
|
- /Gtk/MonospaceFontName
|
||||||
- /Net/IconThemeName
|
- /Net/DoubleClickTime
|
||||||
- /Net/ThemeName
|
- /Net/IconThemeName
|
||||||
- /Xft/Antialias
|
- /Net/ThemeName
|
||||||
- /Xft/Hinting
|
- /Xft/Antialias
|
||||||
- /Xft/HintStyle
|
- /Xft/Hinting
|
||||||
- /Xft/RGBA
|
- /Xft/HintStyle
|
||||||
is_array:
|
- /Xft/RGBA
|
||||||
description:
|
is_array:
|
||||||
- Flag indicating whether the property is an array or not.
|
description:
|
||||||
returned: success
|
- Flag indicating whether the property is an array or not.
|
||||||
type: bool
|
returned: success
|
||||||
value:
|
type: bool
|
||||||
description:
|
value:
|
||||||
- The value of the property. Empty if the property is of array type.
|
description:
|
||||||
returned: success
|
- The value of the property. Empty if the property is of array type.
|
||||||
type: str
|
returned: success
|
||||||
sample: Monospace 10
|
type: str
|
||||||
value_array:
|
sample: Monospace 10
|
||||||
description:
|
value_array:
|
||||||
- The array value of the property. Empty if the property is not of array type.
|
description:
|
||||||
returned: success
|
- The array value of the property. Empty if the property is not of array type.
|
||||||
type: list
|
returned: success
|
||||||
elements: str
|
type: list
|
||||||
sample:
|
elements: str
|
||||||
- Main
|
sample:
|
||||||
- Work
|
- Main
|
||||||
- Tmp
|
- Work
|
||||||
'''
|
- Tmp
|
||||||
|
"""
|
||||||
|
|
||||||
from ansible_collections.community.general.plugins.module_utils.module_helper import ModuleHelper
|
from ansible_collections.community.general.plugins.module_utils.module_helper import ModuleHelper
|
||||||
from ansible_collections.community.general.plugins.module_utils.xfconf import xfconf_runner
|
from ansible_collections.community.general.plugins.module_utils.xfconf import xfconf_runner
|
||||||
|
|
Loading…
Add table
Reference in a new issue