From 4e442f4bcf04a68f638393d180ac7664ddd0fe4b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 30 Mar 2014 16:53:31 -0400 Subject: tweaks --- Propellor.hs | 13 ++++++------- Property/User.hs | 6 ++++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Propellor.hs b/Propellor.hs index ad838a1b..421df2c4 100644 --- a/Propellor.hs +++ b/Propellor.hs @@ -61,16 +61,15 @@ standardSystem suite = propertyList "standard system" -- Clean up a system as installed by cloudatcost.com cleanCloudAtCost :: HostName -> Property cleanCloudAtCost hostname = propertyList "cloudatcost cleanup" - [ User.nuked "user" - , Hostname.set hostname + [ Hostname.set hostname , Ssh.uniqueHostKeys , "worked around grub/lvm boot bug #743126" ==> "/etc/default/grub" `File.containsLine` "GRUB_DISABLE_LINUX_UUID=true" `onChange` cmdProperty "update-grub" [] `onChange` cmdProperty "update-initramfs" [Param "-u"] - , "nuked cloudatcost cruft" ==> - combineProperties - [ File.notPresent "/etc/rc.local" - , File.notPresent "/etc/init.d/S97-setup.sh" - ] + , "nuked cloudatcost cruft" ==> combineProperties + [ File.notPresent "/etc/rc.local" + , File.notPresent "/etc/init.d/S97-setup.sh" + , User.nuked "user" User.YesReallyDeleteHome + ] ] diff --git a/Property/User.hs b/Property/User.hs index 8903a9e7..58bfa37a 100644 --- a/Property/User.hs +++ b/Property/User.hs @@ -6,6 +6,8 @@ import Common type UserName = String +data Eep = YesReallyDeleteHome + sshAccountFor :: UserName -> Property sshAccountFor user = check (isNothing <$> homedir user) $ cmdProperty "adduser" [ Param "--disabled-password" @@ -15,8 +17,8 @@ sshAccountFor user = check (isNothing <$> homedir user) $ cmdProperty "adduser" `describe` ("ssh account " ++ user) {- Removes user home directory!! Use with caution. -} -nuked :: UserName -> Property -nuked user = check (isJust <$> homedir user) $ cmdProperty "userdel" +nuked :: UserName -> Eep -> Property +nuked user _ = check (isJust <$> homedir user) $ cmdProperty "userdel" [ Param "-r" , Param user ] -- cgit v1.2.3