solokit 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm ree-1.8.7-2010.02@solokit --create
1
+ rvm ree-1.8.7-2011.03@solokit --create
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 0.1.10
2
+
3
+ Added support for allwoing users to sudo without a password.
4
+
1
5
  0.1.9
2
6
 
3
7
  Bug with adding users fixed by @tskogberg.
@@ -0,0 +1,26 @@
1
+ #
2
+ # /etc/sudoers
3
+ #
4
+ # Generated by Chef for <%= @node[:fqdn] %>
5
+ #
6
+
7
+ Defaults !lecture,tty_tickets,!fqdn
8
+
9
+ # User privilege specification
10
+ root ALL=(ALL) ALL
11
+
12
+ <% @sudoers_users.each do |user| -%>
13
+ <% if user[:can_sudo_without_password] %>
14
+ <%= user[:name] %> ALL=(ALL) NOPASSWD: ALL
15
+ <% else %>
16
+ <%= user[:name] %> ALL=(ALL) ALL
17
+ <% end %>
18
+ <% end -%>
19
+
20
+ # Members of the sysadmin group may gain root privileges
21
+ %sysadmin ALL=(ALL) ALL
22
+
23
+ <% @sudoers_groups.each do |group| -%>
24
+ # Members of the group '<%= group %>' may gain root privileges
25
+ %<%= group %> ALL=(ALL) ALL
26
+ <% end -%>
@@ -1,3 +1,3 @@
1
1
  module Solokit
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
@@ -58,11 +58,26 @@ module Solokit
58
58
  end
59
59
 
60
60
  def env_users
61
- resolve_users(@env["users"].split)
61
+ resolve_users_for("users")
62
62
  end
63
63
 
64
64
  def env_sudo_users
65
- @env["sudo"] && resolve_users(@env["sudo"].split)
65
+ users = []
66
+
67
+ users << resolve_users_for("sudo").map { |user|
68
+ { name: user }
69
+ }
70
+
71
+ users << resolve_users_for("sudo_without_password").map do |user|
72
+ { name: user, can_sudo_without_password: true }
73
+ end
74
+
75
+ users.flatten
76
+ end
77
+
78
+ def resolve_users_for(key)
79
+ str = @env[key]
80
+ str && resolve_users(str.split) || []
66
81
  end
67
82
 
68
83
  def resolve_users(list)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solokit
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 9
10
- version: 0.1.9
9
+ - 10
10
+ version: 0.1.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Joakim Kolsj\xC3\xB6"
@@ -69,6 +69,7 @@ files:
69
69
  - chef/roles/base.json
70
70
  - chef/server.json
71
71
  - chef/solo.rb
72
+ - cookbooks/site/sudo/templates/default/sudoers.erb
72
73
  - cookbooks/site/users/definitions/add_keys.rb
73
74
  - cookbooks/site/users/recipes/default.rb
74
75
  - cookbooks/upstream/apt/README.md