propellor spin
This commit is contained in:
parent
e435d97927
commit
a04539a2ee
|
@ -6,13 +6,13 @@ import qualified Propellor.Property.Apt as Apt
|
||||||
|
|
||||||
import Data.List
|
import Data.List
|
||||||
|
|
||||||
providerFor :: [UserName] -> HostName -> Property
|
providerFor :: [UserName] -> String -> Property
|
||||||
providerFor users hostname = propertyList ("openid provider") $
|
providerFor users baseurl = propertyList ("openid provider") $
|
||||||
[ serviceRunning "apache2"
|
[ serviceRunning "apache2"
|
||||||
`requires` Apt.installed ["apache2"]
|
`requires` Apt.installed ["apache2"]
|
||||||
, Apt.installed ["simpleid"]
|
, Apt.installed ["simpleid"]
|
||||||
`onChange` serviceRestarted "apache2"
|
`onChange` serviceRestarted "apache2"
|
||||||
, File.fileProperty ("simpleid host " ++ hostname)
|
, File.fileProperty ("simpleid host " ++ baseurl)
|
||||||
(map setbaseurl) "/etc/simpleid/config.inc"
|
(map setbaseurl) "/etc/simpleid/config.inc"
|
||||||
] ++ map identfile users
|
] ++ map identfile users
|
||||||
where
|
where
|
||||||
|
@ -20,5 +20,5 @@ providerFor users hostname = propertyList ("openid provider") $
|
||||||
[ "/var/lib/simpleid/identities/", u, ".identity" ]
|
[ "/var/lib/simpleid/identities/", u, ".identity" ]
|
||||||
setbaseurl l
|
setbaseurl l
|
||||||
| "SIMPLEID_BASE_URL" `isInfixOf` l =
|
| "SIMPLEID_BASE_URL" `isInfixOf` l =
|
||||||
"define('SIMPLEID_BASE_URL', 'http://"++hostname++"/simpleid');"
|
"define('SIMPLEID_BASE_URL', 'http://"++baseurl++"/simpleid');"
|
||||||
| otherwise = l
|
| otherwise = l
|
||||||
|
|
|
@ -81,7 +81,8 @@ container parenthost name
|
||||||
, Docker.inside $ props
|
, Docker.inside $ props
|
||||||
& Apt.stdSourcesList Stable
|
& Apt.stdSourcesList Stable
|
||||||
& Apt.unattendedUpgrades
|
& Apt.unattendedUpgrades
|
||||||
& OpenId.providerFor ["joey", "liw"] parenthost
|
& OpenId.providerFor ["joey", "liw"]
|
||||||
|
(parenthost++":8081")
|
||||||
]
|
]
|
||||||
|
|
||||||
-- armel builder has a companion container that run amd64 and
|
-- armel builder has a companion container that run amd64 and
|
||||||
|
|
Loading…
Reference in New Issue