Safe Haskell | None |
---|---|
Language | Haskell98 |
- withPrivData :: (IsContext c, IsPrivDataSource s) => s -> c -> (((PrivData -> Propellor Result) -> Propellor Result) -> Property) -> Property
- withSomePrivData :: (IsContext c, IsPrivDataSource s) => [s] -> c -> ((((PrivDataField, PrivData) -> Propellor Result) -> Propellor Result) -> Property) -> Property
- withPrivData' :: (IsContext c, IsPrivDataSource s) => ((PrivDataField, PrivData) -> v) -> [s] -> c -> (((v -> Propellor Result) -> Propellor Result) -> Property) -> Property
- addPrivDataField :: (PrivDataField, HostContext) -> Property
- getLocalPrivData :: PrivDataField -> Context -> IO (Maybe PrivData)
- type PrivMap = Map (PrivDataField, Context) PrivData
- filterPrivData :: Host -> PrivMap -> PrivMap
- getPrivData :: PrivDataField -> Context -> PrivMap -> Maybe PrivData
- setPrivData :: PrivDataField -> Context -> IO ()
- dumpPrivData :: PrivDataField -> Context -> IO ()
- editPrivData :: PrivDataField -> Context -> IO ()
- listPrivDataFields :: [Host] -> IO ()
- setPrivDataTo :: PrivDataField -> Context -> PrivData -> IO ()
- decryptPrivData :: IO PrivMap
- makePrivDataDir :: IO ()
Documentation
withPrivData :: (IsContext c, IsPrivDataSource s) => s -> c -> (((PrivData -> Propellor Result) -> Propellor Result) -> Property) -> Property Source
Allows a Property to access the value of a specific PrivDataField, for use in a specific Context or HostContext.
Example use:
withPrivData (PrivFile pemfile) (Context "joeyh.name") $ \getdata -> property "joeyh.name ssl cert" $ getdata $ \privdata -> liftIO $ writeFile pemfile privdata where pemfile = "/etc/ssl/certs/web.pem"
Note that if the value is not available, the action is not run and instead it prints a message to help the user make the necessary private data available.
The resulting Property includes Info about the PrivDataField being used, which is necessary to ensure that the privdata is sent to the remote host by propellor.
withSomePrivData :: (IsContext c, IsPrivDataSource s) => [s] -> c -> ((((PrivDataField, PrivData) -> Propellor Result) -> Propellor Result) -> Property) -> Property Source
withPrivData' :: (IsContext c, IsPrivDataSource s) => ((PrivDataField, PrivData) -> v) -> [s] -> c -> (((v -> Propellor Result) -> Propellor Result) -> Property) -> Property Source
getLocalPrivData :: PrivDataField -> Context -> IO (Maybe PrivData) Source
filterPrivData :: Host -> PrivMap -> PrivMap Source
getPrivData :: PrivDataField -> Context -> PrivMap -> Maybe PrivData Source
setPrivData :: PrivDataField -> Context -> IO () Source
dumpPrivData :: PrivDataField -> Context -> IO () Source
editPrivData :: PrivDataField -> Context -> IO () Source
listPrivDataFields :: [Host] -> IO () Source
setPrivDataTo :: PrivDataField -> Context -> PrivData -> IO () Source
makePrivDataDir :: IO () Source