Safe HaskellNone




Implementation of the Ganeti Ssconf interface.


Reading individual ssconf entries

sSFilePrefix :: FilePathSource

ssconf file prefix, re-exported from Constants.

sSKeyFromRaw :: forall m. Monad m => String -> m SSKeySource

sSKeyToRaw :: SSKey -> StringSource

hvparamsSSKey :: Hypervisor -> SSKeySource

For a given hypervisor get the corresponding SSConf key that contains its parameters.

The corresponding SSKeys are generated automatically by TH, but since we don't have convenient infrastructure for generating this function, it's just manual. All constructors must be given explicitly so that adding another hypervisor will trigger incomplete pattern warning and force the corresponding addition.



:: FilePath

Config path root

-> SSKey

Ssconf key

-> FilePath

Full file name

Convert a ssconf key into a (full) file path.

catchIOErrors :: Maybe a -> IO a -> IO (Result a)Source

readSSConfFile :: Maybe FilePath -> Maybe String -> SSKey -> IO (Result String)Source

parseKeyValue :: Monad m => String -> String -> m (String, String)Source

parseIPFamily :: Int -> Result FamilySource

getPrimaryIPFamily :: Maybe FilePath -> IO (Result Family)Source

Read the primary IP family.

parseNodesVmCapable :: String -> Result [(String, Bool)]Source

Parse the nodes vm capable value from a String.

getNodesVmCapable :: Maybe FilePath -> IO (Result [(String, Bool)])Source

Read and parse the nodes vm capable.

getMasterCandidatesIps :: Maybe FilePath -> IO (Result [String])Source

Read the list of IP addresses of the master candidates of the cluster.

getMasterNode :: Maybe FilePath -> IO (Result String)Source

Read the name of the master node.

parseHypervisorList :: String -> Result [Hypervisor]Source

Parse the list of enabled hypervisors from a String.

getHypervisorList :: Maybe FilePath -> IO (Result [Hypervisor])Source

Read and parse the list of enabled hypervisors.

parseEnabledUserShutdown :: String -> Result BoolSource

Parse whether user shutdown is enabled from a String.

getEnabledUserShutdown :: Maybe FilePath -> IO (Result Bool)Source

Read and parse whether user shutdown is enabled.

Working with the whole ssconf map

newtype SSConf Source

The data type used for representing the ssconf.




getSSConf :: Map SSKey [String]


Eq SSConf 
Ord SSConf 
Show SSConf 
Arbitrary SSConf