cookbook 'simple_users', '= 0.1.1'
simple_users (8) Versions 0.1.1 Follow1
Manages Linux (Ubuntu/CentOS) local users
cookbook 'simple_users', '= 0.1.1', :supermarket
knife supermarket install simple_users
knife supermarket download simple_users
Users cookbook
Scope:
Chef cookbook to manage users.
Supported Platforms:
- Ubuntu 16.04 (tested with Kitchen)
- Ubuntu 14.04 was not tested however no ubuntu 16.04-specific commands are used here so it will probably work.
- CentOS 7 (tested with Kitchen)
USAGE:
- Clone this cookbook
- Include simple_users::default in any of your recipes, roles or environments.
Add Users:
Add a block to the default attribute containing each of the following to create a user:
- name - Username.
- fullName - Full name of your new user (may contain spaces).
- passHash - Shadow-file hash of the desired password.
- sshPubKey - ssh public key string to add to ~/.ssh/authorized_keys
- action - create
- sudo - yes/no. Adding/removing the user from the sudoers file (only supported on Ubuntu for now)
Example of the default attribute file:
default['simple_users']['users'] = [ { 'name' => 'usernam01', 'fullName' => 'User01 Name', 'passHash' => 'A_Long_HASH_String...', 'sshPubKey' => 'ssh-rsa YourSSHPublicKey...', 'myAction' => 'create', 'sudo' => 'yes' }, { 'name' => 'usernam02', 'fullName' => 'User02 Name', 'passHash' => 'A_Long_HASH_String...', 'sshPubKey' => 'ssh-rsa YourSSHPublicKey...', 'myAction' => 'create', 'sudo' => 'no' } ]
Remove Users:
Add all the entries as mentioned above but put "remove" as the value of myAction.
ruby
{
'name' => 'usernam03',
'fullName' => 'User03 Name',
'passHash' => 'A_Long_HASH_String...',
'sshPubKey' => 'ssh-rsa YourSSHPublicKey...',
'myAction' => 'remove'
}
Removing Users from Sudoers
Put 'no' in the 'sudo' section of your user.
Note that the above must be a part of the same default['simple_users']['users']
array.
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
License Metric
0.1.1 failed this metric
FC064: Ensure issues_url is set in metadata: /tmp/9b3938048b12f3c15e89b16b/simple_users/metadata.rb:1
FC065: Ensure source_url is set in metadata: /tmp/9b3938048b12f3c15e89b16b/simple_users/metadata.rb:1
Run with Foodcritic Version 8.1.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.1.1 failed this metric
FC065: Ensure source_url is set in metadata: /tmp/9b3938048b12f3c15e89b16b/simple_users/metadata.rb:1
Run with Foodcritic Version 8.1.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any