itamae 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/itamae.gemspec +1 -1
- data/lib/itamae/resource.rb +1 -0
- data/lib/itamae/resource/group.rb +42 -0
- data/lib/itamae/version.txt +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c58a480a6a8ac2cf860b9a4620908e42b3db2062
|
4
|
+
data.tar.gz: 7b8a853514b7fb52343f8af96e8754c04455ff3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a648cff7fdef2fd5e81e84b6e509568f5f764258b0e7c6b0fa0a862871ad9120c448f3e81c911f9745e23c36cd32027ecdd94be68022124f01b7e843396e8942
|
7
|
+
data.tar.gz: e439536e955a5b8575b8f5be09aa552694bcf83468cfe85e935b374dd7fda1fd702888a2a3b79a8e36d12c2f81dd1be040b736cd6e7f9cd750ebf2dce32ae3b1
|
data/CHANGELOG.md
CHANGED
data/itamae.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
20
|
spec.add_runtime_dependency "thor"
|
21
|
-
spec.add_runtime_dependency "specinfra", "~> 2.
|
21
|
+
spec.add_runtime_dependency "specinfra", "~> 2.12"
|
22
22
|
spec.add_runtime_dependency "hashie"
|
23
23
|
spec.add_runtime_dependency "ansi"
|
24
24
|
|
data/lib/itamae/resource.rb
CHANGED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'itamae'
|
2
|
+
|
3
|
+
module Itamae
|
4
|
+
module Resource
|
5
|
+
class Group < Base
|
6
|
+
define_attribute :action, default: :create
|
7
|
+
define_attribute :groupname, type: String, default_name: true
|
8
|
+
define_attribute :gid, type: Integer
|
9
|
+
|
10
|
+
def set_current_attributes
|
11
|
+
current.exist = exist?
|
12
|
+
|
13
|
+
if current.exist
|
14
|
+
current.gid = run_specinfra(:get_group_gid, attributes.groupname).stdout.strip.to_i
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def action_create(options)
|
19
|
+
if run_specinfra(:check_group_exists, attributes.groupname)
|
20
|
+
if attributes.gid && attributes.gid != current.gid
|
21
|
+
run_specinfra(:update_group_gid, attributes.groupname, attributes.gid)
|
22
|
+
updated!
|
23
|
+
end
|
24
|
+
else
|
25
|
+
options = {
|
26
|
+
gid: attributes.gid,
|
27
|
+
}
|
28
|
+
|
29
|
+
run_specinfra(:add_group, attributes.groupname, options)
|
30
|
+
|
31
|
+
updated!
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
def exist?
|
37
|
+
run_specinfra(:check_group_exists, attributes.groupname)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
data/lib/itamae/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.3
|
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.1.
|
4
|
+
version: 1.1.3
|
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-01-
|
11
|
+
date: 2015-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '2.
|
33
|
+
version: '2.12'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '2.
|
40
|
+
version: '2.12'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: hashie
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,6 +170,7 @@ files:
|
|
170
170
|
- lib/itamae/resource/execute.rb
|
171
171
|
- lib/itamae/resource/file.rb
|
172
172
|
- lib/itamae/resource/git.rb
|
173
|
+
- lib/itamae/resource/group.rb
|
173
174
|
- lib/itamae/resource/link.rb
|
174
175
|
- lib/itamae/resource/local_ruby_block.rb
|
175
176
|
- lib/itamae/resource/package.rb
|