Skip to content
This repository has been archived by the owner on Apr 23, 2019. It is now read-only.

Commit

Permalink
Move sysadmins out of base role.
Browse files Browse the repository at this point in the history
Don't run it by default, but make it a role.
  • Loading branch information
berkes committed Oct 26, 2014
1 parent 2e201c5 commit ff39445
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
16 changes: 1 addition & 15 deletions roles/base.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
name 'base'
description 'Base bootstrap for every box'
run_list "recipe[sysadmins]", "recipe[sudo]", "recipe[apt]", "recipe[build-essential]"
default_attributes(
"authorization" => {
"sudo" => {
"groups" => ["admin"],
"passwordless" => false,
"include_sudoers_d" => true,
"sudoers_default" => [
"env_reset",
"mail_badpass",
"secure_path=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\""
],
}
}
)
run_list "recipe[apt]", "recipe[build-essential]"
23 changes: 23 additions & 0 deletions roles/sysadmins.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name "sysadmins"
description "This role configures sysadmins, users with sudo-rights on your server"
run_list(
"role[base]",
"recipe[packages]",
"recipe[sysadmins]",
"recipe[sudo]"
)
# Configure the sudo recipe so it mirrors Ubuntu's default behaviour
default_attributes(
"authorization" => {
"sudo" => {
"groups" => ["admin"],
"passwordless" => false,
"include_sudoers_d" => true,
"sudoers_default" => [
"env_reset",
"mail_badpass",
"secure_path=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\""
],
}
}
)
5 changes: 5 additions & 0 deletions vendor/cookbooks/sysadmins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ Add sysadmins to your node configuration:
}
}
```

* Create a hashed password with `openssl passwd -1 'plaintextpassword'`.
This password is needed for running `sudo`.
* SSH-keys should be the **public** key. You can leave them out, in
which case you have to log in with the password.

0 comments on commit ff39445

Please sign in to comment.