Hello,
I am wondering if anyone have used the above before. I have a task
that I was initially using command module but today came across above
module and decided to improve that task by using a module. The task
is to prevent desktop users using auto login as its insecure.
After starting to use the module, I have notice that I can, for
example enable screen saver, but the same task can't be able to
disable screen save, essentially simply reversing the earlier change.
What could I be doing wrong here? Or is it a bug?
This is where the screen saver changes are documented.
https://access.redhat.com/solutions/17384
The task looks like this:
- name: Enable Gnome screen saver for RHEL 6
gconftool2: direct=yes
config_source=/etc/gconf/gconf.xml.mandatory value_type=bool
state=present key=/apps/gnome-screensaver/idle_activation_enabled
value=true
when:
- ansible_distribution_major_version == "6"
When the value=true in above task, I get this:
ok: [niobium.eng.example.com] => {
"ansible_facts": {
"gconftool2": {
"changed": false,
"key": "/apps/gnome-screensaver/idle_activation_enabled",
"new_value": "true",
"playbook_value": "true",
"previous_value": "true",
"value_type": "bool"
}
},
"changed": false,
"invocation": {
"module_args": {
"config_source": "/etc/gconf/gconf.xml.mandatory",
"direct": true,
"key": "/apps/gnome-screensaver/idle_activation_enabled",
"state": "present",
"value": "true",
"value_type": "bool"
}
}
}
When I change the same task so that value=false, it fails with the error below:
/idle_activation_enabled"}}}\r\n', 'Shared connection to
niobium.eng.example.com closed.\r\n')
fatal: [niobium.eng.example.com]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"config_source": "/etc/gconf/gconf.xml.mandatory",
"direct": true,
"key": "/apps/gnome-screensaver/idle_activation_enabled",
"state": "present",
"value": "false",
"value_type": "bool"
}
},
"msg": "gconftool-2 failed with error: \n(gconftool-2:23708):
GConf-WARNING **: Failed to load source
\"/etc/gconf/gconf.xml.mandatory\": Couldn't resolve address for
configuration source: Bad address
`/etc/gconf/gconf.xml.mandatory'\nFailed to access configuration
source(s): Couldn't resolve address for configuration source: Bad
address `/etc/gconf/gconf.xml.mandatory'\n"
}
Why would this be the case? I am a bit puzzled and hope the module
dev is around to pitch in on this?
Thanks a bunch in advance.
Regards,
William