diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-12-05 17:52:43 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-12-05 17:53:16 -0400 |
| commit | 12548bae3d8feecce6a322162d91b827289ae824 (patch) | |
| tree | 45f5ec5131817aab5133c9c1e4dbcf3364953e76 /src/Propellor/Property/SiteSpecific/JoeySites.hs | |
| parent | b816e40e2618a8932144bceb7c7039adc5c44c11 (diff) | |
UncheckedProperty for cmdProperty et al
* Properties that run an arbitrary command, such as cmdProperty
and scriptProperty are converted to use UncheckedProperty, since
they cannot tell on their own if the command truely made a change or not.
(API Change)
Transition guide:
- When GHC complains about an UncheckedProperty, add:
`assume` MadeChange
- Since these properties used to always return MadeChange, that
change is always safe to make.
- Or, if you know that the command should modifiy a file, use:
`changesFile` filename
* A few properties have had their Result improved, for example
Apt.buldDep and Apt.autoRemove now check if a change was made or not.
Diffstat (limited to 'src/Propellor/Property/SiteSpecific/JoeySites.hs')
| -rw-r--r-- | src/Propellor/Property/SiteSpecific/JoeySites.hs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index ff92bf2d..732714db 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -39,6 +39,7 @@ scrollBox = propertyList "scroll server" $ props , "cabal configure" , "make" ] + `assume` MadeChange & s `File.hasContent` [ "#!/bin/sh" , "set -e" @@ -165,7 +166,9 @@ oldUseNetInstalled pkg = check (not <$> Apt.isInstalled pkg) $ , "dpkg -i ../" ++ pkg ++ "_*.deb || true" , "apt-get -fy install" -- dependencies , "rm -rf /root/tmp/oldusenet" - ] `describe` "olduse.net built" + ] + `assume` MadeChange + `describe` "olduse.net built" kgbServer :: Property HasInfo kgbServer = propertyList desc $ props @@ -197,7 +200,8 @@ mumbleServer hosts = combineProperties hn $ props (Context hn) (SshRsa, "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSXXSM3mM8SNu+qel9R/LkDIkjpV3bfpUtRtYv2PTNqicHP+DdoThrr0ColFCtLH+k2vQJvR2n8uMzHn53Dq2IO3TtD27+7rJSsJwAZ8oftNzuTir8IjAwX5g6JYJs+L0Ny4RB0ausd+An0k/CPMRl79zKxpZd2MBMDNXt8hyqu0vS0v1ohq5VBEVhBBvRvmNQvWOCj7PdrKQXpUBHruZOeVVEdUUXZkVc1H0t7LVfJnE+nGKyWbw2jM+7r3Rn5Semc4R1DxsfaF8lKkZyE88/5uZQ/ddomv8ptz6YZ5b+Bg6wfooWPC3RWAALjxnHaC2yN1VONAvHmT0uNn1o6v0b") `requires` Ssh.knownHost hosts "usw-s002.rsync.net" (User "root") - & trivial (cmdProperty "chown" ["-R", "mumble-server:mumble-server", "/var/lib/mumble-server"]) + & cmdProperty "chown" ["-R", "mumble-server:mumble-server", "/var/lib/mumble-server"] + `assume` NoChange where hn = "mumble.debian.net" sshkey = "/root/.ssh/mumble.debian.net.key" @@ -274,6 +278,7 @@ annexWebSite origin hn uuid remotes = propertyList (hn ++" website using git-ann dir = "/srv/web/" ++ hn postupdatehook = dir </> ".git/hooks/post-update" setup = userScriptProperty (User "joey") setupscript + `assume` MadeChange setupscript = [ "cd " ++ shellEscape dir , "git annex reinit " ++ shellEscape uuid @@ -393,6 +398,7 @@ twitRss = combineProperties "twitter rss" $ props [ "cd " ++ dir , "ghc --make twitRss" ] + `assume` NoChange `requires` Apt.installed [ "libghc-xml-dev" , "libghc-feed-dev" @@ -413,7 +419,8 @@ ircBouncer = propertyList "IRC bouncer" $ props & File.ownerGroup conf (User "znc") (Group "znc") & Cron.job "znconboot" (Cron.Times "@reboot") (User "znc") "~" "znc" -- ensure running if it was not already - & trivial (userScriptProperty (User "znc") ["znc || true"]) + & userScriptProperty (User "znc") ["znc || true"] + `assume` NoChange `describe` "znc running" where conf = "/home/znc/.znc/configs/znc.conf" |
