diff options
| author | Sean Whitton <spwhitton@spwhitton.name> | 2017-11-19 12:04:26 -0700 |
|---|---|---|
| committer | Sean Whitton <spwhitton@spwhitton.name> | 2017-11-19 12:04:26 -0700 |
| commit | 05e5308ee7cef99b24b4f9d9755e5488f8d92a39 (patch) | |
| tree | 256b8f20bddf0f0701a3247228f9c2dd77be6e64 /src/Propellor/Property/SiteSpecific | |
| parent | 38d039310e4db6ffaf5c8ca51c339421e6865eff (diff) | |
| parent | 12beba0367d14f9c52adf72dd36e9cf5a8e35761 (diff) | |
Merge branch 'master' of https://git.joeyh.name/git/propellor into sbuild-overhaul
Diffstat (limited to 'src/Propellor/Property/SiteSpecific')
| -rw-r--r-- | src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs | 2 | ||||
| -rw-r--r-- | src/Propellor/Property/SiteSpecific/GitHome.hs | 9 | ||||
| -rw-r--r-- | src/Propellor/Property/SiteSpecific/JoeySites.hs | 50 |
3 files changed, 38 insertions, 23 deletions
diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index bd4d0928..dd1085d7 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -119,10 +119,10 @@ standardAutoBuilder :: DebianSuite -> Architecture -> Flavor -> Property (HasInf standardAutoBuilder suite arch flavor = propertyList "standard git-annex autobuilder" $ props & osDebian suite arch - & buildDepsApt & Apt.stdSourcesList & Apt.unattendedUpgrades & Apt.cacheCleaned + & buildDepsApt & User.accountFor (User builduser) & tree (architectureToDebianArchString arch) flavor diff --git a/src/Propellor/Property/SiteSpecific/GitHome.hs b/src/Propellor/Property/SiteSpecific/GitHome.hs index f14b5f12..2a66d1e2 100644 --- a/src/Propellor/Property/SiteSpecific/GitHome.hs +++ b/src/Propellor/Property/SiteSpecific/GitHome.hs @@ -20,7 +20,14 @@ installedFor user@(User u) = check (not <$> hasGitDir user) $ moveout tmpdir home , property "rmdir" $ makeChange $ void $ catchMaybeIO $ removeDirectory tmpdir - , userScriptProperty user ["rm -rf .aptitude/ .bashrc .profile; bin/mr checkout; bin/fixups"] + , userScriptProperty user ["rm -rf .aptitude/ .bashrc .profile"] + `assume` MadeChange + -- Set HOSTNAME so that this sees the right + -- hostname when run in a chroot with a different + -- hostname than the current one. + , userScriptProperty user ["HOSTNAME=$(cat /etc/hostname) bin/mr checkout"] + `assume` MadeChange + , userScriptProperty user ["bin/fixups"] `assume` MadeChange ] moveout tmpdir home = do diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 7812c855..097171a3 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -912,16 +912,20 @@ alarmClock oncalendar (User user) command = combineProperties "goodmorning timer homePowerMonitor :: IsContext c => User -> c -> (SshKeyType, Ssh.PubKeyText) -> Property (HasInfo + DebianLike) homePowerMonitor user ctx sshkey = propertyList "home power monitor" $ props & Apache.installed - & Apt.installed ["python", "python-pymodbus"] + & Apt.installed ["python", "python-pymodbus", "rrdtool"] & File.ownerGroup "/var/www/html" user (userGroup user) & Git.cloned user "git://git.kitenet.net/joey/homepower" d Nothing - `onChange` buildpoller + & buildpoller & Systemd.enabled servicename `requires` serviceinstalled `onChange` Systemd.started servicename + & User.hasGroup user (Group "dialout") & Cron.niceJob "homepower upload" (Cron.Times "1 * * * *") user d rsynccommand `requires` Ssh.userKeyAt (Just sshkeyfile) user ctx sshkey + `requires` File.ownerGroup (takeDirectory sshkeyfile) + user (userGroup user) + `requires` File.dirExists (takeDirectory sshkeyfile) where d = "/var/www/html/homepower" sshkeyfile = d </> ".ssh/key" @@ -957,30 +961,34 @@ homeRouter :: Property (HasInfo + DebianLike) homeRouter = propertyList "home router" $ props & Network.static "wlan0" (IPv4 "10.1.1.1") Nothing `requires` Network.cleanInterfacesFile - & Apt.serviceInstalledRunning "hostapd" - `requires` File.hasContent "/etc/hostapd/hostapd.conf" + & Apt.installed ["hostapd"] + & File.hasContent "/etc/hostapd/hostapd.conf" [ "interface=wlan0" , "ssid=house" , "hw_mode=g" , "channel=8" ] - `requires` File.dirExists "/lib/hostapd" - & Apt.serviceInstalledRunning "dnsmasq" - `requires` File.hasContent "/etc/dnsmasq.conf" - [ "domain-needed" - , "bogus-priv" - , "interface=wlan0" - , "domain=kitenet.net" - , "dhcp-range=10.1.1.100,10.1.1.150,24h" - , "no-hosts" - , "address=/honeybee.kitenet.net/10.1.1.1" - ] - `requires` File.hasContent "/etc/resolv.conf" - [ "domain kitenet.net" - , "search kitenet.net" - , "nameserver 8.8.8.8" - , "nameserver 8.8.4.4" - ] + `requires` File.dirExists "/etc/hostapd" + `requires` File.hasContent "/etc/default/hostapd" + [ "DAEMON_CONF=/etc/hostapd/hostapd.conf" ] + `onChange` Service.running "hostapd" + & File.hasContent "/etc/resolv.conf" + [ "domain kitenet.net" + , "search kitenet.net" + , "nameserver 8.8.8.8" + , "nameserver 8.8.4.4" + ] + & Apt.installed ["dnsmasq"] + & File.hasContent "/etc/dnsmasq.conf" + [ "domain-needed" + , "bogus-priv" + , "interface=wlan0" + , "domain=kitenet.net" + , "dhcp-range=10.1.1.100,10.1.1.150,24h" + , "no-hosts" + , "address=/honeybee.kitenet.net/10.1.1.1" + ] + `onChange` Service.restarted "dnsmasq" & ipmasq "wlan0" & Apt.serviceInstalledRunning "netplug" & Network.dhcp' "eth0" |
