Skip to content

Commit d4422e0

Browse files
glennmorrisjhoblitt
authored andcommitted
(profile::ccs::autologout) new
1 parent 52c9918 commit d4422e0

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# @summary
2+
# Enable automatic logout for gnome sessions.
3+
#
4+
class profile::ccs::autologout {
5+
$dconf_power = 'org/gnome/settings-daemon/plugins/power'
6+
$dconf_sleep = 'sleep-inactive-ac'
7+
8+
## Cannot lock -type, since need to change it for the ccs user.
9+
dconf::settings { 'gnome power inactive-ac':
10+
settings_hash => {
11+
$dconf_power => {
12+
"${dconf_sleep}-timeout" => { 'value' => 900, 'lock' => true },
13+
"${dconf_sleep}-type" => { 'value' => "'logout'", 'lock' => false },
14+
},
15+
},
16+
}
17+
18+
## Set sleep-inactive-ac-type='nothing' for the CCS user.
19+
$ccs_user = 'ccs'
20+
21+
exec { 'ccs dconf disable autologout':
22+
path => ['/usr/bin/'],
23+
command => "dbus-launch dconf write /${dconf_sleep}-type \"'nothing'\"",
24+
user => $ccs_user,
25+
unless => "dconf read /${dconf_sleep}-type | grep -q nothing",
26+
}
27+
}

0 commit comments

Comments
 (0)