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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/itamae.rb +1 -0
- data/lib/itamae/ext.rb +1 -0
- data/lib/itamae/ext/specinfra.rb +11 -0
- data/lib/itamae/resource/user.rb +6 -1
- data/lib/itamae/version.txt +1 -1
- data/spec/integration/default_spec.rb +1 -0
- data/spec/integration/recipes/default.rb +2 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 661ba31a751a8489d3a477b8b625db1dd6881330
|
4
|
+
data.tar.gz: 0499c2ed0099e259d819444be3b9d229d1d00678
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0858008a836133796cb14bb9a642aecafd4b2bec9b24a2e0aa73e980c44cbdb07a04c6cbca764cda9bbaa776ddc51ce1e3f8550b564d2f6dc1e367c7bbec8ac2
|
7
|
+
data.tar.gz: 727bcc68b845aa1db68f4e2d33f95534147c18b69dc14be6c9fc6ff7d02d40d7729e0110d4ed909ad41d225a7d38e89a438680f6e44f526d7dd7d8bb46fdb67b
|
data/CHANGELOG.md
CHANGED
data/lib/itamae.rb
CHANGED
data/lib/itamae/ext.rb
ADDED
@@ -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
|
+
|
data/lib/itamae/resource/user.rb
CHANGED
@@ -34,10 +34,15 @@ module Itamae
|
|
34
34
|
updated!
|
35
35
|
end
|
36
36
|
|
37
|
-
if attributes.password && attributes.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,
|
data/lib/itamae/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.12
|
@@ -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.
|
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
|