capistrano3-consul 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/capistrano/consul.rb +4 -4
- data/lib/capistrano/consul/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 798809c6aed6cf2f034067dbaaa89c136b3054ee397d4ea850d4db4bb80a8834
|
4
|
+
data.tar.gz: e066f85dd0e0af201e33152b91fa5b60c7133cabfcd48d9bce6374cf2a6952a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5913b8f2de638df458a86a66ee9e42ae014e4f78ad2cd5b45af4e9f34639eb05366922bbf2f2f33dbe8757caa5c181675a6c542995587bdc1a091dd85fd95336
|
7
|
+
data.tar.gz: dedd36b0502a81750dfd94fde7116a6af311ef0388873cf139a5de3c1557b9e08aad39e2d73282c4fa6e11603afee0fb04660a068c9ab906658977641c30b0d9
|
data/lib/capistrano/consul.rb
CHANGED
@@ -28,16 +28,16 @@ module Capistrano
|
|
28
28
|
def consul_all_nodes(properties = {})
|
29
29
|
Consul.setup
|
30
30
|
Diplomat::Node.get_all.each_with_index do |node, index|
|
31
|
-
|
32
|
-
server(node['Address'], properties)
|
31
|
+
extra_properties = index.zero? ? { primary: true } : {}
|
32
|
+
server(node['Address'], properties.merge(extra_properties))
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
def consul_service(service_name, properties = {})
|
37
37
|
Consul.setup
|
38
38
|
Diplomat::Service.get(service_name, :all).each_with_index do |node, index|
|
39
|
-
|
40
|
-
server(node['Address'], properties)
|
39
|
+
extra_properties = index.zero? ? { primary: true } : {}
|
40
|
+
server(node['Address'], properties.merge(extra_properties))
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|