diff --git a/htools/Ganeti/Ssconf.hs b/htools/Ganeti/Ssconf.hs index 20cfeb39632172d4b808172ffeac7aebf82b141a..ed0dbbdad50ac527325d6853720af4e4805458b8 100644 --- a/htools/Ganeti/Ssconf.hs +++ b/htools/Ganeti/Ssconf.hs @@ -30,6 +30,7 @@ module Ganeti.Ssconf , sSKeyToRaw , sSKeyFromRaw , getPrimaryIPFamily + , getMasterCandidatesIps , keyToFilename , sSFilePrefix ) where @@ -127,3 +128,9 @@ getPrimaryIPFamily optpath = do result <- readSSConfFile optpath (Just (show C.ip4Family)) SSPrimaryIpFamily return (liftM rStripSpace result >>= tryRead "Parsing af_family" >>= parseIPFamily) + +-- | Read the list of IP addresses of the master candidates of the cluster. +getMasterCandidatesIps :: Maybe FilePath -> IO (Result [String]) +getMasterCandidatesIps optPath = do + result <- readSSConfFile optPath Nothing SSMasterCandidatesIps + return $ liftM lines result