itamae 1.0.0.beta37 → 1.0.0.beta38
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/README.md +10 -17
- data/lib/itamae/definition.rb +1 -1
- data/lib/itamae/resource/base.rb +5 -3
- data/lib/itamae/resource/directory.rb +1 -1
- data/lib/itamae/resource/execute.rb +1 -1
- data/lib/itamae/resource/file.rb +2 -2
- data/lib/itamae/resource/git.rb +1 -1
- data/lib/itamae/resource/link.rb +1 -1
- data/lib/itamae/resource/local_ruby_block.rb +1 -1
- data/lib/itamae/resource/package.rb +1 -1
- data/lib/itamae/resource/service.rb +6 -6
- data/lib/itamae/resource/user.rb +1 -1
- data/lib/itamae/version.txt +1 -1
- data/spec/integration/default_spec.rb +5 -1
- data/spec/integration/recipes/default.rb +17 -2
- data/spec/unit/lib/itamae/resource/base_spec.rb +2 -2
- 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: 8b3714f298036bb34c563fd1d7d95b594af288db
|
4
|
+
data.tar.gz: 416f02e423816f68ce22d45ba191af0096015690
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb55a96ab5f7971118cc69d94f95cc795993783f671cd834a0282633410d4946bd0694c4748a837c5584caf37fb5dc3c495eb4e057c05706ce4cabb39a91b1de
|
7
|
+
data.tar.gz: eeec88c4ccdf6ef0c118b34e2204e05de07e15b17ecd03fdfb2272e47424235c45e78ef2d41016bb64fb52ccfd01e3e3c7780b87c3a7bc4ee3ba30b661a2c85b
|
data/README.md
CHANGED
@@ -15,31 +15,24 @@ Simple and lightweight configuration management tool inspired by Chef.
|
|
15
15
|
$ gem install itamae
|
16
16
|
```
|
17
17
|
|
18
|
-
## Usage
|
18
|
+
## Basic Usage
|
19
19
|
|
20
20
|
### Run locally
|
21
21
|
|
22
22
|
```
|
23
|
-
$ sudo itamae execute -j example/node.json
|
24
|
-
D, [2013-12-24T14:05:50.859587 #7156] DEBUG -- : Loading node data from /vagrant/example/node.json ...
|
25
|
-
I, [2013-12-24T14:05:50.862072 #7156] INFO -- : >>> Executing Itamae::Resource::Package ({:action=>:install, :name=>"git"})...
|
26
|
-
D, [2013-12-24T14:05:51.335070 #7156] DEBUG -- : Command `apt-get -y install git` succeeded
|
27
|
-
D, [2013-12-24T14:05:51.335251 #7156] DEBUG -- : STDOUT> Reading package lists...
|
28
|
-
Building dependency tree...
|
29
|
-
Reading state information...
|
30
|
-
git is already the newest version.
|
31
|
-
0 upgraded, 0 newly installed, 0 to remove and 156 not upgraded.
|
32
|
-
D, [2013-12-24T14:05:51.335464 #7156] DEBUG -- : STDERR>
|
33
|
-
I, [2013-12-24T14:05:51.335531 #7156] INFO -- : <<< Succeeded.
|
34
|
-
I, [2013-12-24T14:05:51.335728 #7156] INFO -- : >>> Executing Itamae::Resource::File ({:action=>:create, :source=>"foo", :path=>"/home/vagrant/foo"})...
|
35
|
-
D, [2013-12-24T14:05:51.335842 #7156] DEBUG -- : Copying a file from '/vagrant/example/foo' to '/home/vagrant/foo'...
|
36
|
-
I, [2013-12-24T14:05:51.339119 #7156] INFO -- : <<< Succeeded.
|
23
|
+
$ sudo itamae execute -j example/node.json recipe.rb
|
37
24
|
```
|
38
25
|
|
39
26
|
### Run via SSH
|
40
27
|
|
41
28
|
```
|
42
|
-
$ itamae ssh -j example/node.json -h 192.168.10.10 -p 22 -u user -i /path/to/private_key
|
29
|
+
$ itamae ssh -j example/node.json -h 192.168.10.10 -p 22 -u user -i /path/to/private_key recipe.rb
|
30
|
+
```
|
31
|
+
|
32
|
+
#### Vagrant Integration
|
33
|
+
|
34
|
+
```
|
35
|
+
$ itamae ssh -h vagrant_vm_name --vagrant recipe.rb
|
43
36
|
```
|
44
37
|
|
45
38
|
## Recipes
|
@@ -54,7 +47,7 @@ end
|
|
54
47
|
|
55
48
|
Further example is here: [spec/integration/recipes/default.rb](spec/integration/recipes/default.rb)
|
56
49
|
|
57
|
-
##
|
50
|
+
## Documentations
|
58
51
|
|
59
52
|
https://github.com/ryotarai/itamae/wiki
|
60
53
|
|
data/lib/itamae/definition.rb
CHANGED
data/lib/itamae/resource/base.rb
CHANGED
@@ -78,7 +78,7 @@ module Itamae
|
|
78
78
|
Logger.debug "(in show_differences)"
|
79
79
|
show_differences
|
80
80
|
|
81
|
-
public_send("#{specific_action || action}
|
81
|
+
public_send("action_#{specific_action || action}".to_sym, options)
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
@@ -94,7 +94,7 @@ module Itamae
|
|
94
94
|
exit 2
|
95
95
|
end
|
96
96
|
|
97
|
-
def
|
97
|
+
def action_nothing(options)
|
98
98
|
# do nothing
|
99
99
|
end
|
100
100
|
|
@@ -136,7 +136,9 @@ module Itamae
|
|
136
136
|
|
137
137
|
def different?
|
138
138
|
@current_attributes.each_pair.any? do |key, current_value|
|
139
|
-
current_value
|
139
|
+
current_value &&
|
140
|
+
@attributes[key] &&
|
141
|
+
current_value != @attributes[key]
|
140
142
|
end
|
141
143
|
end
|
142
144
|
|
data/lib/itamae/resource/file.rb
CHANGED
@@ -66,7 +66,7 @@ module Itamae
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
-
def
|
69
|
+
def action_create(options)
|
70
70
|
if mode
|
71
71
|
run_specinfra(:change_file_mode, @temppath, mode)
|
72
72
|
end
|
@@ -89,7 +89,7 @@ module Itamae
|
|
89
89
|
run_specinfra(:move_file, @temppath, path)
|
90
90
|
end
|
91
91
|
|
92
|
-
def
|
92
|
+
def action_delete(options)
|
93
93
|
if run_specinfra(:check_file_is_file, path)
|
94
94
|
run_specinfra(:remove_file, path)
|
95
95
|
end
|
data/lib/itamae/resource/git.rb
CHANGED
data/lib/itamae/resource/link.rb
CHANGED
@@ -24,27 +24,27 @@ module Itamae
|
|
24
24
|
@current_attributes[:enabled?] = run_specinfra(:check_service_is_enabled, name)
|
25
25
|
end
|
26
26
|
|
27
|
-
def
|
27
|
+
def action_start(options)
|
28
28
|
run_specinfra(:start_service, name)
|
29
29
|
end
|
30
30
|
|
31
|
-
def
|
31
|
+
def action_stop(options)
|
32
32
|
run_specinfra(:stop_service, name)
|
33
33
|
end
|
34
34
|
|
35
|
-
def
|
35
|
+
def action_restart(options)
|
36
36
|
run_specinfra(:restart_service, name)
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
39
|
+
def action_reload(options)
|
40
40
|
run_specinfra(:reload_service, name)
|
41
41
|
end
|
42
42
|
|
43
|
-
def
|
43
|
+
def action_enable(options)
|
44
44
|
run_specinfra(:enable_service, name)
|
45
45
|
end
|
46
46
|
|
47
|
-
def
|
47
|
+
def action_disable(options)
|
48
48
|
run_specinfra(:disable_service, name)
|
49
49
|
end
|
50
50
|
end
|
data/lib/itamae/resource/user.rb
CHANGED
data/lib/itamae/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.0.
|
1
|
+
1.0.0.beta38
|
@@ -97,7 +97,11 @@ describe file('/tmp/created_in_default2') do
|
|
97
97
|
it { should be_file }
|
98
98
|
end
|
99
99
|
|
100
|
-
describe file('/tmp/
|
100
|
+
describe file('/tmp/never_exist3') do
|
101
|
+
it { should_not be_file }
|
102
|
+
end
|
103
|
+
|
104
|
+
describe file('/tmp/never_exist4') do
|
101
105
|
it { should_not be_file }
|
102
106
|
end
|
103
107
|
|
@@ -162,11 +162,11 @@ end
|
|
162
162
|
|
163
163
|
#####
|
164
164
|
|
165
|
-
file "/tmp/
|
165
|
+
file "/tmp/never_exist3" do
|
166
166
|
action :create
|
167
167
|
end
|
168
168
|
|
169
|
-
file "/tmp/
|
169
|
+
file "/tmp/never_exist3" do
|
170
170
|
action :delete
|
171
171
|
end
|
172
172
|
|
@@ -180,3 +180,18 @@ definition_example "name" do
|
|
180
180
|
key 'value'
|
181
181
|
end
|
182
182
|
|
183
|
+
#####
|
184
|
+
|
185
|
+
file "/tmp/never_exist4" do
|
186
|
+
action :nothing
|
187
|
+
end
|
188
|
+
|
189
|
+
file "/tmp/file1" do
|
190
|
+
content "Hello, World"
|
191
|
+
end
|
192
|
+
|
193
|
+
file "/tmp/file1" do
|
194
|
+
content "Hello, World"
|
195
|
+
notifies :create, "file[/tmp/never_exist4]"
|
196
|
+
end
|
197
|
+
|
@@ -109,10 +109,10 @@ describe TestResource do
|
|
109
109
|
|
110
110
|
describe "#run" do
|
111
111
|
before do
|
112
|
-
subject.action :
|
112
|
+
subject.action :name
|
113
113
|
end
|
114
114
|
it "executes <ACTION_NAME>_action method" do
|
115
|
-
expect(subject).to receive(:
|
115
|
+
expect(subject).to receive(:action_name)
|
116
116
|
subject.run
|
117
117
|
end
|
118
118
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itamae
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta38
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryota Arai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|