chake 0.14 → 0.15
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/.gitlab-ci.yml +3 -1
- data/ChangeLog.md +7 -0
- data/README.md +9 -6
- data/Rakefile +1 -1
- data/lib/chake.rb +12 -7
- data/lib/chake/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97aa2aa5205e9b1f7443dac44a1dd76820dd1075
|
4
|
+
data.tar.gz: 0ea452333ef4fce2a152aa437dde099940f18da0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7107ef453e6f5289abb903055be87d5d63b9e8e411fc4884ef580e8f8a022c8d5dd895f6891728a8e81b028682b1198b28072e031a81b1d1a13a193bb86c842
|
7
|
+
data.tar.gz: 558c7a4e2b1e960beb1d2bacdc0ad8e74d871fc1411666b544d5c88266a2205de3422f1ebf8f324f5338b553e4643df78dd8e432795b32b2756795be85027b11
|
data/.gitlab-ci.yml
CHANGED
data/ChangeLog.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# 0.15
|
2
|
+
|
3
|
+
* improve text in the parallel execution docs
|
4
|
+
* add new hook: `connect_common`, which will run before any attempt to connect
|
5
|
+
to any node.
|
6
|
+
* make output of `check` target more explicit about what was tested
|
7
|
+
|
1
8
|
# 0.14
|
2
9
|
|
3
10
|
* Fix typo in README.md
|
data/README.md
CHANGED
@@ -120,12 +120,12 @@ $ rake check
|
|
120
120
|
|
121
121
|
Note that by default all tasks that apply to all hosts will run in parallel,
|
122
122
|
using rake's support for multitasks. If for some reason you need to prevent
|
123
|
-
that, you can pass `-j1` (or --jobs=1`) in the rake invocation. Note that
|
124
|
-
will
|
125
|
-
machine you are running it
|
126
|
-
them to be handled in parallel, you might want o pass `-j` (or
|
127
|
-
without any number
|
128
|
-
perform in parallel.
|
123
|
+
that, you can pass `-j1` (or --jobs=1`) in the rake invocation. Note that by
|
124
|
+
default rake will only run N+4 tasks in parallel, where N is the number of
|
125
|
+
cores on the machine you are running it. If you have more than N+4 hosts and
|
126
|
+
want all of them to be handled in parallel, you might want o pass `-j` (or
|
127
|
+
`--jobs`), without any number, as the last argument; with that rake will have
|
128
|
+
no limit on the number of tasks to perform in parallel.
|
129
129
|
|
130
130
|
|
131
131
|
To apply the configuration to all nodes, run
|
@@ -222,6 +222,9 @@ converging. To do this, you just need to enhance the corresponding tasks:
|
|
222
222
|
already been bootstrapped)
|
223
223
|
* `upload_common`: executed before uploading content to the node
|
224
224
|
* `converge_common`: executed before converging (i.e. running chef)
|
225
|
+
* `connect_common`: executed before doing any action that connects to any of
|
226
|
+
the hosts. This can be used for example to generate a ssh configuration file
|
227
|
+
based on the contents of the nodes definition files.
|
225
228
|
|
226
229
|
Example:
|
227
230
|
|
data/Rakefile
CHANGED
@@ -15,7 +15,7 @@ task 'build:tarball' => 'bundler:build' do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
desc 'Create Debian source package'
|
18
|
-
task 'build:debsrc' => ['build:tarball'] do
|
18
|
+
task 'build:debsrc' => ['bundler:clobber', 'build:tarball'] do
|
19
19
|
dirname = "#{pkg.name}-#{pkg.version}"
|
20
20
|
chdir 'pkg' do
|
21
21
|
sh 'gem2deb', '--no-wnpp-check', '-s', '-p', pkg.name, "#{dirname}.tar.gz"
|
data/lib/chake.rb
CHANGED
@@ -132,13 +132,16 @@ end
|
|
132
132
|
bootstrap_steps = Dir.glob(File.expand_path('chake/bootstrap/*.sh', File.dirname(__FILE__))).sort
|
133
133
|
|
134
134
|
desc 'Executed before bootstrapping'
|
135
|
-
task :bootstrap_common
|
135
|
+
task :bootstrap_common => :connect_common
|
136
136
|
|
137
137
|
desc 'Executed before uploading'
|
138
|
-
task :upload_common
|
138
|
+
task :upload_common => :connect_common
|
139
139
|
|
140
140
|
desc 'Executed before uploading'
|
141
|
-
task :converge_common
|
141
|
+
task :converge_common => :connect_common
|
142
|
+
|
143
|
+
desc 'Executed before connecting to any host'
|
144
|
+
task :connect_common
|
142
145
|
|
143
146
|
$nodes.each do |node|
|
144
147
|
|
@@ -223,24 +226,24 @@ $nodes.each do |node|
|
|
223
226
|
end
|
224
227
|
|
225
228
|
desc 'apply <recipe> on #{hostname}'
|
226
|
-
task "apply:#{hostname}", [:recipe] => [:recipe_input] do |task, args|
|
229
|
+
task "apply:#{hostname}", [:recipe] => [:recipe_input, :connect_common] do |task, args|
|
227
230
|
chef_logging = Rake.application.options.silent && '-l fatal' || ''
|
228
231
|
node.run_as_root "chef-solo -c #{node.path}/#{chef_config} #{chef_logging} -j #{node.path}/#{$chake_tmpdir}/#{hostname}.json --override-runlist recipe[#{$recipe_to_apply}]"
|
229
232
|
end
|
230
233
|
task "apply:#{hostname}" => converge_dependencies
|
231
234
|
|
232
235
|
desc "run a command on #{hostname}"
|
233
|
-
task "run:#{hostname}", [:command] => [:run_input] do
|
236
|
+
task "run:#{hostname}", [:command] => [:run_input, :connect_common] do
|
234
237
|
node.run($cmd_to_run)
|
235
238
|
end
|
236
239
|
|
237
240
|
desc "Logs in to a shell on #{hostname}"
|
238
|
-
task "login:#{hostname}" do
|
241
|
+
task "login:#{hostname}" => :connect_common do
|
239
242
|
node.run_shell
|
240
243
|
end
|
241
244
|
|
242
245
|
desc 'checks connectivity and setup on all nodes'
|
243
|
-
task "check:#{hostname}" do
|
246
|
+
task "check:#{hostname}" => :connect_common do
|
244
247
|
node.run('sudo true')
|
245
248
|
end
|
246
249
|
|
@@ -308,4 +311,6 @@ task :default => :converge
|
|
308
311
|
desc 'checks connectivity and setup on all nodes'
|
309
312
|
multitask :check => ($nodes.map { |node| "check:#{node.hostname}" }) do
|
310
313
|
puts "✓ all hosts OK"
|
314
|
+
puts " - ssh connection works"
|
315
|
+
puts " - password-less sudo works"
|
311
316
|
end
|
data/lib/chake/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.15'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antonio Terceiro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|