opzworks 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/opzworks/commands/elastic.rb +14 -8
- data/lib/opzworks/commands/include/elastic.rb +4 -2
- data/lib/opzworks/config.rb +2 -1
- data/lib/opzworks/meta.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f769a4874e232e192be19c8fb468ea8242a620d0
|
4
|
+
data.tar.gz: d14aa92875d879a41cbab51d7323b596c85a2d22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 157cc2f33e2af666ac7e7f36ceb23eedc7ac17e6caed66bc35b84f10ab5e7df27ba4b65bd6a9fbd6a99bcb562305f1252a147b266d97aaebc968e71d0f504323
|
7
|
+
data.tar.gz: 62121775ae8fb5eddc957d5e88d90189e231426dd95c62258da8f0d025616563b798f47c0525e0b0a30e3cfe9b09c57a0d09fc648056d28d44fe6efa414c1a4b
|
data/CHANGELOG.md
CHANGED
@@ -60,12 +60,14 @@ module OpzWorks
|
|
60
60
|
puts "\n________________________________________________"
|
61
61
|
puts "Now operating on host #{ip}".foreground(:yellow)
|
62
62
|
|
63
|
-
|
64
|
-
|
63
|
+
if @disable_shard_allocation
|
64
|
+
es_enable_allocation(ip, 'none')
|
65
|
+
sleep 2
|
66
|
+
end
|
65
67
|
|
66
68
|
es_service('restart', [ip])
|
67
69
|
es_wait_for_status(ip, 'yellow')
|
68
|
-
es_enable_allocation(ip, 'all') if @disable_shard_allocation
|
70
|
+
es_enable_allocation(ip, 'all') if @disable_shard_allocation
|
69
71
|
es_wait_for_status(ip, 'green')
|
70
72
|
end
|
71
73
|
end
|
@@ -82,8 +84,10 @@ module OpzWorks
|
|
82
84
|
case options[:stop]
|
83
85
|
when true
|
84
86
|
# use the first host to disable shard allocation
|
85
|
-
|
86
|
-
|
87
|
+
if @disable_shard_allocation
|
88
|
+
es_enable_allocation(@ip_addrs.first, 'none')
|
89
|
+
sleep 2
|
90
|
+
end
|
87
91
|
|
88
92
|
es_service('stop', @ip_addrs)
|
89
93
|
end
|
@@ -91,13 +95,15 @@ module OpzWorks
|
|
91
95
|
case options[:bounce]
|
92
96
|
when true
|
93
97
|
# use the first host to disable shard allocation
|
94
|
-
|
95
|
-
|
98
|
+
if @disable_shard_allocation
|
99
|
+
es_enable_allocation(@ip_addrs.first, 'none')
|
100
|
+
sleep 2
|
101
|
+
end
|
96
102
|
|
97
103
|
es_service('restart', @ip_addrs)
|
98
104
|
|
99
105
|
es_wait_for_status(@ip_addrs.first, 'yellow')
|
100
|
-
es_enable_allocation(@ip_addrs.first, 'all') if @disable_shard_allocation
|
106
|
+
es_enable_allocation(@ip_addrs.first, 'all') if @disable_shard_allocation
|
101
107
|
es_wait_for_status(@ip_addrs.first, 'green')
|
102
108
|
end
|
103
109
|
end
|
@@ -45,7 +45,7 @@ def es_get_input(input, data = {}, *cmd)
|
|
45
45
|
options = {}
|
46
46
|
if layer == ''
|
47
47
|
puts 'Must specify a layer.'.foreground(:red)
|
48
|
-
|
48
|
+
return false
|
49
49
|
else
|
50
50
|
options[:layer_id] = layer
|
51
51
|
end
|
@@ -86,7 +86,9 @@ def es_service(command, ips = [])
|
|
86
86
|
session.use "#{user}@#{ip}"
|
87
87
|
end
|
88
88
|
|
89
|
-
|
89
|
+
Timeout::timeout(10) do
|
90
|
+
session.exec "sudo service elasticsearch #{command}"
|
91
|
+
end
|
90
92
|
session.loop
|
91
93
|
end
|
92
94
|
end
|
data/lib/opzworks/config.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'inifile'
|
2
|
+
require 'rainbow'
|
2
3
|
|
3
4
|
module OpzWorks
|
4
5
|
def self.config
|
@@ -12,7 +13,7 @@ module OpzWorks
|
|
12
13
|
def initialize
|
13
14
|
file = ENV['AWS_CONFIG_FILE'] || "#{ENV['HOME']}/.aws/config"
|
14
15
|
|
15
|
-
fail 'AWS config file not found' unless File.exist? file
|
16
|
+
fail 'AWS config file not found!'.foreground(:red) unless File.exist? file
|
16
17
|
ini = IniFile.load(file)
|
17
18
|
|
18
19
|
# set the region and the profile we want to pick up from ~/.aws/credentials
|
data/lib/opzworks/meta.rb
CHANGED