Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Ganeti.WConfd.ConfigWriter
Description
Implementation of functions specific to configuration management.
Synopsis
- loadConfigFromFile :: FilePath -> ResultG (ConfigData, FStat)
- readConfig :: WConfdMonad ConfigData
- writeConfig :: ConfigData -> WConfdMonad ()
- saveConfigAsyncTask :: FilePath -> FStat -> IO ConfigState -> [AsyncWorker DistributionTarget ()] -> ResultG (AsyncWorker (Any, DistributionTarget) ())
- distMCsAsyncTask :: RuntimeEnts -> FilePath -> IO ConfigState -> ResultG (AsyncWorker DistributionTarget ())
- distSSConfAsyncTask :: IO ConfigState -> ResultG (AsyncWorker DistributionTarget ())
Documentation
loadConfigFromFile :: FilePath -> ResultG (ConfigData, FStat) #
Loads the configuration from the file, if it hasn't been loaded yet. The function is internal and isn't thread safe.
writeConfig :: ConfigData -> WConfdMonad () #
Arguments
:: FilePath | Path to the config file |
-> FStat | The initial state of the config. file |
-> IO ConfigState | An action to read the current config |
-> [AsyncWorker DistributionTarget ()] | Workers to be triggered afterwards |
-> ResultG (AsyncWorker (Any, DistributionTarget) ()) |
Construct an asynchronous worker whose action is to save the
configuration to the master file.
The worker's action reads the configuration using the given IO
action
and uses FStat
to check if the configuration hasn't been modified by
another process.
If Any
of the input requests is true, given additional worker
will be executed synchronously after sucessfully writing the configuration
file. Otherwise, they'll be just triggered asynchronously.
Arguments
:: RuntimeEnts | |
-> FilePath | Path to the config file |
-> IO ConfigState | An action to read the current config |
-> ResultG (AsyncWorker DistributionTarget ()) |
Construct an asynchronous worker whose action is to distribute the configuration to master candidates.
Arguments
:: IO ConfigState | An action to read the current config |
-> ResultG (AsyncWorker DistributionTarget ()) |
Construct an asynchronous worker whose action is to construct SSConf
and distribute it to master candidates.
The worker's action reads the configuration using the given IO
action,
computes the current SSConf, compares it to the previous version, and
if different, distributes it.