aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-05-30 11:01:17 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-05-30 11:01:17 -0300
commit70ef8c84b32bc67be37f616496e0f7af5da3df54 (patch)
tree0406d5360d7ae806cf02eb8bfc5e66678bf9d797 /manifests
parent2c75c692751b2b85458ccfd8499dff5129810f87 (diff)
downloadpuppet-nodo-70ef8c84b32bc67be37f616496e0f7af5da3df54.tar.gz
puppet-nodo-70ef8c84b32bc67be37f616496e0f7af5da3df54.tar.bz2
Enhance laptop battery support
Diffstat (limited to 'manifests')
-rw-r--r--manifests/subsystem/power/tlp.pp12
-rw-r--r--manifests/utils/laptop/debian.pp1
-rw-r--r--manifests/utils/laptop/mode_tools.pp8
-rw-r--r--manifests/utils/laptop/thinkpad/battery.pp18
-rw-r--r--manifests/utils/laptop/tlp.pp25
5 files changed, 45 insertions, 19 deletions
diff --git a/manifests/subsystem/power/tlp.pp b/manifests/subsystem/power/tlp.pp
new file mode 100644
index 0000000..1c07d1c
--- /dev/null
+++ b/manifests/subsystem/power/tlp.pp
@@ -0,0 +1,12 @@
+class nodo::subsystem::power::tlp {
+ include nodo::utils::laptop::tlp
+
+ file { '/etc/default/tlp':
+ ensure => present,
+ owner => 'root',
+ group => 'root',
+ mode => '0644',
+ source => 'puppet:///modules/nodo/etc/default/tlp',
+ require => Package['tlp'],
+ }
+}
diff --git a/manifests/utils/laptop/debian.pp b/manifests/utils/laptop/debian.pp
index d45ec4c..9b34eb5 100644
--- a/manifests/utils/laptop/debian.pp
+++ b/manifests/utils/laptop/debian.pp
@@ -6,7 +6,6 @@ class nodo::utils::laptop::debian {
package { [
'cpufrequtils',
'acpi-support',
- 'laptop-mode-tools',
]:
ensure => installed,
}
diff --git a/manifests/utils/laptop/mode_tools.pp b/manifests/utils/laptop/mode_tools.pp
new file mode 100644
index 0000000..5937378
--- /dev/null
+++ b/manifests/utils/laptop/mode_tools.pp
@@ -0,0 +1,8 @@
+# Conflicts with TLP
+class nodo::utils::laptop::mode_tools(
+ $ensure = 'installed',
+) {
+ package { 'laptop-mode-tools':
+ ensure => $ensure,
+ }
+}
diff --git a/manifests/utils/laptop/thinkpad/battery.pp b/manifests/utils/laptop/thinkpad/battery.pp
deleted file mode 100644
index ecf4649..0000000
--- a/manifests/utils/laptop/thinkpad/battery.pp
+++ /dev/null
@@ -1,18 +0,0 @@
-# apci-call or tp-smapi available
-# https://www.thinkwiki.org/wiki/Tp_smapi
-class nodo::utils::laptop::thinkpad::battery(
- $implementation = 'acpi-call',
- $ensure = 'installed',
-) {
- package { [
- 'tlp',
- ]:
- ensure => $ensure,
- }
-
- package { [
- "${implementation}-dkms",
- ]:
- ensure => $ensure,
- }
-}
diff --git a/manifests/utils/laptop/tlp.pp b/manifests/utils/laptop/tlp.pp
new file mode 100644
index 0000000..47e1712
--- /dev/null
+++ b/manifests/utils/laptop/tlp.pp
@@ -0,0 +1,25 @@
+# See https://www.thinkwiki.org/wiki/Tp_smapi
+# Support available apci-call or tp-smapi
+# Conflicts with laptop-mode-tools from nodo::utils::laptop::mode_tools
+class nodo::utils::laptop::tlp(
+ $implementation = 'acpi-call',
+ $ensure = 'installed',
+) {
+ package { [
+ 'tlp',
+ ]:
+ ensure => $ensure,
+ }
+
+ package { [
+ "${implementation}-dkms",
+ ]:
+ ensure => $ensure,
+ }
+
+ # This package requires network-manager, which
+ # conflicts with wicd.
+ package { 'tlp-rdw':
+ ensure => absent,
+ }
+}