diff options
| author | Sean Whitton <spwhitton@spwhitton.name> | 2018-06-15 16:44:05 +0100 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2018-06-16 07:46:51 -0400 |
| commit | 87cfaae69f29e156a7bcb5b1924b806056c4401c (patch) | |
| tree | 5c4af2ed600a0a2c86d2cc3f654ecf179f079a6d | |
| parent | 6bbad0c9411872aa01af2babd54436590a5e3f33 (diff) | |
add EtcDefault.set
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
| -rw-r--r-- | propellor.cabal | 1 | ||||
| -rw-r--r-- | src/Propellor/Property/EtcDefault.hs | 17 |
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) |
