Class: ConsulBridge::BootstrapConsul
- Defined in:
- lib/consul_bridge/bootstrap_consul.rb
Instance Attribute Summary collapse
-
#bucket ⇒ Object
Returns the value of attribute bucket.
-
#join_all ⇒ Object
Returns the value of attribute join_all.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(bucket:, join_all: false) ⇒ BootstrapConsul
constructor
A new instance of BootstrapConsul.
Methods inherited from Base
Constructor Details
#initialize(bucket:, join_all: false) ⇒ BootstrapConsul
Returns a new instance of BootstrapConsul.
10 11 12 13 |
# File 'lib/consul_bridge/bootstrap_consul.rb', line 10 def initialize(bucket:, join_all: false) self.bucket = bucket self.join_all = join_all end |
Instance Attribute Details
#bucket ⇒ Object
Returns the value of attribute bucket.
8 9 10 |
# File 'lib/consul_bridge/bootstrap_consul.rb', line 8 def bucket @bucket end |
#join_all ⇒ Object
Returns the value of attribute join_all.
8 9 10 |
# File 'lib/consul_bridge/bootstrap_consul.rb', line 8 def join_all @join_all end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/consul_bridge/bootstrap_consul.rb', line 15 def call while !DetectConsul.call.running puts 'Local consul agent not detected, sleeping for 5 seconds' sleep 5 end puts '==> Bootstrapping consul' master_ips = DownloadMasters.call(bucket: self.bucket).master_ips JoinConsul.call(master_ips: master_ips, join_all: self.join_all) puts '==> Done.' end |