summaryrefslogtreecommitdiff
path: root/doc/forum/passing_host_address_dynamically_to_propellor
diff options
context:
space:
mode:
Diffstat (limited to 'doc/forum/passing_host_address_dynamically_to_propellor')
-rw-r--r--doc/forum/passing_host_address_dynamically_to_propellor/comment_1_1c5d5b59f2325a2f4e06d09a9900007f._comment25
-rw-r--r--doc/forum/passing_host_address_dynamically_to_propellor/comment_2_b9041877dfc6e6bfb63a014492a2d1d1._comment18
-rw-r--r--doc/forum/passing_host_address_dynamically_to_propellor/comment_3_49d6408ee7618ccb88a537e519f95b27._comment11
-rw-r--r--doc/forum/passing_host_address_dynamically_to_propellor/comment_4_1f208acbe17e25a2b25e1615146d7a0a._comment9
-rw-r--r--doc/forum/passing_host_address_dynamically_to_propellor/comment_5_cd61e6fb0d5694575edb95728f0c8370._comment23
5 files changed, 86 insertions, 0 deletions
diff --git a/doc/forum/passing_host_address_dynamically_to_propellor/comment_1_1c5d5b59f2325a2f4e06d09a9900007f._comment b/doc/forum/passing_host_address_dynamically_to_propellor/comment_1_1c5d5b59f2325a2f4e06d09a9900007f._comment
new file mode 100644
index 00000000..57b2a63b
--- /dev/null
+++ b/doc/forum/passing_host_address_dynamically_to_propellor/comment_1_1c5d5b59f2325a2f4e06d09a9900007f._comment
@@ -0,0 +1,25 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2015-05-29T14:05:10Z"
+ content="""
+What's the use case here?
+
+I think maybe you're trying to deploy basically the same set of properties
+to multiple hosts. And perhaps don't want to have the list of hosts in the
+config.hs file. If that's the goal, it seems you could accomplish it by
+writing a function like:
+
+ stdHost :: IPAddr -> Host
+
+Or more generally,
+
+ stdHost :: Property HasInfo -> Host
+
+And then you can map over the set of IP addresses to generate the the
+[Host] list for propellor. Or could even read a data file (that would need
+to be checked into the git repo) and use it to constuct the [Host] list at
+runtime.
+
+But maybe I misunderstood the use case..
+"""]]
diff --git a/doc/forum/passing_host_address_dynamically_to_propellor/comment_2_b9041877dfc6e6bfb63a014492a2d1d1._comment b/doc/forum/passing_host_address_dynamically_to_propellor/comment_2_b9041877dfc6e6bfb63a014492a2d1d1._comment
new file mode 100644
index 00000000..0f59b424
--- /dev/null
+++ b/doc/forum/passing_host_address_dynamically_to_propellor/comment_2_b9041877dfc6e6bfb63a014492a2d1d1._comment
@@ -0,0 +1,18 @@
+[[!comment format=mdwn
+ username="arnaud.oqube@c9b8c7ea33f1dea0b7a5485b86825c5bfa9efbf7"
+ nickname="arnaud.oqube"
+ subject="comment 2"
+ date="2015-05-29T15:09:24Z"
+ content="""
+We create/destroy dynamically hosts which have different purpose: CI, Dev boxes, Testing... IP of these hosts is unknown and assign by our provider (Digital Ocean) so what I would like to do is something like:
+
+```
+$ create-host
+...
+IP: 1.2.3.4
+$ ./propellor 1.2.3.4
+```
+
+But indeed the idea of having a local `hosts` file makes sense, or even a `hosts/` directory to which I output files containing IPs.
+
+"""]]
diff --git a/doc/forum/passing_host_address_dynamically_to_propellor/comment_3_49d6408ee7618ccb88a537e519f95b27._comment b/doc/forum/passing_host_address_dynamically_to_propellor/comment_3_49d6408ee7618ccb88a537e519f95b27._comment
new file mode 100644
index 00000000..37962eff
--- /dev/null
+++ b/doc/forum/passing_host_address_dynamically_to_propellor/comment_3_49d6408ee7618ccb88a537e519f95b27._comment
@@ -0,0 +1,11 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 3"""
+ date="2015-05-30T14:50:14Z"
+ content="""
+Or teach propellor --spin how to create Digital Ocean, AWS, etc VMs, as
+described in [[todo/HostingProvider_for_AWS]].
+
+I guess that even if it created the hosts, it would make sense to have a
+static host list with their IPs.
+"""]]
diff --git a/doc/forum/passing_host_address_dynamically_to_propellor/comment_4_1f208acbe17e25a2b25e1615146d7a0a._comment b/doc/forum/passing_host_address_dynamically_to_propellor/comment_4_1f208acbe17e25a2b25e1615146d7a0a._comment
new file mode 100644
index 00000000..45d24f0e
--- /dev/null
+++ b/doc/forum/passing_host_address_dynamically_to_propellor/comment_4_1f208acbe17e25a2b25e1615146d7a0a._comment
@@ -0,0 +1,9 @@
+[[!comment format=mdwn
+ username="arnaud.oqube@c9b8c7ea33f1dea0b7a5485b86825c5bfa9efbf7"
+ nickname="arnaud.oqube"
+ subject="comment 4"
+ date="2015-05-31T20:18:30Z"
+ content="""
+That makes sense. Indeed, that's the direction I was heading to, because currently our VM deployment scripts are in shell and I wanted to port them to Haskell and integrate in the provisioning process.
+Thanks for the idea, I will see where it goes.
+"""]]
diff --git a/doc/forum/passing_host_address_dynamically_to_propellor/comment_5_cd61e6fb0d5694575edb95728f0c8370._comment b/doc/forum/passing_host_address_dynamically_to_propellor/comment_5_cd61e6fb0d5694575edb95728f0c8370._comment
new file mode 100644
index 00000000..79f721f1
--- /dev/null
+++ b/doc/forum/passing_host_address_dynamically_to_propellor/comment_5_cd61e6fb0d5694575edb95728f0c8370._comment
@@ -0,0 +1,23 @@
+[[!comment format=mdwn
+ username="arnaud@30aba4d9f1742050874551d3ddc55ca8694809f8"
+ nickname="arnaud"
+ subject="Works like a charm..."
+ date="2015-06-11T19:19:07Z"
+ content="""
+I implemented this feature using a file, aptly named `hosts` that is versioned in the repo and populated (at the moment manually but will be automatic...) when boxes are created in DO.
+Then the following main will extract the information and create hosts config to be passed to main from propellor, reading the needed file:
+
+```
+main :: IO ()
+main = do
+ h <- map words <$> lines <$> readFile \"hosts\" `catch` (\ (_ :: IOException) -> return \"\")
+ let hosts = map selectHost h
+ defaultMain hosts
+
+selectHost :: [String] -> Host
+selectHost [\"prod\",ip,sha1] = host ip & Lending.lendingHost sha1
+selectHost [\"prod\",ip] = host ip & Lending.lendingHost currentSha1
+selectHost [\"monitor\",name,ip] = host name & Monitoring.monitoringHost ip
+selectHost h = error $ \"doesn't know how to handle host definition \" ++ show h
+```
+"""]]