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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02e41cef1bec66fbf4103d076ec2b05968b8fff0
4
- data.tar.gz: 62ab8fc3e8d22556607d5cd61939444eae413fe8
3
+ metadata.gz: c58a480a6a8ac2cf860b9a4620908e42b3db2062
4
+ data.tar.gz: 7b8a853514b7fb52343f8af96e8754c04455ff3a
5
5
  SHA512:
6
- metadata.gz: 98d2a54681a5f1663b7fc5f52a39a4b9fd7053e3c596023eae6df639d4fab98067fe4d6b628229a652aa708a434a348169615e389b8661a67035b6a3457aee03
7
- data.tar.gz: 19890747d97c8c545532786711bdb9d01a95f6a2c07c14f204bbd81e545f2e41dea04fdacf63f35f2253ce1edb2646fb9f3842ebdd779227f102448b0f25f671
6
+ metadata.gz: a648cff7fdef2fd5e81e84b6e509568f5f764258b0e7c6b0fa0a862871ad9120c448f3e81c911f9745e23c36cd32027ecdd94be68022124f01b7e843396e8942
7
+ data.tar.gz: e439536e955a5b8575b8f5be09aa552694bcf83468cfe85e935b374dd7fda1fd702888a2a3b79a8e36d12c2f81dd1be040b736cd6e7f9cd750ebf2dce32ae3b1
@@ -1,3 +1,10 @@
1
+ ## v1.1.3
2
+
3
+ Features
4
+
5
+ - `group` resource (Thanks to @a2ikm)
6
+ - https://github.com/itamae-kitchen/itamae/pull/70
7
+
1
8
  ## v1.1.2
2
9
 
3
10
  Features
@@ -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.1"
21
+ spec.add_runtime_dependency "specinfra", "~> 2.12"
22
22
  spec.add_runtime_dependency "hashie"
23
23
  spec.add_runtime_dependency "ansi"
24
24
 
@@ -12,6 +12,7 @@ require 'itamae/resource/link'
12
12
  require 'itamae/resource/local_ruby_block'
13
13
  require 'itamae/resource/git'
14
14
  require 'itamae/resource/user'
15
+ require 'itamae/resource/group'
15
16
 
16
17
  module Itamae
17
18
  module Resource
@@ -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
+
@@ -1 +1 @@
1
- 1.1.2
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.2
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-27 00:00:00.000000000 Z
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.1'
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.1'
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