summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--propellor.cabal1
-rw-r--r--src/Propellor/Property/EtcDefault.hs17
2 files changed, 18 insertions, 0 deletions
diff --git a/propellor.cabal b/propellor.cabal
index 6c8c42e1..a2a24912 100644
--- a/propellor.cabal
+++ b/propellor.cabal
@@ -79,6 +79,7 @@ Library
Propellor.Property.Dns
Propellor.Property.DnsSec
Propellor.Property.Docker
+ Propellor.Property.EtcDefault
Propellor.Property.Fail2Ban
Propellor.Property.File
Propellor.Property.Firejail
diff --git a/src/Propellor/Property/EtcDefault.hs b/src/Propellor/Property/EtcDefault.hs
new file mode 100644
index 00000000..0bda5c64
--- /dev/null
+++ b/src/Propellor/Property/EtcDefault.hs
@@ -0,0 +1,17 @@
+-- | Maintainer: Sean Whitton <spwhitton@spwhitton.name>
+
+module Propellor.Property.EtcDefault (
+ EtcDefaultFile,
+ set,
+) where
+
+import Propellor.Base
+import Propellor.Property.ConfFile
+
+-- | The name of a file in </etc/default>, without the </etc/default> prefix.
+-- E.g. @useradd@.
+type EtcDefaultFile = String
+
+-- | Set a key=value pair in a file in </etc/default>.
+set :: EtcDefaultFile -> ShellKey -> String -> Property UnixLike
+set f key value = containsShellSetting ("/etc/default" </> f) (key, value)