From fe584a7ee1f316c4fdef3988d50138cae693b674 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 9 Sep 2018 16:17:23 -0400 Subject: propellor spin --- joeyconfig.hs | 2 +- src/Propellor/Property/SiteSpecific/JoeySites.hs | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/joeyconfig.hs b/joeyconfig.hs index a125d0b0..72b79e53 100644 --- a/joeyconfig.hs +++ b/joeyconfig.hs @@ -85,7 +85,7 @@ darkstar = host "darkstar.kitenet.net" $ props & imageBuiltFor honeybee (RawDiskImage "/srv/honeybee.img") (Debootstrapped mempty) - & imageBuiltFor banana + ! imageBuiltFor banana (RawDiskImage "/srv/banana.img") (Debootstrapped mempty) diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index b8010790..e3f672b7 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -1103,7 +1103,7 @@ homeRouter = propertyList "home router" $ props ] `before` File.hasPrivContent "/etc/ppp/pap-secrets" (Context "joeyh@arczip.com") --- | Enable IP masqerading, on whatever other interfaces come up than the +-- | Enable IP masqerading, on whatever other interfaces come up, besides the -- provided intif. ipmasq :: String -> Property DebianLike ipmasq intif = File.hasContent ifupscript @@ -1119,6 +1119,7 @@ ipmasq intif = File.hasContent ifupscript , "echo 1 > /proc/sys/net/ipv4/ip_forward" ] `before` scriptmode ifupscript + `before` File.dirExists (takeDirectory pppupscript) `before` File.hasContent pppupscript [ "#!/bin/sh" , "IFACE=$PPP_IFACE " ++ ifupscript @@ -1181,11 +1182,12 @@ devSoftware = Apt.installed ] cubieTruckOneWire :: Property DebianLike -cubieTruckOneWire = - File.hasContent "/etc/easy-peasy-devicetree-squeezy/my.dts" mydts - `onChange` utilitysetup - `requires` utilityinstalled +cubieTruckOneWire = dtsinstalled + `onChange` utilitysetup + `requires` utilityinstalled where + dtsinstalled = File.hasContent "/etc/easy-peasy-devicetree-squeezy/my.dts" mydts + `requires` File.dirExists "/etc/easy-peasy-devicetree-squeezy" utilityinstalled = Git.cloned (User "root") "https://git.joeyh.name/git/easy-peasy-devicetree-squeezy.git" "/usr/local/easy-peasy-devicetree-squeezy" Nothing `onChange` File.isSymlinkedTo "/usr/local/bin/easy-peasy-devicetree-squeezy" (File.LinkTarget "/usr/local/easy-peasy-devicetree-squeezy/easy-peasy-devicetree-squeezy") utilitysetup = cmdProperty "easy-peasy-devicetree-squeezy" @@ -1236,7 +1238,7 @@ newtype USBHubPort = USBHubPort Int autoMountDrive :: Mount.Label -> USBHubPort -> Maybe FilePath -> Property DebianLike autoMountDrive label (USBHubPort port) malias = propertyList desc $ props & File.ownerGroup mountpoint (User "joey") (Group "joey") - & File.dirExists mountpoint + `requires` File.dirExists mountpoint & case malias of Just t -> ("/media/joey/" ++ t) `File.isSymlinkedTo` File.LinkTarget mountpoint -- cgit v1.2.3