chake 0.6 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +8 -0
- data/README.md +2 -1
- data/chake.gemspec +2 -2
- data/lib/chake.rb +7 -8
- data/lib/chake/bootstrap/00_set_hostname.sh +9 -0
- data/lib/chake/bootstrap/{00_centos7.sh → 01_centos7.sh} +0 -0
- data/lib/chake/bootstrap/{00_debian.sh → 01_debian.sh} +0 -0
- data/lib/chake/version.rb +1 -1
- metadata +11 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41bab755897f490a53f097a252bc9b67ec0f36c9
|
4
|
+
data.tar.gz: a63cf815c00c0698f39e7786f43f57ce97f09e1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c19065bb9da3196b99040a53ea4d8ee1472b721658b9492a64e93ae650eece308d9ea1797eff52b163a4b2afb9ca675e1326de255720cd7d9188a99738a4330
|
7
|
+
data.tar.gz: 87b95fd2d51d8791b74542825e4cefac9d34b5a44a17e6c1676fd6517e7c8dd612fc00e252616a3ff923dec2cb1c4e1f6f4b75248cef5cccebf524422d2e62a4
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# 0.7
|
2
|
+
|
3
|
+
* gemspec: improve summary and description
|
4
|
+
* Also for encrypted files under $cookbook/files/, and not only under
|
5
|
+
$cookbook/files/\*/.
|
6
|
+
* Allow overriding tmpdir with `$CHAKE_TMPDIR`
|
7
|
+
* Stop cloud-init from resetting the hostname
|
8
|
+
|
1
9
|
# 0.6
|
2
10
|
|
3
11
|
* Support a ssh prefix command by setting `$CHAKE_SSH_PREFIX` in the
|
data/README.md
CHANGED
@@ -209,7 +209,8 @@ vice-versa.
|
|
209
209
|
| `$CHAKE_SSH_CONFIG` | local SSH configuration file | `.ssh_config` |
|
210
210
|
| `$CHAKE_SSH_PREFIX` | Command to prefix SSH (and rsync over SSH) calls with | _none_ |
|
211
211
|
| `$CHAKE_RSYNC_OPTIONS` | extra options to pass to `rsync`. Useful to e.g. exclude large files from being upload to each server | _none_ |
|
212
|
-
| `$CHAKE_NODES` | File containing the list of servers to be managed |
|
212
|
+
| `$CHAKE_NODES` | File containing the list of servers to be managed | `nodes.yaml` |
|
213
|
+
| `$CHAKE_TMPDIR` | Directory used to store temporary cache files | `tmp/chake` |
|
213
214
|
|
214
215
|
## Contributing
|
215
216
|
|
data/chake.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Chake::VERSION
|
9
9
|
spec.authors = ["Antonio Terceiro"]
|
10
10
|
spec.email = ["terceiro@softwarelivre.org"]
|
11
|
-
spec.summary = %q{
|
12
|
-
spec.description = %q{chake
|
11
|
+
spec.summary = %q{serverless configuration management tool for chef}
|
12
|
+
spec.description = %q{chake allows one to manage a number of hosts via SSH by combining chef (solo) and rake. It doesn't require a chef server; all you need is a workstation from where you can SSH into all your hosts. chake automates copying the configuration management repository to the target host (including managing encrypted files), running chef on them, and arbitraty commands on the hosts.}
|
13
13
|
spec.homepage = "https://gitlab.com/terceiro/chake"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
data/lib/chake.rb
CHANGED
@@ -11,7 +11,7 @@ require 'chake/node'
|
|
11
11
|
nodes_file = ENV['CHAKE_NODES'] || 'nodes.yaml'
|
12
12
|
node_data = File.exists?(nodes_file) && YAML.load_file(nodes_file) || {}
|
13
13
|
$nodes = node_data.map { |node,data| Chake::Node.new(node, data) }.reject(&:skip?).uniq(&:hostname)
|
14
|
-
$chake_tmpdir = 'tmp/chake'
|
14
|
+
$chake_tmpdir = ENV.fetch('CHAKE_TMPDIR', 'tmp/chake')
|
15
15
|
|
16
16
|
desc "Initializes current directory with sample structure"
|
17
17
|
task :init do
|
@@ -75,7 +75,8 @@ task :nodes do
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def encrypted_for(node)
|
78
|
-
Dir.glob("**/files/{default,host-#{node}}/*.{asc,gpg}").
|
78
|
+
encrypted_files = Dir.glob("**/files/{default,host-#{node}}/*.{asc,gpg}") + Dir.glob("**/files/*.{asc,gpg}")
|
79
|
+
encrypted_files.inject({}) do |hash, key|
|
79
80
|
hash[key] = key.sub(/\.(asc|gpg)$/, '')
|
80
81
|
hash
|
81
82
|
end
|
@@ -104,21 +105,19 @@ def write_json_file(file, data)
|
|
104
105
|
end
|
105
106
|
end
|
106
107
|
|
107
|
-
|
108
|
+
bootstrap_steps = Dir.glob(File.expand_path('chake/bootstrap/*.sh', File.dirname(__FILE__))).sort
|
108
109
|
|
109
110
|
$nodes.each do |node|
|
110
111
|
|
111
112
|
hostname = node.hostname
|
112
113
|
bootstrap_script = File.join($chake_tmpdir, 'bootstrap-' + hostname)
|
113
114
|
|
114
|
-
file bootstrap_script =>
|
115
|
+
file bootstrap_script => bootstrap_steps do |t|
|
115
116
|
mkdir_p(File.dirname(bootstrap_script))
|
116
117
|
File.open(t.name, 'w') do |f|
|
117
118
|
f.puts '#!/bin/sh'
|
118
119
|
f.puts 'set -eu'
|
119
|
-
|
120
|
-
f.puts 'hostname --file /etc/hostname'
|
121
|
-
platforms.each do |platform|
|
120
|
+
bootstrap_steps.each do |platform|
|
122
121
|
f.puts(File.read(platform))
|
123
122
|
end
|
124
123
|
end
|
@@ -139,7 +138,7 @@ $nodes.each do |node|
|
|
139
138
|
sh *scp, bootstrap_script, node.scp_dest + target
|
140
139
|
|
141
140
|
# run bootstrap script
|
142
|
-
node.run_as_root(target)
|
141
|
+
node.run_as_root("#{target} #{hostname}")
|
143
142
|
|
144
143
|
# overwrite config with current contents
|
145
144
|
mkdir_p File.dirname(config)
|
File without changes
|
File without changes
|
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.7'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antonio Terceiro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,9 +52,11 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
description: chake
|
56
|
-
|
57
|
-
from where you can SSH into all your hosts.
|
55
|
+
description: chake allows one to manage a number of hosts via SSH by combining chef
|
56
|
+
(solo) and rake. It doesn't require a chef server; all you need is a workstation
|
57
|
+
from where you can SSH into all your hosts. chake automates copying the configuration
|
58
|
+
management repository to the target host (including managing encrypted files), running
|
59
|
+
chef on them, and arbitraty commands on the hosts.
|
58
60
|
email:
|
59
61
|
- terceiro@softwarelivre.org
|
60
62
|
executables:
|
@@ -79,8 +81,9 @@ files:
|
|
79
81
|
- lib/chake/backend.rb
|
80
82
|
- lib/chake/backend/local.rb
|
81
83
|
- lib/chake/backend/ssh.rb
|
82
|
-
- lib/chake/bootstrap/
|
83
|
-
- lib/chake/bootstrap/
|
84
|
+
- lib/chake/bootstrap/00_set_hostname.sh
|
85
|
+
- lib/chake/bootstrap/01_centos7.sh
|
86
|
+
- lib/chake/bootstrap/01_debian.sh
|
84
87
|
- lib/chake/bootstrap/99_unsupported.sh
|
85
88
|
- lib/chake/node.rb
|
86
89
|
- lib/chake/version.rb
|
@@ -112,7 +115,7 @@ rubyforge_project:
|
|
112
115
|
rubygems_version: 2.2.2
|
113
116
|
signing_key:
|
114
117
|
specification_version: 4
|
115
|
-
summary:
|
118
|
+
summary: serverless configuration management tool for chef
|
116
119
|
test_files:
|
117
120
|
- spec/chake/backend/local_spec.rb
|
118
121
|
- spec/chake/backend/ssh_spec.rb
|