chake 0.90.3 → 0.92
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.manifest +1 -0
- data/ChangeLog.md +13 -0
- data/README.md +24 -3
- data/Rakefile +2 -2
- data/activate.sh +3 -0
- data/bin/chake +1 -1
- data/lib/chake/config_manager/itamae.rb +4 -1
- data/lib/chake/config_manager/itamae_remote.rb +4 -1
- data/lib/chake/version.rb +1 -1
- data/lib/chake.rb +22 -9
- metadata +4 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 796da031fd0926e8f4a2ba13a949dc6b308d0ceb811a8568db08a5ca54f99a07
|
4
|
+
data.tar.gz: ab0c285bbbe3a7e8ce6b665ac63de976c4a6239ebc2e356ec7f8ded4caaa0f3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f8ee4d755b3beb84e101c694823e685ce121ec4b26183b0048db91da7d5ced6fcda624fc29cd96f6e111aa28d6e4a4b13e145d7f5887bf59032b3c1db868691
|
7
|
+
data.tar.gz: 0320fe56feaf9a4c8e514cbf33cfff46cd24f68daa88ab6c74e88ab475d8e4c13b0ac7477a463a28478aa38cad55dd588cfbe028ff1315fd62c1baf71d8e5bbb
|
data/.manifest
CHANGED
data/ChangeLog.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
# 0.92
|
2
|
+
|
3
|
+
- Add support for connect:$HOST hooks
|
4
|
+
|
5
|
+
# 0.91
|
6
|
+
|
7
|
+
- itamae: handle empty recipe list
|
8
|
+
- Add support for configuring encrypted files explicitly
|
9
|
+
- itamae-remote: handle empty recipe list
|
10
|
+
- Rakefile: deb:install: install dependencies as well
|
11
|
+
- activate.sh: add script to use this source dir in a shell
|
12
|
+
- Make rsync invocations quiet by default
|
13
|
+
|
1
14
|
# 0.90.3
|
2
15
|
|
3
16
|
- `itamae_spec`: fix rspec warning about syntax for `expect { }.to raise`
|
data/README.md
CHANGED
@@ -254,6 +254,8 @@ converging. To do this, you just need to enhance the corresponding tasks:
|
|
254
254
|
* `connect_common`: executed before doing any action that connects to any of
|
255
255
|
the hosts. This can be used for example to generate a ssh configuration file
|
256
256
|
based on the contents of the nodes definition files.
|
257
|
+
* `connect:HOSTNAME`: executed before doing any action that connects to
|
258
|
+
`HOSTNAME`.
|
257
259
|
|
258
260
|
Example:
|
259
261
|
|
@@ -265,9 +267,28 @@ end
|
|
265
267
|
|
266
268
|
### Encrypted files
|
267
269
|
|
268
|
-
|
269
|
-
|
270
|
-
|
270
|
+
`chake` supports encrypted files matching either `\*.gpg` or `\*.asc`. There are
|
271
|
+
two ways of specicying per-host encrypted files:
|
272
|
+
|
273
|
+
1. listing them in the `encrypted` attribute in the node configuration file.
|
274
|
+
Example:
|
275
|
+
|
276
|
+
```yaml
|
277
|
+
host1.mycompany.com:
|
278
|
+
itamae:
|
279
|
+
- roles/basic.rb
|
280
|
+
encrypted:
|
281
|
+
- foo.txt.asc
|
282
|
+
```
|
283
|
+
2. (deprecated) any files matching
|
284
|
+
`\*\*/files/{default,host-#{node}}/\*.{asc,gpg}` and
|
285
|
+
`\*\*/files/\*.{asc,gpg}`, **if** `encrypted` is not defined in the node
|
286
|
+
configuration.
|
287
|
+
|
288
|
+
|
289
|
+
They will be decrypted with GnuPG before being sent to the node (for the
|
290
|
+
configuration management tools that required files to be sent), without the
|
291
|
+
`\*.asc` or `\*.gpg` extension. You can use them to store passwords and other
|
271
292
|
sensitive information (SSL keys, etc) in the repository together with the rest
|
272
293
|
of the configuration.
|
273
294
|
|
data/Rakefile
CHANGED
@@ -36,7 +36,7 @@ desc 'Builds and installs Debian package'
|
|
36
36
|
task 'deb:install' => 'build:debsrc' do
|
37
37
|
chdir "pkg/#{pkg.name}-#{pkg.version}" do
|
38
38
|
sh 'dpkg-buildpackage --diff-ignore=version.rb -us -uc'
|
39
|
-
sh '
|
39
|
+
sh 'sudo apt-get install -qy --reinstall $(debc --list-debs)'
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -100,7 +100,7 @@ end
|
|
100
100
|
|
101
101
|
desc 'Check spelling in the source code'
|
102
102
|
task :codespell do
|
103
|
-
sh 'codespell', '--skip=.git', '--skip=coverage', '--skip=*.asc', '--skip=*.swp', '--skip=tags'
|
103
|
+
sh 'codespell', '--skip=.git', '--skip=coverage', '--skip=*.asc', '--skip=*.swp', '--skip=tags', '--skip=*.1'
|
104
104
|
end
|
105
105
|
|
106
106
|
task default: [:test, :style, :codespell]
|
data/activate.sh
ADDED
data/bin/chake
CHANGED
data/lib/chake/version.rb
CHANGED
data/lib/chake.rb
CHANGED
@@ -31,18 +31,28 @@ task :nodes do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def encrypted_for(node)
|
34
|
-
encrypted_files =
|
34
|
+
encrypted_files = Array(node.data['encrypted'])
|
35
|
+
if encrypted_files.empty?
|
36
|
+
encrypted_files = Dir.glob("**/files/{default,host-#{node.hostname}}/*.{asc,gpg}") + Dir.glob('**/files/*.{asc,gpg}')
|
37
|
+
end
|
35
38
|
encrypted_files.each_with_object({}) do |key, hash|
|
36
39
|
hash[key] = key.sub(/\.(asc|gpg)$/, '')
|
37
40
|
end
|
38
41
|
end
|
39
42
|
|
43
|
+
desc 'list encrypted files per node'
|
44
|
+
task :encrypted do
|
45
|
+
Chake.nodes.each do |node|
|
46
|
+
puts "#{node.hostname}: #{Array(encrypted_for(node).keys).join(', ')}"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
40
50
|
def maybe_decrypt(node)
|
41
51
|
if node.needs_upload?
|
42
52
|
return yield
|
43
53
|
end
|
44
54
|
|
45
|
-
files = encrypted_for(node
|
55
|
+
files = encrypted_for(node)
|
46
56
|
files.each do |encrypted, target|
|
47
57
|
sh "gpg --use-agent --quiet --decrypt --output #{target} #{encrypted}"
|
48
58
|
end
|
@@ -131,15 +141,15 @@ Chake.nodes.each do |node|
|
|
131
141
|
task "upload:#{hostname}" => ["bootstrap:#{hostname}", :upload_common] do
|
132
142
|
next unless node.needs_upload?
|
133
143
|
|
134
|
-
encrypted = encrypted_for(
|
144
|
+
encrypted = encrypted_for(node)
|
135
145
|
rsync_excludes = (encrypted.values + encrypted.keys).map { |f| ['--exclude', f] }.flatten
|
136
146
|
rsync_excludes << '--exclude' << '.git/'
|
137
147
|
rsync_excludes << '--exclude' << 'cache/'
|
138
148
|
rsync_excludes << '--exclude' << 'nodes/'
|
139
149
|
rsync_excludes << '--exclude' << 'local-mode-cache/'
|
140
150
|
|
141
|
-
rsync = node.rsync + ['-
|
142
|
-
rsync_logging = (Rake.application.options.
|
151
|
+
rsync = node.rsync + ['-ap'] + ENV.fetch('CHAKE_RSYNC_OPTIONS', '').split
|
152
|
+
rsync_logging = (Rake.application.options.trace && '--verbose') || '--quiet'
|
143
153
|
|
144
154
|
hash_files = Dir.glob(File.join(Chake.tmpdir, '*.sha1sum'))
|
145
155
|
files = Dir.glob('**/*').reject { |f| File.directory?(f) } - encrypted.keys - encrypted.values - hash_files
|
@@ -175,7 +185,7 @@ Chake.nodes.each do |node|
|
|
175
185
|
end
|
176
186
|
|
177
187
|
desc 'apply <recipe> on #{hostname}'
|
178
|
-
task "apply:#{hostname}", [:recipe] =>
|
188
|
+
task "apply:#{hostname}", [:recipe] => [:recipe_input, :connect_common, "connect:#{hostname}"] do |_task, _args|
|
179
189
|
maybe_decrypt(node) do
|
180
190
|
node.apply($recipe_to_apply)
|
181
191
|
end
|
@@ -183,19 +193,22 @@ Chake.nodes.each do |node|
|
|
183
193
|
task "apply:#{hostname}" => converge_dependencies
|
184
194
|
|
185
195
|
desc "run a command on #{hostname}"
|
186
|
-
task "run:#{hostname}", [:command] =>
|
196
|
+
task "run:#{hostname}", [:command] => [:run_input, :connect_common, "connect:#{hostname}"] do
|
187
197
|
node.run($cmd_to_run)
|
188
198
|
end
|
189
199
|
|
190
200
|
desc "Logs in to a shell on #{hostname}"
|
191
|
-
task "login:#{hostname}" => :connect_common do
|
201
|
+
task "login:#{hostname}" => [:connect_common, "connect:#{hostname}"] do
|
192
202
|
node.run_shell
|
193
203
|
end
|
194
204
|
|
195
205
|
desc 'checks connectivity and setup on all nodes'
|
196
|
-
task "check:#{hostname}" => :connect_common do
|
206
|
+
task "check:#{hostname}" => [:connect_common, "connect:#{hostname}"] do
|
197
207
|
node.run('sudo echo OK')
|
198
208
|
end
|
209
|
+
|
210
|
+
# needs to be overridden in user projects
|
211
|
+
task "connect:#{hostname}"
|
199
212
|
end
|
200
213
|
|
201
214
|
task :run_input, :command do |_task, args|
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.92'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antonio Terceiro
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-21 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: bundler
|
@@ -121,6 +120,7 @@ files:
|
|
121
120
|
- README.md
|
122
121
|
- README.shell.md
|
123
122
|
- Rakefile
|
123
|
+
- activate.sh
|
124
124
|
- bin/chake
|
125
125
|
- chake.gemspec
|
126
126
|
- chake.spec.erb
|
@@ -184,7 +184,6 @@ licenses:
|
|
184
184
|
- MIT
|
185
185
|
metadata:
|
186
186
|
rubygems_mfa_required: 'true'
|
187
|
-
post_install_message:
|
188
187
|
rdoc_options: []
|
189
188
|
require_paths:
|
190
189
|
- lib
|
@@ -199,8 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
198
|
- !ruby/object:Gem::Version
|
200
199
|
version: '0'
|
201
200
|
requirements: []
|
202
|
-
rubygems_version: 3.3
|
203
|
-
signing_key:
|
201
|
+
rubygems_version: 3.6.3
|
204
202
|
specification_version: 4
|
205
203
|
summary: serverless configuration management tool for chef
|
206
204
|
test_files:
|