profig 0.07.1.g8ba10a3 → 0.08
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/profig/linux.rb +9 -4
- metadata +9 -13
data/lib/profig/linux.rb
CHANGED
@@ -11,9 +11,11 @@ def self.handle_user(user_name, opts)
|
|
11
11
|
raise 'Invalid user format'
|
12
12
|
end
|
13
13
|
|
14
|
-
cmd = "
|
15
|
-
cmd += " --disabled-password --disabled-login #{user_name}"
|
14
|
+
cmd = "useradd --no-user-group --system --no-create-home #{user_name}"
|
16
15
|
system cmd
|
16
|
+
if not [0,9].include?($?.exitstatus) then
|
17
|
+
raise "Error creating user (#{$?.exitstatus}): #{user_name}"
|
18
|
+
end
|
17
19
|
end
|
18
20
|
|
19
21
|
def self.handle_group(group_name, opts)
|
@@ -21,8 +23,8 @@ def self.handle_group(group_name, opts)
|
|
21
23
|
raise 'Unknown group definition'
|
22
24
|
end
|
23
25
|
|
24
|
-
cmd = "
|
25
|
-
system
|
26
|
+
cmd = "groupadd --force --system #{group_name}"
|
27
|
+
system cmd
|
26
28
|
end
|
27
29
|
|
28
30
|
|
@@ -31,6 +33,9 @@ def self.handle_file(name, opts)
|
|
31
33
|
owner, group = split_owner(opts['owner'])
|
32
34
|
mode = opts['mode']
|
33
35
|
|
36
|
+
raise 'nil filename' if not name
|
37
|
+
raise "nil file source for #{name}" if not src
|
38
|
+
|
34
39
|
FileUtils.copy(src, name)
|
35
40
|
FileUtils.chown(owner, group, name)
|
36
41
|
FileUtils.chmod(mode, name) if mode
|
metadata
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: profig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
|
10
|
-
- g8ba10a3
|
11
|
-
version: 0.07.1.g8ba10a3
|
8
|
+
- 8
|
9
|
+
version: "0.08"
|
12
10
|
platform: ruby
|
13
11
|
authors:
|
14
12
|
- Matthew Graham
|
@@ -16,7 +14,7 @@ autorequire:
|
|
16
14
|
bindir: bin
|
17
15
|
cert_chain: []
|
18
16
|
|
19
|
-
date: 2011-07-
|
17
|
+
date: 2011-07-31 00:00:00 -04:00
|
20
18
|
default_executable:
|
21
19
|
dependencies: []
|
22
20
|
|
@@ -56,14 +54,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
54
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
55
|
none: false
|
58
56
|
requirements:
|
59
|
-
- - "
|
57
|
+
- - ">="
|
60
58
|
- !ruby/object:Gem::Version
|
61
|
-
hash:
|
59
|
+
hash: 3
|
62
60
|
segments:
|
63
|
-
-
|
64
|
-
|
65
|
-
- 1
|
66
|
-
version: 1.3.1
|
61
|
+
- 0
|
62
|
+
version: "0"
|
67
63
|
requirements: []
|
68
64
|
|
69
65
|
rubyforge_project:
|