dream-ops 0.7.0 → 0.8.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8b007fcf3a075614dc42f84cc722ccf4f4de27e5
4
- data.tar.gz: 04a440399ff9dbb2cac9b9b99d9c6815c37becb2
2
+ SHA256:
3
+ metadata.gz: 8f74a60092899e8668d2d20ff9c5a0c0dda15074f071d11ac9d76779e6852f6b
4
+ data.tar.gz: 8e9864ad0ed4c625594ae819a5e0cceb08a185cb8a20a31416cb32d0345948e1
5
5
  SHA512:
6
- metadata.gz: 93bb6a02da4398fcb4546f51b0f084374356a0622fba41fd0b5409f2452d656424ea066d10762bc4534d4313ec05d2a2e418986e999f064b654a6193326a8077
7
- data.tar.gz: 9d21948bda4ed935798c203d15c3a9f8e2b6457a87dbb6aba250dd56c40dc4b46910d1b18a816d95d2943250e93299ef6916f7749e80f9db84b80ca6cc132181
6
+ metadata.gz: a3cdd826b2b7c9e4c8910e1ea8de24e47daf472309a4364eeae5bc9c78cba325de8e2588b66e84629f37a992ac01e88b00b1c1eed85749e2d9e3c8c962954da3
7
+ data.tar.gz: 3f3fbdb0f051e3cb3cf323388e7fe77cc6233e24f0b6a875c7757f314313f06515ac75a7634957fc3a2010f0e08e1007abe26e36606c844ecb8619f3d7a714bc
@@ -0,0 +1,22 @@
1
+ name: Static Tests
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+
11
+ jobs:
12
+ build:
13
+ name: Build
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: ruby/setup-ruby@v1
18
+ with:
19
+ bundler-cache: true
20
+ ruby-version: 3.1
21
+ - run: bundle exec rake spec
22
+
data/.gitignore CHANGED
@@ -1,10 +1,9 @@
1
1
  .DS_Store
2
2
  /.bundle/
3
3
  /.yardoc
4
- /Gemfile.lock
5
4
  /_yardoc/
6
5
  /coverage/
7
6
  /doc/
8
7
  /pkg/
9
8
  /spec/reports/
10
- /tmp/
9
+ /tmp/
data/CHANGELOG.md CHANGED
@@ -6,6 +6,25 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.8.1]
10
+
11
+ ### Fixed
12
+ - Resolved issue with `archive-tar-minitar`
13
+
14
+ ### Changed
15
+ - Now tracking `Gemfile.lock` in version control
16
+ - Switched from travis-ci to github actions
17
+
18
+ ## [0.8.0]
19
+
20
+ ### Changed
21
+ - Updated to use CINC instead of Chef Workstation
22
+ - Updated to `thor@1.x` which removes warnings when using ruby 3.x
23
+
24
+ ### Fixes
25
+ - Adds `solo` support for Ubuntu 22.04
26
+ - Better error handling of missing SSH key for `solo` commands
27
+
9
28
  ## [0.7.0]
10
29
 
11
30
  ### Changed
@@ -73,7 +92,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
73
92
  - Gem version badge to README
74
93
  - Usage documentation
75
94
 
76
- [Unreleased]: https://github.com/chris-allen/dream-ops/compare/v0.7.0...HEAD
95
+ [Unreleased]: https://github.com/chris-allen/dream-ops/compare/v0.8.1...HEAD
96
+ [0.8.1]: https://github.com/chris-allen/dream-ops/compare/v0.8.0...v0.8.1
97
+ [0.8.0]: https://github.com/chris-allen/dream-ops/compare/v0.7.0...v0.8.0
77
98
  [0.7.0]: https://github.com/chris-allen/dream-ops/compare/v0.6.1...v0.7.0
78
99
  [0.6.1]: https://github.com/chris-allen/dream-ops/compare/v0.6.0...v0.6.1
79
100
  [0.6.0]: https://github.com/chris-allen/dream-ops/compare/v0.5.0...v0.6.0
