auto-consul 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -72,6 +72,7 @@ class Command < OpenStruct
72
72
  runner = AutoConsul::Runner.method(runner)
73
73
  opt = {}
74
74
  opt[:advertise] = advertise if ! advertise.nil?
75
+ opt[:config_dir] = config_dir if ! config_dir.nil?
75
76
  monitor = runner.call(node, bind, expiry, local, cluster, opt)
76
77
  if with_heartbeat and ticks > 0
77
78
  monitor.while_up do |ap|
@@ -133,6 +134,10 @@ runner = Command.new(:advertise => nil,
133
134
  parser = OptionParser.new do |opts|
134
135
  opts.banner = "Usage: auto-consul [options] COMMAND"
135
136
 
137
+ opts.on("-c", "--config-dir CONFIGDIR", String, "The Configuration Directory") do |c|
138
+ runner.config_dir = c
139
+ end
140
+
136
141
  opts.on("-r", "--registry URL", String, "The cluster registry URL") do |u|
137
142
  runner.registry = u
138
143
  end
@@ -161,9 +161,9 @@ module AutoConsul
161
161
 
162
162
  def self.agent_runner identity, bind_ip, expiry, local_state, registry, opt={}
163
163
  opt[:remote_ip] = pick_joining_host(registry.agents.members(expiry))
164
- joining_runner(['-bind', bind_ip,
165
- '-data-dir', local_state.data_path,
166
- '-node', identity], opt)
164
+ args = ['-bind', bind_ip, '-data-dir', local_state.data_path, '-node', identity]
165
+ args += ['-config-dir', opt[:config_dir]] if ! opt[:config_dir].nil?
166
+ joining_runner(args, opt)
167
167
  end
168
168
 
169
169
  def self.server_runner identity, bind_ip, expiry, local_state, registry, opt={}
@@ -171,6 +171,7 @@ module AutoConsul
171
171
  opt[:remote_ip] = members.size > 0 ? pick_joining_host(members) : nil
172
172
 
173
173
  args = ['-bind', bind_ip, '-data-dir', local_state.data_path, '-node', identity, '-server']
174
+ args += ['-config-dir', opt[:config_dir]] if ! opt[:config_dir].nil?
174
175
  args << '-bootstrap' if members.size < 1
175
176
 
176
177
  joining_runner(args, opt)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auto-consul
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: