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/JoeySites.hs | |
| 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/JoeySites.hs')
| -rw-r--r-- | src/Propellor/Property/SiteSpecific/JoeySites.hs | 50 |
1 files changed, 29 insertions, 21 deletions
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" |
