From 879abc3e7c8d8ee27ea887ffdd5639096760c5bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 12 Jan 2022 03:53:05 +0100 Subject: Add profile non-laptop. --- manifests/nonlaptop.pp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 manifests/nonlaptop.pp (limited to 'manifests/nonlaptop.pp') diff --git a/manifests/nonlaptop.pp b/manifests/nonlaptop.pp new file mode 100644 index 0000000..8a917d2 --- /dev/null +++ b/manifests/nonlaptop.pp @@ -0,0 +1,23 @@ +# For laptops which now work as stationary workstations/servers +class profiles::nonlaptop ( + Boolean $dock = false, +) { + ini_setting { 'Disable lid switch': + ensure => present, + path => '/etc/systemd/logind.conf', + section => 'Login', + setting => 'HandleLidSwitch', + value => if $dock { 'suspend' } else { 'ignore' }, + } + + if ($dock) { + ini_setting { 'Disable lid switch when docked': + ensure => present, + path => '/etc/systemd/logind.conf', + section => 'Login', + setting => 'HandleLidSwitchDocked', + value => 'ignore', + } + } + +} -- cgit v1.2.3