Safe Haskell | None |
---|
Implementation of the Ganeti Ssconf interface.
- maxFileSize :: Int
- sSFilePrefix :: FilePath
- data SSKey
- = SSClusterName
- | SSClusterTags
- | SSFileStorageDir
- | SSSharedFileStorageDir
- | SSGlusterStorageDir
- | SSMasterCandidates
- | SSMasterCandidatesIps
- | SSMasterCandidatesCerts
- | SSMasterIp
- | SSMasterNetdev
- | SSMasterNetmask
- | SSMasterNode
- | SSNodeList
- | SSNodePrimaryIps
- | SSNodeSecondaryIps
- | SSNodeVmCapable
- | SSOfflineNodes
- | SSOnlineNodes
- | SSPrimaryIpFamily
- | SSInstanceList
- | SSReleaseVersion
- | SSHypervisorList
- | SSMaintainNodeHealth
- | SSUidPool
- | SSNodegroups
- | SSNetworks
- | SSEnabledUserShutdown
- | SSSshPorts
- | SSHvparamsKvm
- | SSHvparamsXenPvm
- | SSHvparamsChroot
- | SSHvparamsXenHvm
- | SSHvparamsLxc
- | SSHvparamsFake
- sSKeyFromRaw :: forall m. Monad m => String -> m SSKey
- sSKeyToRaw :: SSKey -> String
- hvparamsSSKey :: Hypervisor -> SSKey
- keyToFilename :: FilePath -> SSKey -> FilePath
- catchIOErrors :: Maybe a -> IO a -> IO (Result a)
- readSSConfFile :: Maybe FilePath -> Maybe String -> SSKey -> IO (Result String)
- parseKeyValue :: Monad m => String -> String -> m (String, String)
- parseIPFamily :: Int -> Result Family
- getPrimaryIPFamily :: Maybe FilePath -> IO (Result Family)
- parseNodesVmCapable :: String -> Result [(String, Bool)]
- getNodesVmCapable :: Maybe FilePath -> IO (Result [(String, Bool)])
- getMasterCandidatesIps :: Maybe FilePath -> IO (Result [String])
- getMasterNode :: Maybe FilePath -> IO (Result String)
- parseHypervisorList :: String -> Result [Hypervisor]
- getHypervisorList :: Maybe FilePath -> IO (Result [Hypervisor])
- parseEnabledUserShutdown :: String -> Result Bool
- getEnabledUserShutdown :: Maybe FilePath -> IO (Result Bool)
- newtype SSConf = SSConf {}
- emptySSConf :: SSConf
Reading individual ssconf entries
maxFileSize :: IntSource
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
The data type used for representing the ssconf.