??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
ó
àUdac @` s d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
Z
d d l Z d Z
y d d l Z e Z Wn# e k
r« e j ƒ Z
e Z n Xd d l m Z m Z d
e f d „ ƒ YZ d e f d „ ƒ YZ d „ Z e d k r
e ƒ n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bysñ
module: dconf
author:
- "Branko Majic (@azaghal)"
short_description: Modify and read dconf database
description:
- This module allows modifications and reading of dconf database. The module
is implemented as a wrapper around dconf tool. Please see the dconf(1) man
page for more details.
- Since C(dconf) requires a running D-Bus session to change values, the module
will try to detect an existing session and reuse it, or run the tool via
C(dbus-run-session).
notes:
- This module depends on C(psutil) Python library (version 4.0.0 and upwards),
C(dconf), C(dbus-send), and C(dbus-run-session) binaries. Depending on
distribution you are using, you may need to install additional packages to
have these available.
- Detection of existing, running D-Bus session, required to change settings
via C(dconf), is not 100% reliable due to implementation details of D-Bus
daemon itself. This might lead to running applications not picking-up
changes on the fly if options are changed via Ansible and
C(dbus-run-session).
- Keep in mind that the C(dconf) CLI tool, which this module wraps around,
utilises an unusual syntax for the values (GVariant). For example, if you
wanted to provide a string value, the correct syntax would be
C(value="'myvalue'") - with single quotes as part of the Ansible parameter
value.
- When using loops in combination with a value like
:code:`"[('xkb', 'us'), ('xkb', 'se')]"`, you need to be aware of possible
type conversions. Applying a filter :code:`"{{ item.value | string }}"`
to the parameter variable can avoid potential conversion problems.
- The easiest way to figure out exact syntax/value you need to provide for a
key is by making the configuration change in application affected by the
key, and then having a look at value set via commands C(dconf dump
/path/to/dir/) or C(dconf read /path/to/key).
version_added: "2.4"
options:
key:
required: true
description:
- A dconf key to modify or read from the dconf database.
value:
required: false
description:
- Value to set for the specified dconf key. Value should be specified in
GVariant format. Due to complexity of this format, it is best to have a
look at existing values in the dconf database. Required for
C(state=present).
state:
required: false
default: present
choices:
- read
- present
- absent
description:
- The action to take upon the key/value.
s
value:
description: value associated with the requested key
returned: success, state was "read"
type: str
sample: "'Default'"
s7
- name: Configure available keyboard layouts in Gnome
dconf:
key: "/org/gnome/desktop/input-sources/sources"
value: "[('xkb', 'us'), ('xkb', 'se')]"
state: present
- name: Read currently available keyboard layouts in Gnome
dconf:
key: "/org/gnome/desktop/input-sources/sources"
state: read
register: keyboard_layouts
- name: Reset the available keyboard layouts in Gnome
dconf:
key: "/org/gnome/desktop/input-sources/sources"
state: absent
- name: Configure available keyboard layouts in Cinnamon
dconf:
key: "/org/gnome/libgnomekbd/keyboard/layouts"
value: "['us', 'se']"
state: present
- name: Read currently available keyboard layouts in Cinnamon
dconf:
key: "/org/gnome/libgnomekbd/keyboard/layouts"
state: read
register: keyboard_layouts
- name: Reset the available keyboard layouts in Cinnamon
dconf:
key: "/org/gnome/libgnomekbd/keyboard/layouts"
state: absent
- name: Disable desktop effects in Cinnamon
dconf:
key: "/org/cinnamon/desktop-effects"
value: "false"
state: present
N( t
AnsibleModulet missing_required_libt DBusWrapperc B` s) e Z d Z d „ Z d „ Z d „ Z RS( ss
Helper class that can be used for running a command with a working D-Bus
session.
If possible, command will be run against an existing D-Bus session,
otherwise the session will be spawned via dbus-run-session.
Example usage:
dbus_wrapper = DBusWrapper(ansible_module)
dbus_wrapper.run_command(["printenv", "DBUS_SESSION_BUS_ADDRESS"])
c C` sD | | _ | j ƒ | _ | j d k r@ | j j d d t ƒn d S( sµ
Initialises an instance of the class.
:param module: Ansible module instance used to signal failures and run commands.
:type module: AnsibleModule
s dbus-run-sessiont requiredN( t modulet _get_existing_dbus_sessiont dbus_session_bus_addresst Nonet get_bin_patht True( t selfR ( ( s@ /usr/lib/python2.7/site-packages/ansible/modules/system/dconf.pyt __init__™ s c C` s' t j ƒ } | j j d | ƒ xð t j ƒ D]â } t j | ƒ } | j ƒ \ } } } y¡ | | k r÷ d | j ƒ k r÷ | j ƒ d } | j j d | ƒ d d | d d d g } | j j | ƒ \ } } } | d k r÷ | j j d
| ƒ | Sn Wq- t j
k
rq- Xq- W| j j d ƒ d S(
s¿
Detects and returns an existing D-Bus session bus address.
:returns: string -- D-Bus session bus address. If a running D-Bus session was not detected, returns None.
s9 Trying to detect existing D-Bus user session for user: %dt DBUS_SESSION_BUS_ADDRESSs1 Found D-Bus user session candidate at address: %ss dbus-sends --address=%ss
--type=signalt /s com.example.testi s> Verified D-Bus user session candidate as usable at address: %ssD Failed to find running D-Bus user session, will use dbus-run-sessionN( t ost getuidR t debugt psutilt pidst Processt uidst environt run_commandt AccessDeniedR ( R t uidt pidt processt process_real_uidt _t" dbus_session_bus_address_candidatet commandt rc( ( s@ /usr/lib/python2.7/site-packages/ansible/modules/system/dconf.pyR
¬ s$ c C` s½ | j d k r | j j d ƒ d g | } | j j | ƒ \ } } } | j d k r° | d k r° | j j d d | ƒ q° n1 i | j d 6} | j j | d | ƒ\ } } } | | | f S( sþ
Runs the specified command within a functional D-Bus session. Command is
effectively passed-on to AnsibleModule.run_command() method, with
modification for using dbus-run-session if necessary.
:param command: Command to run, including parameters. Each element of the list should be a string.
:type module: list
:returns: tuple(result_code, standard_output, standard_error) -- Result code, standard output, and standard error from running the command.
s4 Using dbus-run-session wrapper for running commands.s dbus-run-sessioni t msgsM Failed to run passed-in command, dbus-run-session faced an internal error: %sR t environ_updateN( R R R R R t fail_json( R R&