summaryrefslogtreecommitdiff
path: root/src/Propellor/Property
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Property')
-rw-r--r--src/Propellor/Property/Apt.hs6
-rw-r--r--src/Propellor/Property/Machine.hs2
-rw-r--r--src/Propellor/Property/SiteSpecific/JoeySites.hs30
3 files changed, 34 insertions, 4 deletions
diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs
index 7275205a..5080b1e2 100644
--- a/src/Propellor/Property/Apt.hs
+++ b/src/Propellor/Property/Apt.hs
@@ -88,6 +88,8 @@ binandsrc :: String -> SourcesGenerator
binandsrc url suite = catMaybes
[ Just l
, Just $ srcLine l
+ , sul
+ , srcLine <$> sul
, bl
, srcLine <$> bl
]
@@ -96,6 +98,10 @@ binandsrc url suite = catMaybes
bl = do
bs <- backportSuite suite
return $ debLine bs url stdSections
+ -- formerly known as 'volatile'
+ sul = do
+ sus <- stableUpdatesSuite suite
+ return $ debLine sus url stdSections
stdArchiveLines :: Propellor SourcesGenerator
stdArchiveLines = return . binandsrc =<< getMirror
diff --git a/src/Propellor/Property/Machine.hs b/src/Propellor/Property/Machine.hs
index 0fe172b5..698c7717 100644
--- a/src/Propellor/Property/Machine.hs
+++ b/src/Propellor/Property/Machine.hs
@@ -48,10 +48,10 @@ module Propellor.Property.Machine (
marvell_SheevaPlug,
cubietech_Cubietruck,
olimex_A10_OLinuXino_LIME,
+ lemaker_Banana_Pi,
-- * ARM boards (untested)
cubietech_Cubieboard,
cubietech_Cubieboard2,
- lemaker_Banana_Pi,
lemaker_Banana_Pro,
olimex_A10s_OLinuXino_Micro,
olimex_A20_OLinuXino_LIME,
diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs
index 8aa2f3bd..7d2ae9df 100644
--- a/src/Propellor/Property/SiteSpecific/JoeySites.hs
+++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs
@@ -15,6 +15,7 @@ import qualified Propellor.Property.Git as Git
import qualified Propellor.Property.Cron as Cron
import qualified Propellor.Property.Service as Service
import qualified Propellor.Property.User as User
+import qualified Propellor.Property.Group as Group
import qualified Propellor.Property.Borg as Borg
import qualified Propellor.Property.Apache as Apache
import qualified Propellor.Property.Postfix as Postfix
@@ -916,10 +917,15 @@ homePowerMonitor user hosts ctx sshkey = propertyList "home power monitor" $ pro
& File.ownerGroup "/var/www/html" user (userGroup user)
& Git.cloned user "git://git.kitenet.net/joey/homepower" d Nothing
& buildpoller
+ & Systemd.enabled setupservicename
+ `requires` setupserviceinstalled
+ `onChange` Systemd.started setupservicename
& Systemd.enabled servicename
`requires` serviceinstalled
`onChange` Systemd.started servicename
& User.hasGroup user (Group "dialout")
+ & Group.exists (Group "gpio") Nothing
+ & User.hasGroup user (Group "gpio")
& Cron.niceJob "homepower upload"
(Cron.Times "1 * * * *") user d rsynccommand
`requires` Ssh.userKeyAt (Just sshkeyfile) user ctx sshkey
@@ -951,6 +957,23 @@ homePowerMonitor user hosts ctx sshkey = propertyList "home power monitor" $ pro
, "[Install]"
, "WantedBy=multi-user.target"
]
+ setupservicename = "homepower-setup"
+ setupservicefile = "/etc/systemd/system/" ++ setupservicename ++ ".service"
+ setupserviceinstalled = setupservicefile `File.hasContent`
+ [ "[Unit]"
+ , "Description=home power monitor setup"
+ , ""
+ , "[Service]"
+ , "ExecStart=" ++ d ++ "/setup"
+ , "WorkingDirectory=" ++ d
+ , "User=root"
+ , "Group=root"
+ , "Type=oneshot"
+ , ""
+ , "[Install]"
+ , "WantedBy=multi-user.target"
+ , "WantedBy=homepower.target"
+ ]
-- Any changes to the rsync command will need my .authorized_keys
-- rsync server command to be updated too.
rsynccommand = "rsync -e 'ssh -i" ++ sshkeyfile ++ "' -avz rrds/recent/ joey@kitenet.net:/srv/web/homepower.joeyh.name/rrds/recent/"
@@ -987,6 +1010,7 @@ homeRouter = propertyList "home router" $ props
, "dhcp-range=10.1.1.100,10.1.1.150,24h"
, "no-hosts"
, "address=/honeybee.kitenet.net/10.1.1.1"
+ , "address=/house.kitenet.net/10.1.1.1"
]
`onChange` Service.restarted "dnsmasq"
& ipmasq "wlan0"
@@ -1097,13 +1121,13 @@ cubieTruckOneWire =
["--debian", "sun7i-a20-cubietruck"]
`assume` MadeChange
mydts =
- [ "/* Device tree addition enabling onewire sensors on CubieTruck GPIO pin PG8 */"
+ [ "/* Device tree addition enabling onewire sensors on CubieTruck GPIO pin PC21 */"
, "#include <dt-bindings/gpio/gpio.h>"
, ""
, "/ {"
, "\tonewire_device {"
, "\t\tcompatible = \"w1-gpio\";"
- , "\t\tgpios = <&pio 6 8 GPIO_ACTIVE_HIGH>; /* PG8 */"
+ , "\t\tgpios = <&pio 2 21 GPIO_ACTIVE_HIGH>; /* PC21 */"
, "\t\tpinctrl-names = \"default\";"
, "\t\tpinctrl-0 = <&my_w1_pin>;"
, "\t};"
@@ -1111,7 +1135,7 @@ cubieTruckOneWire =
, ""
, "&pio {"
, "\tmy_w1_pin: my_w1_pin@0 {"
- , "\t\tallwinner,pins = \"PG8\";"
+ , "\t\tallwinner,pins = \"PC21\";"
, "\t\tallwinner,function = \"gpio_in\";"
, "\t};"
, "};"