sunzi 0.2.0 → 0.2.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.
- data/README.md +5 -5
- data/lib/sunzi/cli.rb +7 -4
- data/lib/sunzi/version.rb +1 -1
- data/sunzi.gemspec +2 -2
- metadata +5 -5
data/README.md
CHANGED
@@ -5,16 +5,16 @@ Sunzi
|
|
5
5
|
"The supreme art of war is to subdue the enemy without fighting." - Sunzi
|
6
6
|
```
|
7
7
|
|
8
|
-
Sunzi is
|
8
|
+
Sunzi is the easiest server provisioning utility designed for mere mortals. If Chef or Puppet is driving you nuts, try Sunzi!
|
9
9
|
|
10
|
-
Sunzi assumes that Linux distributions have (mostly) sane defaults.
|
10
|
+
Sunzi assumes that modern Linux distributions have (mostly) sane defaults and great package managers.
|
11
11
|
|
12
12
|
Its design goals are:
|
13
13
|
|
14
|
-
* **
|
15
|
-
* **
|
16
|
-
* **Minimum dependencies.** No configuration server required. You don't even need a Ruby runtime on the remote server.
|
14
|
+
* **It's just shell script.** No clunky Ruby DSL involved. Sunzi recipes are written in a plain shell script. Why? Because, most of the information about server configuration on the web is written in shell commands. Just copy-paste them, why should you translate it into a proprietary, inconvenience DSL? Also, shell script is the greatest common denominator on minimum Linux installs.
|
15
|
+
* **Focus on diff from default.** No big-bang overwriting. Append or replace the smallest possible piece of data in a config file. Loads of custom configurations makes it difficult to understand what you are really doing.
|
17
16
|
* **Always use the root user.** Think twice before blindly assuming you need a regular user - it doesn't add any security benefit for server provisioning, it just adds extra verbosity for nothing. However, it doesn't mean that you shouldn't create regular users with Sunzi - feel free to write your own recipes.
|
17
|
+
* **Minimum dependencies.** No configuration server required. You don't even need a Ruby runtime on the remote server.
|
18
18
|
|
19
19
|
Quickstart
|
20
20
|
----------
|
data/lib/sunzi/cli.rb
CHANGED
@@ -15,7 +15,7 @@ module Sunzi
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
# map "
|
18
|
+
# map "c" => :create
|
19
19
|
# map "d" => :deploy
|
20
20
|
|
21
21
|
desc "create [PROJECT]", "Create sunzi project"
|
@@ -42,8 +42,11 @@ module Sunzi
|
|
42
42
|
port ||= 22
|
43
43
|
user, domain = host.split('@')
|
44
44
|
|
45
|
+
# The host key might change when we instantiate a new VM, so
|
46
|
+
# we remove (-R) the old host key from known_hosts.
|
47
|
+
`ssh-keygen -R #{domain} 2> /dev/null`
|
48
|
+
|
45
49
|
commands = <<-EOS
|
46
|
-
ssh-keygen -R #{domain}
|
47
50
|
cd remote
|
48
51
|
tar cz . | ssh -o 'StrictHostKeyChecking no' #{host} -p #{port} '
|
49
52
|
rm -rf ~/sunzi &&
|
@@ -57,11 +60,11 @@ module Sunzi
|
|
57
60
|
stdin.close
|
58
61
|
t = Thread.new(stderr) do |terr|
|
59
62
|
while (line = terr.gets)
|
60
|
-
print
|
63
|
+
print shell.set_color(line, :red, true)
|
61
64
|
end
|
62
65
|
end
|
63
66
|
while (line = stdout.gets)
|
64
|
-
print
|
67
|
+
print print shell.set_color(line, :green, true)
|
65
68
|
end
|
66
69
|
t.join
|
67
70
|
end
|
data/lib/sunzi/version.rb
CHANGED
data/sunzi.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.authors = ["Kenn Ejima"]
|
9
9
|
s.email = ["kenn.ejima@gmail.com"]
|
10
10
|
s.homepage = "http://github.com/kenn/sunzi"
|
11
|
-
s.summary = %q{Server provisioning
|
12
|
-
s.description = %q{Server provisioning
|
11
|
+
s.summary = %q{Server provisioning utility for minimalists}
|
12
|
+
s.description = %q{Server provisioning utility for minimalists}
|
13
13
|
|
14
14
|
s.rubyforge_project = "sunzi"
|
15
15
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sunzi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-02-25 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
|
-
requirement: &
|
16
|
+
requirement: &2152751920 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,8 +21,8 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
25
|
-
description: Server provisioning
|
24
|
+
version_requirements: *2152751920
|
25
|
+
description: Server provisioning utility for minimalists
|
26
26
|
email:
|
27
27
|
- kenn.ejima@gmail.com
|
28
28
|
executables:
|
@@ -67,5 +67,5 @@ rubyforge_project: sunzi
|
|
67
67
|
rubygems_version: 1.8.15
|
68
68
|
signing_key:
|
69
69
|
specification_version: 3
|
70
|
-
summary: Server provisioning
|
70
|
+
summary: Server provisioning utility for minimalists
|
71
71
|
test_files: []
|