opscode-pushy-client 2.3.0 → 2.4.11
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 +5 -5
- data/CHANGELOG.md +50 -1
- data/Gemfile.lock +62 -59
- data/RELEASE_NOTES.md +9 -0
- data/RELEASE_PROCESS.md +1 -1
- data/VERSION +1 -0
- data/lib/pushy_client.rb +46 -8
- data/lib/pushy_client/cli.rb +2 -1
- data/lib/pushy_client/job_runner.rb +3 -0
- data/lib/pushy_client/periodic_reconfigurer.rb +27 -4
- data/lib/pushy_client/protocol_handler.rb +28 -6
- data/lib/pushy_client/version.rb +1 -1
- data/lib/pushy_client/windows_service.rb +11 -9
- data/omnibus/Gemfile.lock +223 -67
- data/omnibus/config/projects/push-jobs-client.rb +7 -16
- data/omnibus/config/software/opscode-pushy-client.rb +8 -7
- data/omnibus/resources/push-jobs-client/msi/source.wxs.erb +5 -2
- data/omnibus_overrides.rb +26 -0
- data/opscode-pushy-client.gemspec +2 -2
- data/pkg/opscode-pushy-client-2.4.11.gem +0 -0
- data/spec/pushy_client/job_runner_spec.rb +100 -0
- metadata +13 -8
- data/pkg/opscode-pushy-client-2.3.0.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bd455699417a076f318d51e9521395d286698a06f00a2dbfe0e35d227edc351f
|
4
|
+
data.tar.gz: 03017f2efa50c78b3afc558714c497e584771521f183bf743880b308a5959a12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c0e0a19acc56d240fd0d9b75612db7e533ee71dd7c7b1c7a00af9aae6764333a617a3da0bef4d04a70445adeb55b2f83d21e668c966ce90d3c8491365605c34
|
7
|
+
data.tar.gz: 1c71e5968153037ad0fcfe8c2d13d8dbdb858106243e56aa994d46e3c04b609155b3ed66ae8f32374cf42cce1102f2c33149e1fd5cdfda7ad603170e98b8742d
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,53 @@
|
|
1
1
|
# Chef Push Client Changes
|
2
|
+
<!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ -->
|
3
|
+
<!-- latest_release 2.4.11 -->
|
4
|
+
## [2.4.11](https://github.com/chef/opscode-pushy-client/tree/2.4.11) (2018-04-24)
|
5
|
+
|
6
|
+
#### Merged Pull Requests
|
7
|
+
- expeditor config: bundle update every time [#155](https://github.com/chef/opscode-pushy-client/pull/155) ([lamont-granquist](https://github.com/lamont-granquist))
|
8
|
+
<!-- latest_release -->
|
9
|
+
|
10
|
+
<!-- release_rollup since=2.4.8 -->
|
11
|
+
### Changes since 2.4.8 release
|
12
|
+
|
13
|
+
#### Merged Pull Requests
|
14
|
+
- expeditor config: bundle update every time [#155](https://github.com/chef/opscode-pushy-client/pull/155) ([lamont-granquist](https://github.com/lamont-granquist)) <!-- 2.4.11 -->
|
15
|
+
- refactor timeout on message send [#152](https://github.com/chef/opscode-pushy-client/pull/152) ([jeremymv2](https://github.com/jeremymv2)) <!-- 2.4.10 -->
|
16
|
+
- Optimize `get_config` by eliminating extensive retry behavior [#151](https://github.com/chef/opscode-pushy-client/pull/151) ([jeremymv2](https://github.com/jeremymv2)) <!-- 2.4.9 -->
|
17
|
+
<!-- release_rollup -->
|
18
|
+
|
19
|
+
<!-- latest_stable_release -->
|
20
|
+
## [2.4.8](https://github.com/chef/opscode-pushy-client/tree/2.4.8) (2018-02-05)
|
21
|
+
|
22
|
+
#### Merged Pull Requests
|
23
|
+
- Add CODEOWNERS file [#148](https://github.com/chef/opscode-pushy-client/pull/148) ([schisamo](https://github.com/schisamo))
|
24
|
+
- Add AIX support [#149](https://github.com/chef/opscode-pushy-client/pull/149) ([jeremiahsnapp](https://github.com/jeremiahsnapp))
|
25
|
+
- update dependency versions [#150](https://github.com/chef/opscode-pushy-client/pull/150) ([jaymalasinha](https://github.com/jaymalasinha))
|
26
|
+
<!-- latest_stable_release -->
|
27
|
+
|
28
|
+
## [2.4.5](https://github.com/chef/opscode-pushy-client/tree/2.4.5) (2017-11-03)
|
29
|
+
|
30
|
+
#### Merged Pull Requests
|
31
|
+
- Wrap ZMQ request in timeout [#143](https://github.com/chef/opscode-pushy-client/pull/143) ([nsdavidson](https://github.com/nsdavidson))
|
32
|
+
|
33
|
+
## [2.4.4](https://github.com/chef/opscode-pushy-client/tree/2.4.4) (2017-09-21)
|
34
|
+
|
35
|
+
#### Merged Pull Requests
|
36
|
+
- Update Expeditor config to meet 0.5.0 requirements [#142](https://github.com/chef/opscode-pushy-client/pull/142) ([tduffield](https://github.com/tduffield))
|
37
|
+
- Update ruby to 2.4.2 [#145](https://github.com/chef/opscode-pushy-client/pull/145) ([PrajaktaPurohit](https://github.com/PrajaktaPurohit))
|
38
|
+
- Updating bundler to 1.15.4. Some README updates. [#146](https://github.com/chef/opscode-pushy-client/pull/146) ([PrajaktaPurohit](https://github.com/PrajaktaPurohit))
|
39
|
+
|
40
|
+
## [2.4.1](https://github.com/chef/opscode-pushy-client/tree/2.4.1) (2017-08-16)
|
41
|
+
|
42
|
+
#### Merged Pull Requests
|
43
|
+
- Perform version bump on correct path [#134](https://github.com/chef/opscode-pushy-client/pull/134) ([schisamo](https://github.com/schisamo))
|
44
|
+
- Ensure version bump sed matches the correct line [#135](https://github.com/chef/opscode-pushy-client/pull/135) ([schisamo](https://github.com/schisamo))
|
45
|
+
- Update SHA1 fingerprint for MSI signing cert [#136](https://github.com/chef/opscode-pushy-client/pull/136) ([schisamo](https://github.com/schisamo))
|
46
|
+
- Update the CHANGELOG when push-client is promoted to stable [#137](https://github.com/chef/opscode-pushy-client/pull/137) ([tduffield](https://github.com/tduffield))
|
47
|
+
- Allow push jobs to build libzmq from source on windows [#128](https://github.com/chef/opscode-pushy-client/pull/128) ([ksubrama](https://github.com/ksubrama))
|
48
|
+
- Add Option to manage environment variables that could be overwritten [#140](https://github.com/chef/opscode-pushy-client/pull/140) ([jaym](https://github.com/jaym))
|
49
|
+
|
50
|
+
|
2
51
|
|
3
52
|
## 2.2.0
|
4
53
|
|
@@ -85,4 +134,4 @@
|
|
85
134
|
|
86
135
|
* Add Apache 2 license and headers in preparation for open sourcing.
|
87
136
|
|
88
|
-
* Unify gem and repo tag versioning scheme.
|
137
|
+
* Unify gem and repo tag versioning scheme.
|
data/Gemfile.lock
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
opscode-pushy-client (2.
|
5
|
-
chef (>= 12.19, <
|
4
|
+
opscode-pushy-client (2.4.11)
|
5
|
+
chef (>= 12.19, < 15.0)
|
6
6
|
ffi-rzmq
|
7
|
-
ohai (>= 8.23, <
|
7
|
+
ohai (>= 8.23, < 15.0)
|
8
8
|
uuidtools
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
addressable (2.5.
|
14
|
-
public_suffix (
|
13
|
+
addressable (2.5.2)
|
14
|
+
public_suffix (>= 2.0.2, < 4.0)
|
15
15
|
builder (3.2.3)
|
16
|
-
chef (
|
16
|
+
chef (14.0.202)
|
17
17
|
addressable
|
18
18
|
bundler (>= 1.10)
|
19
|
-
chef-config (=
|
19
|
+
chef-config (= 14.0.202)
|
20
20
|
chef-zero (>= 13.0)
|
21
21
|
diff-lcs (~> 1.2, >= 1.2.4)
|
22
22
|
erubis (~> 2.7)
|
@@ -25,14 +25,14 @@ GEM
|
|
25
25
|
iniparse (~> 1.4)
|
26
26
|
iso8601 (~> 0.9.1)
|
27
27
|
mixlib-archive (~> 0.4)
|
28
|
-
mixlib-authentication (~>
|
28
|
+
mixlib-authentication (~> 2.0)
|
29
29
|
mixlib-cli (~> 1.7)
|
30
|
-
mixlib-log (~>
|
30
|
+
mixlib-log (~> 2.0, >= 2.0.3)
|
31
31
|
mixlib-shellout (~> 2.0)
|
32
32
|
net-sftp (~> 2.1, >= 2.1.2)
|
33
|
-
net-ssh (
|
33
|
+
net-ssh (~> 4.2)
|
34
34
|
net-ssh-multi (~> 1.2, >= 1.2.1)
|
35
|
-
ohai (~>
|
35
|
+
ohai (~> 14.0)
|
36
36
|
plist (~> 3.2)
|
37
37
|
proxifier (~> 1.0)
|
38
38
|
rspec-core (~> 3.5)
|
@@ -43,10 +43,10 @@ GEM
|
|
43
43
|
specinfra (~> 2.10)
|
44
44
|
syslog-logger (~> 1.6)
|
45
45
|
uuidtools (~> 2.1.5)
|
46
|
-
chef (
|
46
|
+
chef (14.0.202-universal-mingw32)
|
47
47
|
addressable
|
48
48
|
bundler (>= 1.10)
|
49
|
-
chef-config (=
|
49
|
+
chef-config (= 14.0.202)
|
50
50
|
chef-zero (>= 13.0)
|
51
51
|
diff-lcs (~> 1.2, >= 1.2.4)
|
52
52
|
erubis (~> 2.7)
|
@@ -56,14 +56,14 @@ GEM
|
|
56
56
|
iniparse (~> 1.4)
|
57
57
|
iso8601 (~> 0.9.1)
|
58
58
|
mixlib-archive (~> 0.4)
|
59
|
-
mixlib-authentication (~>
|
59
|
+
mixlib-authentication (~> 2.0)
|
60
60
|
mixlib-cli (~> 1.7)
|
61
|
-
mixlib-log (~>
|
61
|
+
mixlib-log (~> 2.0, >= 2.0.3)
|
62
62
|
mixlib-shellout (~> 2.0)
|
63
63
|
net-sftp (~> 2.1, >= 2.1.2)
|
64
|
-
net-ssh (
|
64
|
+
net-ssh (~> 4.2)
|
65
65
|
net-ssh-multi (~> 1.2, >= 1.2.1)
|
66
|
-
ohai (~>
|
66
|
+
ohai (~> 14.0)
|
67
67
|
plist (~> 3.2)
|
68
68
|
proxifier (~> 1.0)
|
69
69
|
rspec-core (~> 3.5)
|
@@ -84,110 +84,113 @@ GEM
|
|
84
84
|
win32-service (~> 0.8.7)
|
85
85
|
windows-api (~> 0.4.4)
|
86
86
|
wmi-lite (~> 1.0)
|
87
|
-
chef-config (
|
87
|
+
chef-config (14.0.202)
|
88
88
|
addressable
|
89
89
|
fuzzyurl
|
90
90
|
mixlib-config (~> 2.0)
|
91
91
|
mixlib-shellout (~> 2.0)
|
92
|
-
|
92
|
+
tomlrb (~> 1.2)
|
93
|
+
chef-zero (14.0.6)
|
93
94
|
ffi-yajl (~> 2.2)
|
94
95
|
hashie (>= 2.0, < 4.0)
|
95
|
-
mixlib-log (~>
|
96
|
+
mixlib-log (~> 2.0)
|
96
97
|
rack (~> 2.0)
|
97
98
|
uuidtools (~> 2.1)
|
98
99
|
diff-lcs (1.3)
|
99
100
|
erubis (2.7.0)
|
100
|
-
ffi (1.9.
|
101
|
-
ffi (1.9.
|
102
|
-
ffi
|
101
|
+
ffi (1.9.23)
|
102
|
+
ffi (1.9.23-x64-mingw32)
|
103
|
+
ffi (1.9.23-x86-mingw32)
|
104
|
+
ffi-rzmq (2.0.6)
|
103
105
|
ffi-rzmq-core (>= 1.0.6)
|
104
106
|
ffi-rzmq-core (1.0.6)
|
105
107
|
ffi
|
106
108
|
ffi-win32-extensions (1.0.3)
|
107
109
|
ffi
|
108
|
-
ffi-yajl (2.3.
|
110
|
+
ffi-yajl (2.3.1)
|
109
111
|
libyajl2 (~> 1.2)
|
110
112
|
fuzzyurl (0.9.0)
|
111
|
-
hashie (3.5.
|
112
|
-
highline (1.7.
|
113
|
-
iniparse (1.4.
|
113
|
+
hashie (3.5.7)
|
114
|
+
highline (1.7.10)
|
115
|
+
iniparse (1.4.4)
|
114
116
|
ipaddress (0.8.3)
|
115
117
|
iso8601 (0.9.1)
|
116
118
|
libyajl2 (1.2.0)
|
117
119
|
mixlib-archive (0.4.1)
|
118
120
|
mixlib-log
|
119
|
-
mixlib-authentication (
|
120
|
-
mixlib-log
|
121
|
+
mixlib-authentication (2.0.0)
|
121
122
|
mixlib-cli (1.7.0)
|
122
|
-
mixlib-config (2.2.
|
123
|
-
|
124
|
-
mixlib-
|
125
|
-
mixlib-shellout (2.2
|
123
|
+
mixlib-config (2.2.6)
|
124
|
+
tomlrb
|
125
|
+
mixlib-log (2.0.4)
|
126
|
+
mixlib-shellout (2.3.2)
|
127
|
+
mixlib-shellout (2.3.2-universal-mingw32)
|
126
128
|
win32-process (~> 0.8.2)
|
127
129
|
wmi-lite (~> 1.0)
|
128
|
-
multi_json (1.
|
130
|
+
multi_json (1.13.1)
|
129
131
|
net-scp (1.2.1)
|
130
132
|
net-ssh (>= 2.6.5)
|
131
133
|
net-sftp (2.1.2)
|
132
134
|
net-ssh (>= 2.6.5)
|
133
|
-
net-ssh (4.
|
135
|
+
net-ssh (4.2.0)
|
134
136
|
net-ssh-gateway (2.0.0)
|
135
137
|
net-ssh (>= 4.0.0)
|
136
138
|
net-ssh-multi (1.2.1)
|
137
139
|
net-ssh (>= 2.6.5)
|
138
140
|
net-ssh-gateway (>= 1.2.0)
|
139
141
|
net-telnet (0.1.1)
|
140
|
-
ohai (
|
141
|
-
chef-config (>= 12.
|
142
|
+
ohai (14.0.29)
|
143
|
+
chef-config (>= 12.8, < 15)
|
142
144
|
ffi (~> 1.9)
|
143
145
|
ffi-yajl (~> 2.2)
|
144
146
|
ipaddress
|
145
147
|
mixlib-cli
|
146
148
|
mixlib-config (~> 2.0)
|
147
|
-
mixlib-log (
|
149
|
+
mixlib-log (~> 2.0, >= 2.0.1)
|
148
150
|
mixlib-shellout (~> 2.0)
|
149
151
|
plist (~> 3.1)
|
150
152
|
systemu (~> 2.6.4)
|
151
153
|
wmi-lite (~> 1.0)
|
152
|
-
plist (3.
|
154
|
+
plist (3.4.0)
|
153
155
|
proxifier (1.0.3)
|
154
|
-
public_suffix (
|
155
|
-
rack (2.0.
|
156
|
-
rake (12.
|
157
|
-
rdoc (
|
156
|
+
public_suffix (3.0.2)
|
157
|
+
rack (2.0.5)
|
158
|
+
rake (12.3.1)
|
159
|
+
rdoc (6.0.3)
|
158
160
|
rdp-ruby-wmi (0.3.1)
|
159
|
-
rspec (3.
|
160
|
-
rspec-core (~> 3.
|
161
|
-
rspec-expectations (~> 3.
|
162
|
-
rspec-mocks (~> 3.
|
163
|
-
rspec-core (3.
|
164
|
-
rspec-support (~> 3.
|
165
|
-
rspec-expectations (3.
|
161
|
+
rspec (3.7.0)
|
162
|
+
rspec-core (~> 3.7.0)
|
163
|
+
rspec-expectations (~> 3.7.0)
|
164
|
+
rspec-mocks (~> 3.7.0)
|
165
|
+
rspec-core (3.7.1)
|
166
|
+
rspec-support (~> 3.7.0)
|
167
|
+
rspec-expectations (3.7.0)
|
166
168
|
diff-lcs (>= 1.2.0, < 2.0)
|
167
|
-
rspec-support (~> 3.
|
169
|
+
rspec-support (~> 3.7.0)
|
168
170
|
rspec-its (1.2.0)
|
169
171
|
rspec-core (>= 3.0.0)
|
170
172
|
rspec-expectations (>= 3.0.0)
|
171
|
-
rspec-mocks (3.
|
173
|
+
rspec-mocks (3.7.0)
|
172
174
|
diff-lcs (>= 1.2.0, < 2.0)
|
173
|
-
rspec-support (~> 3.
|
174
|
-
rspec-support (3.
|
175
|
+
rspec-support (~> 3.7.0)
|
176
|
+
rspec-support (3.7.1)
|
175
177
|
rspec_junit_formatter (0.2.3)
|
176
178
|
builder (< 4)
|
177
179
|
rspec-core (>= 2, < 4, != 2.12.0)
|
178
|
-
serverspec (2.
|
180
|
+
serverspec (2.41.3)
|
179
181
|
multi_json
|
180
182
|
rspec (~> 3.0)
|
181
183
|
rspec-its
|
182
|
-
specinfra (~> 2.
|
184
|
+
specinfra (~> 2.72)
|
183
185
|
sfl (2.3)
|
184
|
-
specinfra (2.
|
186
|
+
specinfra (2.73.3)
|
185
187
|
net-scp
|
186
188
|
net-ssh (>= 2.7, < 5.0)
|
187
189
|
net-telnet
|
188
190
|
sfl
|
189
191
|
syslog-logger (1.6.8)
|
190
192
|
systemu (2.6.5)
|
193
|
+
tomlrb (1.2.6)
|
191
194
|
uuidtools (2.1.5)
|
192
195
|
win32-api (1.5.3-universal-mingw32)
|
193
196
|
win32-dir (0.5.1)
|
@@ -217,8 +220,8 @@ GEM
|
|
217
220
|
|
218
221
|
PLATFORMS
|
219
222
|
ruby
|
223
|
+
x64-mingw32
|
220
224
|
x86-mingw32
|
221
|
-
x86-mswin32
|
222
225
|
|
223
226
|
DEPENDENCIES
|
224
227
|
ffi
|
@@ -239,4 +242,4 @@ DEPENDENCIES
|
|
239
242
|
windows-pr
|
240
243
|
|
241
244
|
BUNDLED WITH
|
242
|
-
1.
|
245
|
+
1.16.1
|
data/RELEASE_NOTES.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# Push Jobs Client Release Notes
|
2
|
+
|
3
|
+
## 2.4.9
|
4
|
+
|
5
|
+
This release ships with notable fixes for a long standing issue where the Client could become deadlocked after encoutering network disruptions communicating with the Server.
|
6
|
+
|
7
|
+
*Note*
|
8
|
+
|
9
|
+
Due to the nature of the fixes above we are eager to hear your feedback on _any_ changes obeserved from the typical behavior of previous Client versions!
|
data/RELEASE_PROCESS.md
CHANGED
@@ -39,7 +39,7 @@ Currently, push-client must be manually tested to verify that it behaves correct
|
|
39
39
|
### Building and Releasing the Release
|
40
40
|
|
41
41
|
- [ ] Tag the opscode-pushy-client repository with the release version: `git
|
42
|
-
tag -a VERSION_NUMBER`.
|
42
|
+
tag -a VERSION_NUMBER`. - This is currently done by Chef Expediter.
|
43
43
|
|
44
44
|
- [ ] Push the new tag: `git push origin master --tags`.
|
45
45
|
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.4.11
|
data/lib/pushy_client.rb
CHANGED
@@ -23,7 +23,11 @@ require_relative 'pushy_client/periodic_reconfigurer'
|
|
23
23
|
require_relative 'pushy_client/whitelist'
|
24
24
|
require 'ohai'
|
25
25
|
require 'uuidtools'
|
26
|
-
|
26
|
+
if RUBY_PLATFORM =~ /aix/
|
27
|
+
require 'rbzmq/zmq'
|
28
|
+
else
|
29
|
+
require 'ffi-rzmq'
|
30
|
+
end
|
27
31
|
require 'cgi'
|
28
32
|
|
29
33
|
class PushyClient
|
@@ -36,6 +40,7 @@ class PushyClient
|
|
36
40
|
@hostname = options[:hostname]
|
37
41
|
@file_dir = options[:file_dir] || '/tmp/pushy'
|
38
42
|
@file_dir_expiry = options[:file_dir_expiry] || 86400
|
43
|
+
@allowed_overwritable_env_vars = options[:allowed_overwritable_env_vars]
|
39
44
|
|
40
45
|
@allow_unencrypted = options[:allow_unencrypted] || false
|
41
46
|
@client_curve_pub_key, @client_curve_sec_key = ZMQ::Util.curve_keypair
|
@@ -76,6 +81,7 @@ class PushyClient
|
|
76
81
|
attr_accessor :whitelist
|
77
82
|
attr_reader :incarnation_id
|
78
83
|
attr_reader :legacy_mode # indicate we've fallen back to 1.x
|
84
|
+
attr_reader :allowed_overwritable_env_vars
|
79
85
|
|
80
86
|
# crypto
|
81
87
|
attr_reader :client_curve_pub_key
|
@@ -172,6 +178,10 @@ class PushyClient
|
|
172
178
|
@protocol_handler.send_heartbeat(sequence)
|
173
179
|
end
|
174
180
|
|
181
|
+
def update_reconfigure_deadline(delay)
|
182
|
+
@periodic_reconfigurer.update_reconfigure_deadline(delay)
|
183
|
+
end
|
184
|
+
|
175
185
|
def commit(job_id, command, opts)
|
176
186
|
@job_runner.commit(job_id, command, opts)
|
177
187
|
end
|
@@ -214,27 +224,55 @@ class PushyClient
|
|
214
224
|
resource = "/pushy/config/#{node_name}"
|
215
225
|
|
216
226
|
Chef::Log.info "[#{node_name}] Retrieving configuration from #{chef_server_url}/#{resource}: ..."
|
217
|
-
esc_key = CGI
|
227
|
+
esc_key = CGI.escape(@client_curve_pub_key)
|
218
228
|
version = PushyClient::PROTOCOL_VERSION
|
219
229
|
resource = "pushy/config/#{node_name}?ccpk=#{esc_key}&version=#{version}"
|
220
230
|
|
221
|
-
|
231
|
+
Chef::Config[:rest_timeout] = 5
|
232
|
+
|
233
|
+
if @config.nil?
|
234
|
+
# We are being called from the `start` method not `trigger_reconfigure`
|
235
|
+
# so we know this is the first time fetching the config after a clean service start/restart.
|
236
|
+
# We therefore want to give ample opportunity to fetch the config, otherwise
|
237
|
+
# we raise and exception and the service stops - hopefully to be started again
|
238
|
+
# on the next chef-client run by push-jobs cookbook.
|
239
|
+
|
240
|
+
Chef::Config[:http_retry_delay] = 30
|
241
|
+
Chef::Config[:http_retry_count] = 5
|
242
|
+
else
|
243
|
+
# We have already fetched the config once, therefore we're being called from `trigger_reconfigure`
|
244
|
+
# Here we do not want the typical retry behavior from Chef::HTTP since `reconfigure` already
|
245
|
+
# implements an effective retry mechanism. Otherwise, `reconfigure` threads have the potential to
|
246
|
+
# start to pile up.
|
247
|
+
|
248
|
+
Chef::Config[:http_retry_delay] = 0
|
249
|
+
Chef::Config[:http_retry_count] = 0
|
250
|
+
end
|
251
|
+
|
252
|
+
begin
|
253
|
+
config = rest.get(resource)
|
254
|
+
rescue
|
255
|
+
Chef::Log.info('Could not download push jobs config')
|
256
|
+
update_reconfigure_deadline(120)
|
257
|
+
raise 'Could not download push jobs config'
|
258
|
+
end
|
222
259
|
|
223
|
-
if config.
|
224
|
-
|
260
|
+
if config && config.key?('curve_public_key')
|
261
|
+
# Version 2.0 or greater, we should use encryption
|
225
262
|
@using_curve = true
|
226
263
|
@legacy_mode = false
|
227
|
-
elsif allow_unencrypted
|
264
|
+
elsif allow_unencrypted
|
228
265
|
@using_curve = false
|
229
266
|
@legacy_mode = true
|
230
267
|
Chef::Log.info "[#{node_name}] No key returned from server; falling back to 1.x protocol (no encryption)"
|
231
268
|
else
|
232
|
-
msg = "[#{node_name}] Exiting: No key returned from server; server may be using 1.x protocol.
|
269
|
+
msg = "[#{node_name}] Exiting: No key returned from server; server may be using 1.x protocol. \
|
270
|
+
The config flag 'allow_unencrypted' disables encryption and allows use of 1.x server. Use with caution!"
|
233
271
|
Chef::Log.error msg
|
234
272
|
Kernel.abort msg
|
235
273
|
config = nil
|
236
274
|
end
|
237
|
-
|
275
|
+
config
|
238
276
|
end
|
239
277
|
|
240
278
|
# XXX Should go in a separate file
|
data/lib/pushy_client/cli.rb
CHANGED
@@ -132,7 +132,8 @@ class PushyClient
|
|
132
132
|
:whitelist => Chef::Config[:whitelist] || { 'chef-client' => 'chef-client' },
|
133
133
|
:hostname => ohai[:hostname],
|
134
134
|
:filedir => Chef::Config[:file_dir],
|
135
|
-
:allow_unencrypted => Chef::Config[:allow_unencrypted]
|
135
|
+
:allow_unencrypted => Chef::Config[:allow_unencrypted],
|
136
|
+
:allowed_overwritable_env_vars => Chef::Config[:allowed_overwritable_env_vars]
|
136
137
|
)
|
137
138
|
|
138
139
|
@client.start
|