itamae 1.2.16 → 1.2.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/itamae/cli.rb +3 -3
- data/lib/itamae/resource/service.rb +20 -8
- data/lib/itamae/version.txt +1 -1
- 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: 772a7eb4b6610bba4d4870d1d75edf98109572de
|
4
|
+
data.tar.gz: 4964ef8bb3b46ab2a7d2c7af45c54c76c083c15e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9da73359173c808a04958558a2044f48ff234d5b9cd8da7df7c84281bc6ae96a7911b535c60dd06ba6921a8ea971ff8b84350658425c0ab9716f2c93c8cfaa5b
|
7
|
+
data.tar.gz: e79e18c07d212949b0464a1f71c4c87315d62298df8b81abc50a1118ed7ff1b9201ee811cd044e22c1a299262bcbda1d65badaff19b811cce1d179d360f3ebf8
|
data/CHANGELOG.md
CHANGED
data/lib/itamae/cli.rb
CHANGED
@@ -19,7 +19,7 @@ module Itamae
|
|
19
19
|
option :node_json, type: :string, aliases: ['-j']
|
20
20
|
option :node_yaml, type: :string, aliases: ['-y']
|
21
21
|
option :dry_run, type: :boolean, aliases: ['-n']
|
22
|
-
option :ohai, type: :boolean, default: false
|
22
|
+
option :ohai, type: :boolean, default: false, desc: "This option is DEPRECATED and will be inavailable."
|
23
23
|
def local(*recipe_files)
|
24
24
|
if recipe_files.empty?
|
25
25
|
raise "Please specify recipe files."
|
@@ -37,7 +37,7 @@ module Itamae
|
|
37
37
|
option :user, type: :string, aliases: ['-u']
|
38
38
|
option :key, type: :string, aliases: ['-i']
|
39
39
|
option :port, type: :numeric, aliases: ['-p']
|
40
|
-
option :ohai, type: :boolean, default: false
|
40
|
+
option :ohai, type: :boolean, default: false, desc: "This option is DEPRECATED and will be inavailable."
|
41
41
|
option :vagrant, type: :boolean, default: false
|
42
42
|
option :ask_password, type: :boolean, default: false
|
43
43
|
option :sudo, type: :boolean, default: true
|
@@ -58,7 +58,7 @@ module Itamae
|
|
58
58
|
option :node_json, type: :string, aliases: ['-j']
|
59
59
|
option :node_yaml, type: :string, aliases: ['-y']
|
60
60
|
option :dry_run, type: :boolean, aliases: ['-n']
|
61
|
-
option :ohai, type: :boolean, default: false
|
61
|
+
option :ohai, type: :boolean, default: false, desc: "This option is DEPRECATED and will be inavailable."
|
62
62
|
option :image, type: :string, required: true
|
63
63
|
option :tls_verify_peer, type: :boolean, default: true
|
64
64
|
def docker(*recipe_files)
|
@@ -5,6 +5,12 @@ module Itamae
|
|
5
5
|
class Service < Base
|
6
6
|
define_attribute :action, default: :nothing
|
7
7
|
define_attribute :name, type: String, default_name: true
|
8
|
+
define_attribute :provider, type: Symbol, default: nil
|
9
|
+
|
10
|
+
def initialize(*args)
|
11
|
+
super
|
12
|
+
@under = attributes.provider ? "_under_#{attributes.provider}" : ""
|
13
|
+
end
|
8
14
|
|
9
15
|
def pre_action
|
10
16
|
case @current_action
|
@@ -20,36 +26,42 @@ module Itamae
|
|
20
26
|
end
|
21
27
|
|
22
28
|
def set_current_attributes
|
23
|
-
current.running = run_specinfra(:check_service_is_running, attributes.name)
|
24
|
-
current.enabled = run_specinfra(:check_service_is_enabled, attributes.name)
|
29
|
+
current.running = run_specinfra(:"check_service_is_running#{@under}", attributes.name)
|
30
|
+
current.enabled = run_specinfra(:"check_service_is_enabled#{@under}", attributes.name)
|
25
31
|
end
|
26
32
|
|
27
33
|
def action_start(options)
|
28
34
|
unless current.running
|
29
|
-
run_specinfra(:start_service, attributes.name)
|
35
|
+
run_specinfra(:"start_service#{@under}", attributes.name)
|
30
36
|
end
|
31
37
|
end
|
32
38
|
|
33
39
|
def action_stop(options)
|
34
40
|
if current.running
|
35
|
-
run_specinfra(:stop_service, attributes.name)
|
41
|
+
run_specinfra(:"stop_service#{@under}", attributes.name)
|
36
42
|
end
|
37
43
|
end
|
38
44
|
|
39
45
|
def action_restart(options)
|
40
|
-
run_specinfra(:restart_service, attributes.name)
|
46
|
+
run_specinfra(:"restart_service#{@under}", attributes.name)
|
41
47
|
end
|
42
48
|
|
43
49
|
def action_reload(options)
|
44
|
-
|
50
|
+
if current.running
|
51
|
+
run_specinfra(:"reload_service#{@under}", attributes.name)
|
52
|
+
end
|
45
53
|
end
|
46
54
|
|
47
55
|
def action_enable(options)
|
48
|
-
|
56
|
+
unless current.enabled
|
57
|
+
run_specinfra(:"enable_service#{@under}", attributes.name)
|
58
|
+
end
|
49
59
|
end
|
50
60
|
|
51
61
|
def action_disable(options)
|
52
|
-
|
62
|
+
if current.enabled
|
63
|
+
run_specinfra(:"disable_service#{@under}", attributes.name)
|
64
|
+
end
|
53
65
|
end
|
54
66
|
end
|
55
67
|
end
|
data/lib/itamae/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.17
|
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.2.
|
4
|
+
version: 1.2.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryota Arai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|