ganeti

Safe HaskellNone

Ganeti.WConfd.ConfigWriter

Contents

Description

Implementation of functions specific to configuration management.

Synopsis

Documentation

loadConfigFromFile :: FilePath -> ResultG (ConfigData, FStat) Source #

Loads the configuration from the file, if it hasn't been loaded yet. The function is internal and isn't thread safe.

Asynchronous tasks

saveConfigAsyncTask Source #

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.

distMCsAsyncTask Source #

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.

distSSConfAsyncTask Source #

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.