itamae 1.1.11 → 1.1.12

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: 54ac557a58fa9efee07fc0dce29f5a6dc4746f64
4
- data.tar.gz: 6e8a44e41dd103d32aaebd84f51e4de1c6029291
3
+ metadata.gz: 661ba31a751a8489d3a477b8b625db1dd6881330
4
+ data.tar.gz: 0499c2ed0099e259d819444be3b9d229d1d00678
5
5
  SHA512:
6
- metadata.gz: e5193dc0d26d428f634030d966e2b4f59d59c2e4d582546ef808c5f8d78ac4b77a97ec8cce231288206a8aa3ea745ed2114bd36431604622e2894b087409d677
7
- data.tar.gz: 122321d75100144a5bd5295e385bbd3addc4d30795d890cfc0c35a8f0edbaebb81aebfb2414e6970a301f3fd9dd0b24d90b74a20cff5a37f871ba9263337ef12
6
+ metadata.gz: 0858008a836133796cb14bb9a642aecafd4b2bec9b24a2e0aa73e980c44cbdb07a04c6cbca764cda9bbaa776ddc51ce1e3f8550b564d2f6dc1e367c7bbec8ac2
7
+ data.tar.gz: 727bcc68b845aa1db68f4e2d33f95534147c18b69dc14be6c9fc6ff7d02d40d7729e0110d4ed909ad41d225a7d38e89a438680f6e44f526d7dd7d8bb46fdb67b
@@ -1,3 +1,9 @@
1
+ ## v1.1.12
2
+
3
+ Bugfixes
4
+
5
+ - [Update home directory of user resource if changed.](https://github.com/itamae-kitchen/itamae/commit/0b5ad5245af8a7849d36d0598f06b7adb9ac025a)
6
+
1
7
  ## v1.1.11
2
8
 
3
9
  Bugfixes
@@ -10,6 +10,7 @@ require "itamae/backend"
10
10
  require "itamae/notification"
11
11
  require "itamae/definition"
12
12
  require "itamae/config"
13
+ require "itamae/ext"
13
14
 
14
15
  module Itamae
15
16
  # Your code goes here...
@@ -0,0 +1 @@
1
+ require 'itamae/ext/specinfra'
@@ -0,0 +1,11 @@
1
+ # TODO: Send patches to Specinfra
2
+
3
+ Specinfra::Command::Base::User.class_eval do
4
+ class << self
5
+ def update_home_directory(user, directory)
6
+ # -m: Move the content of the user's home directory to the new location.
7
+ "usermod -m -d #{escape(directory)} #{escape(user)}"
8
+ end
9
+ end
10
+ end
11
+
@@ -34,10 +34,15 @@ module Itamae
34
34
  updated!
35
35
  end
36
36
 
37
- if attributes.password && attributes.password != current_password
37
+ if attributes.password && attributes.password != current.password
38
38
  run_specinfra(:update_user_encrypted_password, attributes.username, attributes.password)
39
39
  updated!
40
40
  end
41
+
42
+ if attributes.home && attributes.home != current.home
43
+ run_specinfra(:update_user_home_directory, attributes.username, attributes.home)
44
+ updated!
45
+ end
41
46
  else
42
47
  options = {
43
48
  gid: attributes.gid,
@@ -1 +1 @@
1
- 1.1.11
1
+ 1.1.12
@@ -3,6 +3,7 @@ require 'spec_helper'
3
3
  describe user("itamae") do
4
4
  it { should exist }
5
5
  it { should have_uid 1234 }
6
+ it { should have_home_directory '/home/itamae' }
6
7
  end
7
8
 
8
9
  describe file('/tmp/included_recipe') do
@@ -4,12 +4,14 @@ user "create itamae user" do
4
4
  uid 123
5
5
  username "itamae"
6
6
  password "$1$ltOY8bZv$iZ57f1KAp8jwKViNm3pze."
7
+ home '/home/foo'
7
8
  end
8
9
 
9
10
  user "update itamae user" do
10
11
  uid 1234
11
12
  username "itamae"
12
13
  password "$1$TQz9gPMl$nHYrsA5W2ZdZ0Yn021BQH1"
14
+ home '/home/itamae'
13
15
  end
14
16
 
15
17
  ######
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.11
4
+ version: 1.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
@@ -159,6 +159,8 @@ files:
159
159
  - lib/itamae/cli.rb
160
160
  - lib/itamae/config.rb
161
161
  - lib/itamae/definition.rb
162
+ - lib/itamae/ext.rb
163
+ - lib/itamae/ext/specinfra.rb
162
164
  - lib/itamae/logger.rb
163
165
  - lib/itamae/node.rb
164
166
  - lib/itamae/notification.rb