itamae 1.9.8 → 1.9.9
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/CHANGELOG.md +12 -0
- data/README.md +1 -1
- data/itamae.gemspec +1 -1
- data/lib/itamae/backend.rb +3 -1
- data/lib/itamae/cli.rb +2 -0
- data/lib/itamae/resource/file.rb +10 -3
- data/lib/itamae/resource/gem_package.rb +18 -0
- data/lib/itamae/version.rb +1 -1
- data/spec/integration/default_spec.rb +8 -0
- data/spec/integration/recipes/default.rb +25 -0
- data/spec/unit/lib/itamae/backend_spec.rb +20 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83dedd045d05da0413cae3765fdb4a0c97f44121
|
4
|
+
data.tar.gz: d45bcc5ae690ed0044ccfddc06eadbbc6bfe9690
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 872059daf89a6e4a7ae772278b618055cbe03325e67d45bf4dc0e4cfd3e4ccac9ade93f6a20e9789d7bfb997b577c9ec05d819b96197084bb8a55bd61dc99d35
|
7
|
+
data.tar.gz: 4e27434ae02d17fb5613dd1693462e8f714ecd759aeef3430f24561de9244629fc5b72af3e79ec3f326544aa1bc38ef5eba591d3c8fc67516bbcc818e833b7e7
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
## v1.9.9
|
2
|
+
|
3
|
+
Features
|
4
|
+
|
5
|
+
- [`itamae ssh` now accepts `--ssh-config` option](https://github.com/itamae-kitchen/itamae/pull/211)
|
6
|
+
- [Introduce `--login-shell` option](https://github.com/itamae-kitchen/itamae/pull/217)
|
7
|
+
- [`gem_package` resource has `uninstall` action](https://github.com/itamae-kitchen/itamae/pull/216)
|
8
|
+
|
9
|
+
Bugfixes
|
10
|
+
|
11
|
+
- [`send_file` fails against docker backend](https://github.com/itamae-kitchen/itamae/pull/215)
|
12
|
+
|
1
13
|
## v1.9.8
|
2
14
|
|
3
15
|
Bugfixes
|
data/README.md
CHANGED
@@ -90,7 +90,7 @@ $ bundle exec rake spec
|
|
90
90
|
|
91
91
|
## Contributing
|
92
92
|
|
93
|
-
If you have a problem, please [create an issue](https://github.com/
|
93
|
+
If you have a problem, please [create an issue](https://github.com/itamae-kitchen/itamae/issues/new) or a pull request.
|
94
94
|
|
95
95
|
1. Fork it
|
96
96
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
data/itamae.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Ryota Arai"]
|
10
10
|
spec.email = ["ryota.arai@gmail.com"]
|
11
11
|
spec.summary = %q{Simple Configuration Management Tool}
|
12
|
-
spec.homepage = "https://github.com/
|
12
|
+
spec.homepage = "https://github.com/itamae-kitchen/itamae"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
15
15
|
spec.files = `git ls-files`.split($/)
|
data/lib/itamae/backend.rb
CHANGED
@@ -221,6 +221,7 @@ module Itamae
|
|
221
221
|
disable_sudo: disable_sudo?,
|
222
222
|
ssh_options: ssh_options,
|
223
223
|
shell: @options[:shell],
|
224
|
+
login_shell: @options[:login_shell],
|
224
225
|
)
|
225
226
|
end
|
226
227
|
|
@@ -230,7 +231,8 @@ module Itamae
|
|
230
231
|
opts[:host_name] = @options[:host]
|
231
232
|
|
232
233
|
# from ssh-config
|
233
|
-
|
234
|
+
ssh_config_files = @options[:ssh_config] ? [@options[:ssh_config]] : Net::SSH::Config.default_files
|
235
|
+
opts.merge!(Net::SSH::Config.for(@options[:host], ssh_config_files))
|
234
236
|
opts[:user] = @options[:user] || opts[:user] || Etc.getlogin
|
235
237
|
opts[:keys] = [@options[:key]] if @options[:key]
|
236
238
|
opts[:port] = @options[:port] if @options[:port]
|
data/lib/itamae/cli.rb
CHANGED
@@ -22,6 +22,7 @@ module Itamae
|
|
22
22
|
option :node_yaml, type: :string, aliases: ['-y']
|
23
23
|
option :dry_run, type: :boolean, aliases: ['-n']
|
24
24
|
option :shell, type: :string, default: "/bin/sh"
|
25
|
+
option :login_shell, type: :boolean, default: false
|
25
26
|
option :ohai, type: :boolean, default: false, desc: "This option is DEPRECATED and will be unavailable."
|
26
27
|
option :profile, type: :string, desc: "[EXPERIMENTAL] Save profiling data", banner: "PATH"
|
27
28
|
option :detailed_exitcode, type: :boolean, default: false, desc: "exit code 0 - The run succeeded with no changes or failures, exit code 1 - The run failed, exit code 2 - The run succeeded, and some resources were changed"
|
@@ -43,6 +44,7 @@ module Itamae
|
|
43
44
|
option :user, type: :string, aliases: ['-u']
|
44
45
|
option :key, type: :string, aliases: ['-i']
|
45
46
|
option :port, type: :numeric, aliases: ['-p']
|
47
|
+
option :ssh_config, type: :string
|
46
48
|
option :vagrant, type: :boolean, default: false
|
47
49
|
option :ask_password, type: :boolean, default: false
|
48
50
|
option :sudo, type: :boolean, default: true
|
data/lib/itamae/resource/file.rb
CHANGED
@@ -174,9 +174,16 @@ module Itamae
|
|
174
174
|
|
175
175
|
@temppath = ::File.join(runner.tmpdir, Time.now.to_f.to_s)
|
176
176
|
|
177
|
-
|
178
|
-
|
179
|
-
|
177
|
+
if backend.is_a?(Itamae::Backend::Docker)
|
178
|
+
run_command(["mkdir", @temppath])
|
179
|
+
backend.send_file(src, @temppath)
|
180
|
+
@temppath = ::File.join(@temppath, ::File.basename(src))
|
181
|
+
else
|
182
|
+
run_command(["touch", @temppath])
|
183
|
+
run_specinfra(:change_file_mode, @temppath, '0600')
|
184
|
+
backend.send_file(src, @temppath)
|
185
|
+
end
|
186
|
+
|
180
187
|
run_specinfra(:change_file_mode, @temppath, '0600')
|
181
188
|
ensure
|
182
189
|
f.unlink if f
|
@@ -14,6 +14,8 @@ module Itamae
|
|
14
14
|
case @current_action
|
15
15
|
when :install
|
16
16
|
attributes.installed = true
|
17
|
+
when :uninstall
|
18
|
+
attributes.installed = false
|
17
19
|
end
|
18
20
|
end
|
19
21
|
|
@@ -43,6 +45,10 @@ module Itamae
|
|
43
45
|
end
|
44
46
|
end
|
45
47
|
|
48
|
+
def action_uninstall(action_options)
|
49
|
+
uninstall! if current.installed
|
50
|
+
end
|
51
|
+
|
46
52
|
def action_upgrade(action_options)
|
47
53
|
return if current.installed && attributes.version && current.version == attributes.version
|
48
54
|
|
@@ -76,6 +82,18 @@ module Itamae
|
|
76
82
|
|
77
83
|
run_command(cmd)
|
78
84
|
end
|
85
|
+
|
86
|
+
def uninstall!
|
87
|
+
cmd = [*Array(attributes.gem_binary), 'uninstall', '--ignore-dependencies', '--executables', *Array(attributes.options)]
|
88
|
+
if attributes.version
|
89
|
+
cmd << '-v' << attributes.version
|
90
|
+
else
|
91
|
+
cmd << '--all'
|
92
|
+
end
|
93
|
+
cmd << attributes.package_name
|
94
|
+
|
95
|
+
run_command(cmd)
|
96
|
+
end
|
79
97
|
end
|
80
98
|
end
|
81
99
|
end
|
data/lib/itamae/version.rb
CHANGED
@@ -176,6 +176,14 @@ describe command('gem list') do
|
|
176
176
|
its(:stdout) { should include('tzinfo (1.2.2, 1.1.0)') }
|
177
177
|
end
|
178
178
|
|
179
|
+
describe command('gem list') do
|
180
|
+
its(:stdout) { should include('rake (11.1.0)') }
|
181
|
+
end
|
182
|
+
|
183
|
+
describe command('gem list') do
|
184
|
+
its(:stdout) { should_not include('test-unit') }
|
185
|
+
end
|
186
|
+
|
179
187
|
describe command('ri Bundler') do
|
180
188
|
its(:stderr) { should eq("Nothing known about Bundler\n") }
|
181
189
|
end
|
@@ -69,6 +69,31 @@ gem_package 'bundler' do
|
|
69
69
|
options ['--no-ri', '--no-rdoc']
|
70
70
|
end
|
71
71
|
|
72
|
+
gem_package 'rake' do
|
73
|
+
version '11.1.0'
|
74
|
+
end
|
75
|
+
|
76
|
+
gem_package 'rake' do
|
77
|
+
version '11.2.2'
|
78
|
+
end
|
79
|
+
|
80
|
+
gem_package 'rake' do
|
81
|
+
action :uninstall
|
82
|
+
version '11.2.2'
|
83
|
+
end
|
84
|
+
|
85
|
+
gem_package 'test-unit' do
|
86
|
+
version '3.2.0'
|
87
|
+
end
|
88
|
+
|
89
|
+
gem_package 'test-unit' do
|
90
|
+
version '3.1.9'
|
91
|
+
end
|
92
|
+
|
93
|
+
gem_package 'test-unit' do
|
94
|
+
action :uninstall
|
95
|
+
end
|
96
|
+
|
72
97
|
######
|
73
98
|
|
74
99
|
execute "echo -n > /tmp/notifies"
|
@@ -73,6 +73,26 @@ module Itamae
|
|
73
73
|
let(:options) { {host: host_name} }
|
74
74
|
it { is_expected.to eq( default_option.merge({host_name: host_name}) ) }
|
75
75
|
end
|
76
|
+
|
77
|
+
context "with ssh_config option" do
|
78
|
+
around do |example|
|
79
|
+
Tempfile.create("ssh_config") do |temp|
|
80
|
+
temp.write(<<EOF)
|
81
|
+
Host ex1
|
82
|
+
HostName example.com
|
83
|
+
User myname
|
84
|
+
Port 10022
|
85
|
+
EOF
|
86
|
+
temp.flush
|
87
|
+
@ssh_config = temp.path
|
88
|
+
example.run
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
let(:options) { {host: "ex1", ssh_config: @ssh_config} }
|
93
|
+
|
94
|
+
it { is_expected.to a_hash_including({host_name: "example.com", user: "myname", port: 10022}) }
|
95
|
+
end
|
76
96
|
end
|
77
97
|
|
78
98
|
describe "#disable_sudo?" do
|
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.9.
|
4
|
+
version: 1.9.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryota Arai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -293,7 +293,7 @@ files:
|
|
293
293
|
- spec/unit/lib/itamae/runner_spec.rb
|
294
294
|
- spec/unit/spec_helper.rb
|
295
295
|
- wercker.yml
|
296
|
-
homepage: https://github.com/
|
296
|
+
homepage: https://github.com/itamae-kitchen/itamae
|
297
297
|
licenses:
|
298
298
|
- MIT
|
299
299
|
metadata: {}
|