data/Gemfile.lock ADDED
@@ -0,0 +1,264 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ dream-ops (0.8.1)
5
+ archive-tar-minitar
6
+ aws-sdk-configservice (~> 1)
7
+ aws-sdk-core
8
+ aws-sdk-opsworks (~> 1)
9
+ aws-sdk-s3 (~> 1)
10
+ berkshelf (~> 7.0)
11
+ chef (~> 13.6)
12
+ inifile (~> 3.0)
13
+ nokogiri
14
+ rubyzip (~> 1.2)
15
+ thor (~> 1.0)
16
+
17
+ GEM
18
+ remote: https://rubygems.org/
19
+ specs:
20
+ addressable (2.8.7)
21
+ public_suffix (>= 2.0.2, < 7.0)
22
+ archive-tar-minitar (0.5.2)
23
+ aws-eventstream (1.3.0)
24
+ aws-partitions (1.977.0)
25
+ aws-sdk-configservice (1.118.0)
26
+ aws-sdk-core (~> 3, >= 3.207.0)
27
+ aws-sigv4 (~> 1.5)
28
+ aws-sdk-core (3.207.0)
29
+ aws-eventstream (~> 1, >= 1.3.0)
30
+ aws-partitions (~> 1, >= 1.651.0)
31
+ aws-sigv4 (~> 1.9)
32
+ jmespath (~> 1, >= 1.6.1)
33
+ aws-sdk-kms (1.92.0)
34
+ aws-sdk-core (~> 3, >= 3.207.0)
35
+ aws-sigv4 (~> 1.5)
36
+ aws-sdk-opsworks (1.65.0)
37
+ aws-sdk-core (~> 3, >= 3.207.0)
38
+ aws-sigv4 (~> 1.5)
39
+ aws-sdk-s3 (1.164.0)
40
+ aws-sdk-core (~> 3, >= 3.207.0)
41
+ aws-sdk-kms (~> 1)
42
+ aws-sigv4 (~> 1.5)
43
+ aws-sigv4 (1.10.0)
44
+ aws-eventstream (~> 1, >= 1.0.2)
45
+ base64 (0.2.0)
46
+ berkshelf (7.0.10)
47
+ chef (>= 13.6.52)
48
+ chef-config
49
+ cleanroom (~> 1.0)
50
+ concurrent-ruby (~> 1.0)
51
+ minitar (>= 0.6)
52
+ mixlib-archive (>= 0.4, < 2.0)
53
+ mixlib-config (>= 2.2.5)
54
+ mixlib-shellout (>= 2.0, < 4.0)
55
+ octokit (~> 4.0)
56
+ retryable (>= 2.0, < 4.0)
57
+ solve (~> 4.0)
58
+ thor (>= 0.20)
59
+ builder (3.3.0)
60
+ chef (13.10.0)
61
+ addressable
62
+ bundler (>= 1.10)
63
+ chef-config (= 13.10.0)
64
+ chef-zero (~> 13.0)
65
+ diff-lcs (~> 1.2, >= 1.2.4)
66
+ erubis (~> 2.7)
67
+ ffi-yajl (~> 2.2)
68
+ highline (~> 1.6, >= 1.6.9)
69
+ iniparse (~> 1.4)
70
+ iso8601 (~> 0.9.1)
71
+ mixlib-archive (~> 0.4)
72
+ mixlib-authentication (~> 1.4)
73
+ mixlib-cli (~> 1.7)
74
+ mixlib-log (~> 1.3)
75
+ mixlib-shellout (~> 2.0)
76
+ net-sftp (~> 2.1, >= 2.1.2)
77
+ net-ssh (>= 2.9, < 5.0)
78
+ net-ssh-multi (~> 1.2, >= 1.2.1)
79
+ ohai (~> 13.0)
80
+ plist (~> 3.2)
81
+ proxifier (~> 1.0)
82
+ rspec-core (~> 3.5)
83
+ rspec-expectations (~> 3.5)
84
+ rspec-mocks (~> 3.5)
85
+ rspec_junit_formatter (~> 0.2.0)
86
+ serverspec (~> 2.7)
87
+ specinfra (~> 2.10)
88
+ syslog-logger (~> 1.6)
89
+ uuidtools (~> 2.1.5)
90
+ chef-config (13.10.0)
91
+ addressable
92
+ fuzzyurl
93
+ mixlib-config (>= 2.2.12, < 3.0)
94
+ mixlib-shellout (~> 2.0)
95
+ tomlrb (~> 1.2)
96
+ chef-zero (13.1.0)
97
+ ffi-yajl (~> 2.2)
98
+ hashie (>= 2.0, < 4.0)
99
+ mixlib-log (~> 1.3)
100
+ rack (~> 2.0)
101
+ uuidtools (~> 2.1)
102
+ cleanroom (1.0.0)
103
+ concurrent-ruby (1.3.4)
104
+ diff-lcs (1.5.1)
105
+ erubis (2.7.0)
106
+ faraday (2.12.0)
107
+ faraday-net_http (>= 2.0, < 3.4)
108
+ json
109
+ logger
110
+ faraday-net_http (3.3.0)
111
+ net-http
112
+ ffi (1.17.0)
113
+ ffi (1.17.0-aarch64-linux-gnu)
114
+ ffi (1.17.0-aarch64-linux-musl)
115
+ ffi (1.17.0-arm-linux-gnu)
116
+ ffi (1.17.0-arm-linux-musl)
117
+ ffi (1.17.0-arm64-darwin)
118
+ ffi (1.17.0-x86-linux-gnu)
119
+ ffi (1.17.0-x86-linux-musl)
120
+ ffi (1.17.0-x86_64-darwin)
121
+ ffi (1.17.0-x86_64-linux-gnu)
122
+ ffi (1.17.0-x86_64-linux-musl)
123
+ ffi-yajl (2.6.0)
124
+ libyajl2 (>= 1.2)
125
+ fuzzyurl (0.9.0)
126
+ hashie (3.6.0)
127
+ highline (1.7.10)
128
+ inifile (3.0.0)
129
+ iniparse (1.5.0)
130
+ ipaddress (0.8.3)
131
+ iso8601 (0.9.1)
132
+ jmespath (1.6.2)
133
+ json (2.7.2)
134
+ libyajl2 (2.1.0)
135
+ logger (1.6.1)
136
+ mini_portile2 (2.8.7)
137
+ minitar (1.0.2)
138
+ mixlib-archive (0.4.20)
139
+ mixlib-log
140
+ mixlib-authentication (1.4.2)
141
+ mixlib-cli (1.7.0)
142
+ mixlib-config (2.2.18)
143
+ tomlrb
144
+ mixlib-log (1.7.1)
145
+ mixlib-shellout (2.4.4)
146
+ molinillo (0.8.0)
147
+ multi_json (1.15.0)
148
+ net-http (0.4.1)
149
+ uri
150
+ net-scp (4.0.0)
151
+ net-ssh (>= 2.6.5, < 8.0.0)
152
+ net-sftp (2.1.2)
153
+ net-ssh (>= 2.6.5)
154
+ net-ssh (4.2.0)
155
+ net-ssh-gateway (2.0.0)
156
+ net-ssh (>= 4.0.0)
157
+ net-ssh-multi (1.2.1)
158
+ net-ssh (>= 2.6.5)
159
+ net-ssh-gateway (>= 1.2.0)
160
+ net-telnet (0.2.0)
161
+ nokogiri (1.16.7)
162
+ mini_portile2 (~> 2.8.2)
163
+ racc (~> 1.4)
164
+ nokogiri (1.16.7-aarch64-linux)
165
+ racc (~> 1.4)
166
+ nokogiri (1.16.7-arm-linux)
167
+ racc (~> 1.4)
168
+ nokogiri (1.16.7-arm64-darwin)
169
+ racc (~> 1.4)
170
+ nokogiri (1.16.7-x86-linux)
171
+ racc (~> 1.4)
172
+ nokogiri (1.16.7-x86_64-darwin)
173
+ racc (~> 1.4)
174
+ nokogiri (1.16.7-x86_64-linux)
175
+ racc (~> 1.4)
176
+ octokit (4.25.1)
177
+ faraday (>= 1, < 3)
178
+ sawyer (~> 0.9)
179
+ ohai (13.12.6)
180
+ chef-config (>= 12.5.0.alpha.1, < 14)
181
+ ffi (~> 1.9)
182
+ ffi-yajl (~> 2.2)
183
+ ipaddress
184
+ mixlib-cli (< 2.0)
185
+ mixlib-config (~> 2.0)
186
+ mixlib-log (>= 1.7.1, < 2.0)
187
+ mixlib-shellout (~> 2.0)
188
+ plist (~> 3.1)
189
+ systemu (~> 2.6.4)
190
+ wmi-lite (~> 1.0)
191
+ plist (3.7.1)
192
+ proxifier (1.0.3)
193
+ public_suffix (6.0.1)
194
+ racc (1.8.1)
195
+ rack (2.2.9)
196
+ rake (10.5.0)
197
+ retryable (3.0.5)
198
+ rspec (3.13.0)
199
+ rspec-core (~> 3.13.0)
200
+ rspec-expectations (~> 3.13.0)
201
+ rspec-mocks (~> 3.13.0)
202
+ rspec-core (3.13.1)
203
+ rspec-support (~> 3.13.0)
204
+ rspec-expectations (3.13.3)
205
+ diff-lcs (>= 1.2.0, < 2.0)
206
+ rspec-support (~> 3.13.0)
207
+ rspec-its (1.3.0)
208
+ rspec-core (>= 3.0.0)
209
+ rspec-expectations (>= 3.0.0)
210
+ rspec-mocks (3.13.1)
211
+ diff-lcs (>= 1.2.0, < 2.0)
212
+ rspec-support (~> 3.13.0)
213
+ rspec-support (3.13.1)
214
+ rspec_junit_formatter (0.2.3)
215
+ builder (< 4)
216
+ rspec-core (>= 2, < 4, != 2.12.0)
217
+ rubyzip (1.3.0)
218
+ sawyer (0.9.2)
219
+ addressable (>= 2.3.5)
220
+ faraday (>= 0.17.3, < 3)
221
+ semverse (3.0.2)
222
+ serverspec (2.42.3)
223
+ multi_json
224
+ rspec (~> 3.0)
225
+ rspec-its
226
+ specinfra (~> 2.72)
227
+ sfl (2.3)
228
+ solve (4.0.4)
229
+ molinillo (~> 0.6)
230
+ semverse (>= 1.1, < 4.0)
231
+ specinfra (2.90.1)
232
+ base64
233
+ net-scp
234
+ net-ssh (>= 2.7)
235
+ net-telnet
236
+ sfl
237
+ syslog-logger (1.6.8)
238
+ systemu (2.6.5)
239
+ thor (1.3.2)
240
+ tomlrb (1.3.0)
241
+ uri (0.13.1)
242
+ uuidtools (2.1.5)
243
+ wmi-lite (1.0.7)
244
+
245
+ PLATFORMS
246
+ aarch64-linux-gnu
247
+ aarch64-linux-musl
248
+ arm-linux-gnu
249
+ arm-linux-musl
250
+ arm64-darwin
251
+ ruby
252
+ x86-linux-gnu
253
+ x86-linux-musl
254
+ x86_64-darwin
255
+ x86_64-linux-gnu
256
+ x86_64-linux-musl
257
+
258
+ DEPENDENCIES
259
+ bundler (~> 2.0)
260
+ dream-ops!
261
+ rake (~> 10.0)
262
+
263
+ BUNDLED WITH
264
+ 2.5.19
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # DreamOps
2
2
  [![Gem Version](https://img.shields.io/gem/v/dream-ops.svg)][gem]
3
- [![Build Status](https://travis-ci.com/chris-allen/dream-ops.svg?branch=master)](https://travis-ci.com/chris-allen/dream-ops)
3
+ ![Build Status](https://github.com/chris-allen/dream-ops/actions/workflows/ci.yml/badge.svg)
4
4
 
5
5
  [gem]: https://rubygems.org/gems/dream-ops
6
6
 
@@ -74,11 +74,11 @@ Target: ip-172-31-53-232
74
74
  ```bash
75
75
  dream init solo -T ubuntu@example.com -i /path/to/key.pem
76
76
  Target: ip-172-31-53-232
77
- --- Chef Workstation Installed: false
77
+ --- Is chef-solo Installed: false
78
78
  --- Valid chef.json: false
79
79
  --- Valid role[setup]: false
80
80
  --- Valid role[deploy]: false
81
- ...Installing Chef Workstation [target="ubuntu@example.com"]
81
+ ...Installing chef-solo via CINC [target="ubuntu@example.com"]
82
82
  ...Creating boilerplate /var/chef/chef.json [target="ubuntu@example.com"]
83
83
  ...Creating boilerplate /var/chef/roles/setup.json [target="ubuntu@example.com"]
84
84
  ...Creating boilerplate /var/chef/roles/deploy.json [target="ubuntu@example.com"]
@@ -92,7 +92,7 @@ To install this gem onto your local machine, run `bundle exec rake install`.
92
92
 
93
93
 
94
94
  ## Release
95
- ### switch to `master` branch:
95
+ ### switch to `main` branch:
96
96
  - Change package version in `version.rb` according to release changes (`major|minor|patch`).
97
97
  - Update `CHANGELOG.md`:
98
98
  - Rename `[Unreleased]` section to reflect new release version and release date, same format as for all previous releases
data/dream-ops.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.license = "MIT"
22
22
  spec.metadata = {
23
23
  "source_code_uri" => "https://github.com/chris-allen/dream-ops",
24
- "changelog_uri" => "https://github.com/chris-allen/dream-ops/blob/master/CHANGELOG.md"
24
+ "changelog_uri" => "https://github.com/chris-allen/dream-ops/blob/main/CHANGELOG.md"
25
25
  }
26
26
 
27
27
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -35,12 +35,14 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency "rake", "~> 10.0"
36
36
 
37
37
  spec.add_dependency "rubyzip", "~> 1.2"
38
+ spec.add_dependency "archive-tar-minitar"
39
+ spec.add_dependency "nokogiri"
38
40
  spec.add_dependency "aws-sdk-core"
39
41
  spec.add_dependency "aws-sdk-configservice", "~> 1"
40
42
  spec.add_dependency "aws-sdk-opsworks", "~> 1"
41
43
  spec.add_dependency "aws-sdk-s3", "~> 1"
42
44
  spec.add_dependency "inifile", "~> 3.0"
43
45
  spec.add_dependency "berkshelf", "~> 7.0"
44
- spec.add_dependency "thor", "~> 0.20"
46
+ spec.add_dependency "thor", "~> 1.0"
45
47
  spec.add_dependency "chef", "~> 13.6"
46
48
  end
data/lib/dream-ops/cli.rb CHANGED
@@ -55,7 +55,9 @@ module DreamOps
55
55
  if @options[:debug]
56
56
  ENV["DREAMOPS_DEBUG"] = "true"
57
57
  DreamOps.logger.level = ::Logger::DEBUG
58
+ Thread.report_on_exception = true
58
59
  else
60
+ Thread.report_on_exception = false
59
61
  Berkshelf.ui.mute!
60
62
  end
61
63
 
@@ -110,6 +112,10 @@ module DreamOps
110
112
  aliases: "-p",
111
113
  default: ""
112
114
 
115
+ def self.exit_on_failure?
116
+ false
117
+ end
118
+
113
119
  desc "version", "Display version"
114
120
  def version
115
121
  DreamOps.formatter.version
@@ -161,11 +161,16 @@ module DreamOps
161
161
 
162
162
  uuid = SecureRandom.uuid
163
163
 
164
+ chef_cmd = "cinc-solo"
165
+ if !system("ssh #{@ssh_opts} #{target[:host]} which cinc-solo #{@q_all}")
166
+ chef_cmd = "chef-solo --chef-license accept"
167
+ end
168
+
164
169
  pid = fork do
165
170
  if ! system(
166
171
  "ssh #{@ssh_opts} #{target[:host]} \"" +
167
172
  "set -o pipefail && " +
168
- "sudo chef-solo --chef-license accept -j /var/chef/chef.json -o \"role[#{role}]\" 2>&1 | sudo tee /var/log/chef/#{uuid}.log #{@q_all}\""
173
+ "sudo #{chef_cmd} -j /var/chef/chef.json -o \"role[#{role}]\" 2>&1 | sudo tee /var/log/chef/#{uuid}.log #{@q_all}\""
169
174
  )
170
175
  exit 1
171
176
  end
@@ -178,9 +183,9 @@ module DreamOps
178
183
  end
179
184
 
180
185
  def deploy_target(target, cookbooks)
181
- # Bail if Chef Workstation is not installed
182
- if !system("ssh #{@ssh_opts} #{target[:host]} which chef #{@q_all}")
183
- __bail_with_fatal_error(ChefWorkstationNotInstalledError.new(target[:host]))
186
+ # Bail if chef-solo is not installed
187
+ if !system("ssh #{@ssh_opts} #{target[:host]} which chef-solo #{@q_all}")
188
+ __bail_with_fatal_error(ChefSoloNotInstalledError.new(target[:host]))
184
189
  end
185
190
 
186
191
  # Bail if chef.json doesn't exist
@@ -66,7 +66,7 @@ module DreamOps
66
66
  end
67
67
  end
68
68
 
69
- class ChefWorkstationNotInstalledError < DreamOpsError
69
+ class ChefSoloNotInstalledError < DreamOpsError
70
70
  set_status_code(14)
71
71
 
72
72
  def initialize(target)
@@ -75,14 +75,14 @@ module DreamOps
75
75
 
76
76
  def to_s
77
77
  [
78
- "Chef Workstation not installed on target \"#{@target}\". To initialize chef-solo, run:",
78
+ "chef-solo not installed on target \"#{@target}\". To initialize chef-solo, run:",
79
79
  "",
80
80
  "dream init solo -t #{@target} -i #{DreamOps.ssh_key}",
81
81
  ].join("\n")
82
82
  end
83
83
  end
84
84
 
85
- class ChefWorkstationFailedError < DreamOpsError
85
+ class ChefSoloFailedError < DreamOpsError
86
86
  set_status_code(15)
87
87
 
88
88
  def initialize(target, wget_url)
@@ -92,7 +92,7 @@ module DreamOps
92
92
 
93
93
  def to_s
94
94
  [
95
- "Target \"#{@target}\" failed installing ChefWorkstation from:",
95
+ "Target \"#{@target}\" failed installing chef-solo via CINC from:",
96
96
  "",
97
97
  @wget_url,
98
98
  ].join("\n")
@@ -25,7 +25,7 @@ module DreamOps
25
25
  # [
26
26
  # {
27
27
  # :host => "ubuntu@example.com"
28
- # :chefdk_installed => false,
28
+ # :solo_installed => false,
29
29
  # :solo_json_exists => false,
30
30
  # :setup_role_exists => true,
31
31
  # :deploy_role_exists => true
@@ -21,8 +21,8 @@ module DreamOps
21
21
 
22
22
  target_result = { host: target }
23
23
 
24
- target_result[:chefdk_installed] = system("ssh #{@ssh_opts} #{target} which chef #{@q_all}")
25
- DreamOps.ui.info "--- Chef Workstation Installed: #{target_result[:chefdk_installed]}"
24
+ target_result[:solo_installed] = system("ssh #{@ssh_opts} #{target} which chef-solo #{@q_all}")
25
+ DreamOps.ui.info "--- Is chef-solo Installed: #{target_result[:solo_installed]}"
26
26
 
27
27
  target_result[:solo_json_exists] = system("ssh #{@ssh_opts} #{target} stat /var/chef/chef.json #{@q_all}")
28
28
  DreamOps.ui.info "--- Valid chef.json: #{target_result[:solo_json_exists]}"
@@ -40,31 +40,37 @@ module DreamOps
40
40
  end
41
41
 
42
42
  def init_target(target, dryrun)
43
- # Install ChefWorkstation if not already
44
- if !target[:chefdk_installed]
43
+ # Install chef-solo if not available
44
+ if !target[:solo_installed]
45
45
  if dryrun
46
- DreamOps.ui.warn "...WOULD Install Chef Workstation [target=\"#{target[:host]}\"]"
46
+ DreamOps.ui.warn "...WOULD Install chef-solo via CINC [target=\"#{target[:host]}\"]"
47
47
  else
48
- DreamOps.ui.warn "...Installing Chef Workstation [target=\"#{target[:host]}\"]"
48
+ DreamOps.ui.warn "...Installing chef-solo via CINC [target=\"#{target[:host]}\"]"
49
49
 
50
50
  # Get ubuntu version
51
51
  ubuntu_ver = `ssh #{@ssh_opts} #{target[:host]} "awk 'BEGIN { FS = \\"=\\" } /DISTRIB_RELEASE/ { print \\$2 }' /etc/lsb-release"`.chomp
52
52
 
53
53
  # Download and install the package
54
- deb_file = "chef-workstation_20.12.187-1_amd64.deb"
55
- chefworkstation_url = "https://packages.chef.io/files/stable/chef-workstation/20.12.187/ubuntu/#{ubuntu_ver}/#{deb_file}"
56
- if system("ssh #{@ssh_opts} #{target[:host]} \"wget #{chefworkstation_url} -P /tmp\" #{@q_all}")
54
+ deb_file = "cinc_17.10.0-1_amd64.deb"
55
+ cinc_url = "http://downloads.cinc.sh/files/stable/cinc/17.10.0/ubuntu/#{ubuntu_ver}/#{deb_file}"
56
+ if system("ssh #{@ssh_opts} #{target[:host]} \"wget #{cinc_url} -P /tmp\" #{@q_all}")
57
57
  `ssh #{@ssh_opts} #{target[:host]} "sudo dpkg -i /tmp/#{deb_file}" #{@q_all}`
58
58
  `ssh #{@ssh_opts} #{target[:host]} "sudo rm /tmp/#{deb_file}" #{@q_all}`
59
- `ssh #{@ssh_opts} #{target[:host]} "chef env --chef-license accept" #{@q_all}`
60
59
  else
61
- __bail_with_fatal_error(ChefWorkstationFailedError.new(target, chefworkstation_url))
60
+ __bail_with_fatal_error(ChefSoloFailedError.new(target, cinc_url))
62
61
  end
63
62
  end
64
63
  end
65
64
 
66
65
  if !dryrun
66
+ `ssh #{@ssh_opts} #{target[:host]} sudo mkdir -p /var/chef/cookbooks`
67
67
  `ssh #{@ssh_opts} #{target[:host]} sudo mkdir -p /var/chef/roles`
68
+
69
+ if system("ssh #{@ssh_opts} #{target[:host]} which cinc-solo #{@q_all}")
70
+ `ssh #{@ssh_opts} #{target[:host]} sudo mkdir /var/cinc`
71
+ `ssh #{@ssh_opts} #{target[:host]} sudo ln -s /var/chef/cookbooks /var/cinc/cookbooks`
72
+ `ssh #{@ssh_opts} #{target[:host]} sudo ln -s /var/chef/roles /var/cinc/roles`
73
+ end
68
74
  end
69
75
 
70
76
  # Create empty json file for chef-solo
@@ -1,3 +1,3 @@
1
1
  module DreamOps
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.1"
3
3
  end
data/lib/dream-ops.rb CHANGED
@@ -69,7 +69,7 @@ module DreamOps
69
69
  #
70
70
  # @return [~String]
71
71
  def ssh_key
72
- @ssh_key ||= nil
72
+ @ssh_key ||= ''
73
73
  end
74
74
 
75
75
  # Specify path to use for the SSH key
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dream-ops
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Allen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-15 00:00:00.000000000 Z
11
+ date: 2024-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,34 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.2'
55
+ - !ruby/object:Gem::Dependency
56
+ name: archive-tar-minitar
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: nokogiri
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: aws-sdk-core
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -142,14 +170,14 @@ dependencies:
142
170
  requirements:
143
171
  - - "~>"
144
172
  - !ruby/object:Gem::Version
145
- version: '0.20'
173
+ version: '1.0'
146
174
  type: :runtime
147
175
  prerelease: false
148
176
  version_requirements: !ruby/object:Gem::Requirement
149
177
  requirements:
150
178
  - - "~>"
151
179
  - !ruby/object:Gem::Version
152
- version: '0.20'
180
+ version: '1.0'
153
181
  - !ruby/object:Gem::Dependency
154
182
  name: chef
155
183
  requirement: !ruby/object:Gem::Requirement
@@ -175,10 +203,11 @@ executables:
175
203
  extensions: []
176
204
  extra_rdoc_files: []
177
205
  files:
206
+ - ".github/workflows/ci.yml"
178
207
  - ".gitignore"
179
- - ".travis.yml"
180
208
  - CHANGELOG.md
181
209
  - Gemfile
210
+ - Gemfile.lock
182
211
  - LICENSE.txt
183
212
  - README.md
184
213
  - Rakefile
@@ -207,8 +236,8 @@ licenses:
207
236
  - MIT
208
237
  metadata:
209
238
  source_code_uri: https://github.com/chris-allen/dream-ops
210
- changelog_uri: https://github.com/chris-allen/dream-ops/blob/master/CHANGELOG.md
211
- post_install_message:
239
+ changelog_uri: https://github.com/chris-allen/dream-ops/blob/main/CHANGELOG.md
240
+ post_install_message:
212
241
  rdoc_options: []
213
242
  require_paths:
214
243
  - lib
@@ -223,9 +252,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
252
  - !ruby/object:Gem::Version
224
253
  version: 2.0.0
225
254
  requirements: []
226
- rubyforge_project:
227
- rubygems_version: 2.6.14
228
- signing_key:
255
+ rubygems_version: 3.5.19
256
+ signing_key:
229
257
  specification_version: 4
230
258
  summary: CLI for automating the deployment of application cookbooks
231
259
  test_files: []
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.4
4
- before_install:
5
- - gem update --system
6
- - gem install bundler