From 7b67efec0ba70c636789f638fc3571394b4d899d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 31 Aug 2015 15:28:51 -0700 Subject: format --- ...ent_1_e6860056989da82fd7cd8f374e209548._comment | 42 ++++++++++------------ 1 file changed, 18 insertions(+), 24 deletions(-) (limited to 'doc') diff --git a/doc/forum/how_to_install_a_cluster_with_propellor/comment_1_e6860056989da82fd7cd8f374e209548._comment b/doc/forum/how_to_install_a_cluster_with_propellor/comment_1_e6860056989da82fd7cd8f374e209548._comment index 21a2b80c..91659bb3 100644 --- a/doc/forum/how_to_install_a_cluster_with_propellor/comment_1_e6860056989da82fd7cd8f374e209548._comment +++ b/doc/forum/how_to_install_a_cluster_with_propellor/comment_1_e6860056989da82fd7cd8f374e209548._comment @@ -27,39 +27,33 @@ add more. So, you'll probably want a way to generate a Host from a HostName with the desired Properties you want nodes in the cluster to have: -[[!format haskell """ -clusterNode :: HostName -> Host -clusterNode hn = host hn - & foo - & bar -"""]] + clusterNode :: HostName -> Host + clusterNode hn = host hn + & foo + & bar Then you could feed a list of hostnames to defaultMain to finish the config file: -[[!format haskell """ -main :: IO () -main = defaultMain (map clusterNode hostnames) - where - hostnames = - [ "node1" - , "node2" - -- etc - ] - -- alternatively... - -- hostnames = map (\n -> "node" ++ show n) [1..100] -"""]] + main :: IO () + main = defaultMain (map clusterNode hostnames) + where + hostnames = + [ "node1" + , "node2" + -- etc + ] + -- alternatively... + -- hostnames = map (\n -> "node" ++ show n) [1..100] Or, you could even look up the current hostname, and feed defaultMain a Host containing that hostname; so this single propellor configuration could be used on any number of hosts: -[[!format haskell """ -main = IO () -main = do - hn <- takeWhile (/= '\n') <$> readProcess "hostname" ["-f"] - defaultMain [ clusterNode hn ] -"""]] + main = IO () + main = do + hn <- takeWhile (/= '\n') <$> readProcess "hostname" ["-f"] + defaultMain [ clusterNode hn ] ## Triggering propellor on nodes -- cgit v1.2.3