From b5e8c6b7fe9aad41c6200cb771b3c5cd230a5f56 Mon Sep 17 00:00:00 2001 From: Jussi Eronen Date: Tue, 8 Feb 2011 17:29:08 +0200 Subject: [PATCH] Added module for doing gconf changes, originally developed by Ossi. --- gnome/manifests/init.pp | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 gnome/manifests/init.pp diff --git a/gnome/manifests/init.pp b/gnome/manifests/init.pp new file mode 100644 index 0000000..5437a68 --- /dev/null +++ b/gnome/manifests/init.pp @@ -0,0 +1,45 @@ +# Set GNOME gconf values. +# +# === Parameters +# +# $name: +# Key to update +# $value: +# Value for given key +# $source: +# Source to update. Valid values are "default" and "mandatory", +# defaults to "default". +# $type: +# Value type. Valid values are "string" and "int", defaults to +# string. +# +define gnome::gconf($value, $source = "default", $type = "string", $ltype = "") { + + case $source { + "mandatory": { + $xml = "/etc/gconf/gconf.xml.mandatory" + } + "default": { + $xml = "/etc/gconf/gconf.xml.defaults" + } + default: { + fail("Invalid gnome::gconf source.") + } + } + + case $ltype { + "string": { + $param = "--list-type 'string'" + } + + default: { + $param = "" + } + } + + exec { "gconftool-2 --direct --config-source xml:readwrite:${xml} --type ${type} $param --set '${name}' '${value}'": + path => "/bin:/usr/bin:/sbin:/usr/sbin", + unless => "test \"`gconftool-2 --direct --config-source xml:readwrite:${xml} --get '${name}'`\" = '${value}'", + } + +}