From 934910052c5a03785fb3a5c99f04a3919921e06c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 6 Jun 2014 21:40:31 -0400 Subject: propellor spin --- config-joey.hs | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'config-joey.hs') diff --git a/config-joey.hs b/config-joey.hs index 2dcbf9b4..31ca807b 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -179,7 +179,6 @@ hosts = -- (o) ` & Apt.installed ["git-annex"] & Docker.configured - ! Docker.docked hosts "voltagex" & Docker.garbageCollected `period` (Weekly (Just 1)) --' __|II| ,. @@ -231,15 +230,6 @@ hosts = -- (o) ` & Docker.volume ("/home/joey/src/git-annex:" ++ gitannexdir) -- temp for an acquantance - , standardContainer "voltagex" Stable "amd64" - & Docker.publish "22022:22" - & Docker.memory "500m" - & Docker.cpuShares 1 - & Apt.serviceInstalledRunning "ssh" - & Ssh.permitRootLogin True - & Ssh.passwordAuthentication True - & User.hasSomePassword "root" - ] ++ monsters -- This is my standard system setup. -- cgit v1.3-2-g0d8e From d832ef93d68e3b15d71ea4cf990d94f741ca3141 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 6 Jun 2014 21:51:00 -0400 Subject: propellor spin --- config-joey.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'config-joey.hs') diff --git a/config-joey.hs b/config-joey.hs index 31ca807b..d9e23bc0 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -170,6 +170,10 @@ hosts = -- (o) ` & Hostname.sane & Postfix.satellite & Apt.unattendedUpgrades + & Ssh.hostKey SshDsa + & Ssh.hostKey SshRsa + & Ssh.hostKey SshEcdsa + & Ssh.keyImported SshRsa "joey" & alias "eubackup.kitenet.net" & Apt.installed ["obnam", "sshfs", "rsync"] -- cgit v1.3-2-g0d8e From c538426b56e7915cc0a1f00388baa31c9e88dd36 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 6 Jun 2014 22:08:52 -0400 Subject: propellor spin --- config-joey.hs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'config-joey.hs') diff --git a/config-joey.hs b/config-joey.hs index d9e23bc0..236af544 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -175,6 +175,22 @@ hosts = -- (o) ` & Ssh.hostKey SshEcdsa & Ssh.keyImported SshRsa "joey" + -- PV-grub chaining + -- http://notes.pault.ag/linode-pv-grub-chainning/ + & "/boot/grub/menu.lst" `File.hasContent` + [ "default 1" + , "timeout 30" + , "" + , "title grub-xen shim" + , "root (hd0,0)" + , "kernel /boot/xen-shim" + , "boot" + ] + & "/boot/load.cf" `File.hasContent` + [ "configfile (xen/xvda)/boot/grub/grub.cfg" ] + & Apt.installed ["grub-xen"] + & flagFile (scriptProperty ["grub-mkimage --prefix '(xen/xvda)/boot/grub' -c /boot/load.cf -O x86_64-xen /usr/lib/grub/x86_64-xen/*.mod > /boot/xen-shim"]) "/boot/xen-shim" + & alias "eubackup.kitenet.net" & Apt.installed ["obnam", "sshfs", "rsync"] & JoeySites.githubBackup -- cgit v1.3-2-g0d8e From 0840c70d8b384aa326a129c9e65d31fe0ebca2eb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 6 Jun 2014 22:23:36 -0400 Subject: propellor spin --- config-joey.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'config-joey.hs') diff --git a/config-joey.hs b/config-joey.hs index 236af544..c08eadaf 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -177,6 +177,7 @@ hosts = -- (o) ` -- PV-grub chaining -- http://notes.pault.ag/linode-pv-grub-chainning/ + -- (Adapted to use xvda1/hd0,0 instead of xvda/hd0) & "/boot/grub/menu.lst" `File.hasContent` [ "default 1" , "timeout 30" @@ -187,9 +188,9 @@ hosts = -- (o) ` , "boot" ] & "/boot/load.cf" `File.hasContent` - [ "configfile (xen/xvda)/boot/grub/grub.cfg" ] + [ "configfile (xen/xvda1)/boot/grub/grub.cfg" ] & Apt.installed ["grub-xen"] - & flagFile (scriptProperty ["grub-mkimage --prefix '(xen/xvda)/boot/grub' -c /boot/load.cf -O x86_64-xen /usr/lib/grub/x86_64-xen/*.mod > /boot/xen-shim"]) "/boot/xen-shim" + & flagFile (scriptProperty ["update-grub; grub-mkimage --prefix '(xen/xvda1)/boot/grub' -c /boot/load.cf -O x86_64-xen /usr/lib/grub/x86_64-xen/*.mod > /boot/xen-shim"]) "/boot/xen-shim" & alias "eubackup.kitenet.net" & Apt.installed ["obnam", "sshfs", "rsync"] -- cgit v1.3-2-g0d8e From 6fc6d54f8a8b6cff9da2f51dc50d29efbada3d5a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 6 Jun 2014 22:46:31 -0400 Subject: propellor spin --- config-joey.hs | 1 + src/Propellor/Property/SiteSpecific/JoeySites.hs | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'config-joey.hs') diff --git a/config-joey.hs b/config-joey.hs index c08eadaf..74ad9e9a 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -195,6 +195,7 @@ hosts = -- (o) ` & alias "eubackup.kitenet.net" & Apt.installed ["obnam", "sshfs", "rsync"] & JoeySites.githubBackup + & JoeySites.obnamRepos ["wren", "pell"] & alias "podcatcher.kitenet.net" & Apt.installed ["git-annex"] diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index b44401ea..c66c167d 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -338,3 +338,14 @@ githubBackup = propertyList "github-backup box" in File.hasPrivContent f `onChange` File.ownerGroup f "joey" "joey" ] + +obnamRepos :: [String] -> Property +obnamRepos rs = propertyList ("obnam repos for " ++ unwords rs) + (mkbase : map mkrepo rs) + where + mkbase = mkdir "/home/joey/lib" + `before` mkdir "/home/joey/backup" + mkrepo r = mkdir ("/home/joey/lib/nackup/" ++ r ++ ".obnam") + mkdir d = File.dirExists d + `before` File.ownerGroup "joey" "joey" d + -- cgit v1.3-2-g0d8e From 969db1ed56157aa202359c0f47fff783baba6eac Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 Jun 2014 00:07:08 -0400 Subject: when ssh key data is missing, allow both error messages to be printed --- config-joey.hs | 1 + src/Propellor/Property.hs | 9 +++++++++ src/Propellor/Property/Ssh.hs | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'config-joey.hs') diff --git a/config-joey.hs b/config-joey.hs index 74ad9e9a..63768eeb 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -196,6 +196,7 @@ hosts = -- (o) ` & Apt.installed ["obnam", "sshfs", "rsync"] & JoeySites.githubBackup & JoeySites.obnamRepos ["wren", "pell"] + & Ssh.knownHost hosts "usw-s002.rsync.net" "joey" & alias "podcatcher.kitenet.net" & Apt.installed ["git-annex"] diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs index e3d46eae..c7a03765 100644 --- a/src/Propellor/Property.hs +++ b/src/Propellor/Property.hs @@ -37,6 +37,15 @@ combineProperties desc ps = Property desc (go ps NoChange) (combineAttrs ps) FailedChange -> return FailedChange _ -> go ls (r <> rs) +-- | Does not stop on failure (but does propigate failure at the end). +combineProperties' :: Desc -> [Property] -> Property +combineProperties' desc ps = Property desc (go ps NoChange) (combineAttrs ps) + where + go [] rs = return rs + go (l:ls) rs = do + r <- ensureProperty l + go ls (r <> rs) + -- | Combines together two properties, resulting in one property -- that ensures the first, and if the first succeeds, ensures the second. -- The property uses the description of the first property. diff --git a/src/Propellor/Property/Ssh.hs b/src/Propellor/Property/Ssh.hs index 061f440c..ba0311cc 100644 --- a/src/Propellor/Property/Ssh.hs +++ b/src/Propellor/Property/Ssh.hs @@ -97,7 +97,7 @@ hostKey keytype = combineProperties desc -- | Sets up a user with a ssh private key and public key pair -- from the site's PrivData. keyImported :: SshKeyType -> UserName -> Property -keyImported keytype user = combineProperties desc +keyImported keytype user = combineProperties' desc [ property desc (install writeFile (SshPubKey keytype user) ".pub") , property desc (install writeFileProtected (SshPrivKey keytype user) "") ] -- cgit v1.3-2-g0d8e