diff --git a/roles/base.rb b/roles/base.rb index 0315d1d7..5024aebb 100644 --- a/roles/base.rb +++ b/roles/base.rb @@ -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]" diff --git a/roles/sysadmins.rb b/roles/sysadmins.rb new file mode 100644 index 00000000..7a947dd9 --- /dev/null +++ b/roles/sysadmins.rb @@ -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\"" + ], + } + } +) diff --git a/vendor/cookbooks/sysadmins/README.md b/vendor/cookbooks/sysadmins/README.md index ca6f9a65..20d33f57 100644 --- a/vendor/cookbooks/sysadmins/README.md +++ b/vendor/cookbooks/sysadmins/README.md @@ -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.