broham 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -50,20 +50,20 @@ Alternate interface:
50
50
  h4. Commandline Interface
51
51
 
52
52
  <pre><code>
53
- $ broham-register chad nfs_server --set-path=/home
54
- Registering as nfs_server in chad cluster, with {:path=>"/home"}
55
- {"timestamp":["20100405092638"],"role":["nfs_server"],"path":["/home"],"default_ip":["192.168.69.22"]}
53
+ $ broham-register chad nfs_server --set-server_path=/home --set-client_path=/home
54
+ Registering as nfs_server in chad cluster, with {:server_path=>"/home", :client_path=>"/home"}
55
+ {"timestamp":["20100405093238"],"fqdn":["nfs.infochimps.org"],"client_path":["/home"],"server_path":["/home"],"role":["nfs_server"],"private_ip":["10.123.156.231"],"default_ip":["10.123.156.231"],"public_ip":["104.136.251.50"]}
56
56
 
57
57
  $ broham-host chad nfs_server
58
- {"timestamp":["20100405092638"],"role":["nfs_server"],"path":["/home"],"default_ip":["192.168.69.22"]}
58
+ {"timestamp":["20100405093238"],"fqdn":["nfs.infochimps.org"],"client_path":["/home"],"server_path":["/home"],"role":["nfs_server"],"private_ip":["10.123.156.231"],"default_ip":["10.123.156.231"],"public_ip":["104.136.251.50"]}
59
59
 
60
60
  # Alternative interface works too.
61
61
  $ broham-sup chad nfs_server
62
- {"timestamp":["20100405092638"],"role":["nfs_server"],"path":["/home"],"default_ip":["192.168.69.22"]}
62
+ {"timestamp":["20100405093238"],"fqdn":["nfs.infochimps.org"],"client_path":["/home"],"server_path":["/home"],"role":["nfs_server"],"private_ip":["10.123.156.231"],"default_ip":["10.123.156.231"],"public_ip":["104.136.251.50"]}
63
63
 
64
64
  $ broham-unregister-all chad nfs_server
65
65
  Removing nfs_server from chad cluster
66
- {"timestamp":["20100405092638"],"role":["nfs_server"],"path":["/home"],"default_ip":["192.168.69.22"]}
66
+ {"timestamp":["20100405093238"],"fqdn":["nfs.infochimps.org"],"client_path":["/home"],"server_path":["/home"],"role":["nfs_server"],"private_ip":["10.123.156.231"],"default_ip":["10.123.156.231"],"public_ip":["104.136.251.50"]}
67
67
  </code></pre>
68
68
 
69
69
  h4. Setup
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rubygems'
3
+ require 'broham'
4
+ require 'broham/script'
5
+ Settings.define :set, :description => %Q{Any arg prefixed with "--set" will become an extra arg to register: 'broham-register foo --set-path=/path/to/foo' sets :path => '/path/to/foo' as an additional attribute}, :type => Hash
6
+
7
+ cluster = Broham.get_cluster_settings
8
+ cluster_name, role_name, broham_args = [Settings[:cluster_name], Settings[:role_name], Settings[:set]||{}]
9
+
10
+ $stderr.puts %Q{Registering as next #{role_name} in #{cluster_name} cluster, with #{broham_args.inspect}}
11
+ resp = cluster.register_as_next role_name, broham_args
12
+ $stderr.puts resp.to_pretty_json
13
+
data/broham.gemspec CHANGED
@@ -5,14 +5,14 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{broham}
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Philip (flip) Kromer"]
12
12
  s.date = %q{2010-04-05}
13
13
  s.description = %q{Bro! Broham always knows where his bros are, bro. Using broham, a newly-created cloud machine can annouce its availability for a certain role ("nfs_server" or "db_slave-2"), allowing any other interested nodes to discover its public_ip, private_ip, etc. See also: http://j.mp/amongbros}
14
14
  s.email = %q{flip@infochimps.org}
15
- s.executables = ["broham-host", "broham-register", "broham-unregister-all"]
15
+ s.executables = ["broham-host", "broham-register", "broham-register_as_next", "broham-unregister-all"]
16
16
  s.extra_rdoc_files = [
17
17
  "LICENSE",
18
18
  "README.textile"
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
26
26
  "VERSION",
27
27
  "bin/broham-host",
28
28
  "bin/broham-register",
29
+ "bin/broham-register_as_next",
29
30
  "bin/broham-unregister-all",
30
31
  "broham.gemspec",
31
32
  "lib/broham.rb",
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Philip (flip) Kromer
@@ -48,6 +48,7 @@ email: flip@infochimps.org
48
48
  executables:
49
49
  - broham-host
50
50
  - broham-register
51
+ - broham-register_as_next
51
52
  - broham-unregister-all
52
53
  extensions: []
53
54
 
@@ -63,6 +64,7 @@ files:
63
64
  - VERSION
64
65
  - bin/broham-host
65
66
  - bin/broham-register
67
+ - bin/broham-register_as_next
66
68
  - bin/broham-unregister-all
67
69
  - broham.gemspec
68
70
  - lib/broham.rb