cfe-users-cookbook
Simplifies setting up of Linux users in Chromedia servers.
Supported Platforms
So far, it's just Ubuntu 14.04.
Attributes
Key | Type | Description | Default |
---|---|---|---|
['cfe-users']['group'] | String | Name of group for server users. | 'devs' |
['cfe-users']['data_bag'] | String | Name of data bag containg user items to be created/removed. The default value is the string "users_devs_" suffixed by the name of the current environment. | 'users_devs_{node_env}' |
['cfe-users']['admin_group'] | String | Name of group for admin users. | 'sysadmins' |
['cfe-users']['admin_data_bag'] | String | Name of data bag containing admin user items to be created/removed. The default value is the string "users_sysadmins_" suffixed by the name of the current environment. | 'users_sysadmins_{node_env}' |
['cfe-users']['post_run_reboot'] | Boolean | This cookbook should normally request a reboot after the Chef client run. Set to 'false' to disable this behavior. | true |
Usage
By default, dev users will be under a group called devs
, and admins are are called sysadmins
.
Simply create a data bag called users_devs_#{node.chef_environment}
in your cookbook. Every item inside will correspond to a user under the devs
group. Similarly, create a data bag called users_sysadmins_#{node.chef_environment}
, containing items that correspond to admin users.
Each user data bag item must contain the following attributes (example for Ubuntu 14.04 user):
john.json
{
"comment": "John Smith",
"shell": "/bin/bash",
"groups": [
"john",
"devs",
"adm",
"plugdev",
"netdev"
],
"ssh_keys": "ssh-rsa XXX... john",
"id": "john"
}
The above json will create the user john
. If an attribute "action": "remove"
exists, then the user will be deleted, instead. Please see the example data bag in data_bags/users_example/example_user.json
.
cfe-users::default
Include cfe-users
in your node's run_list
:
{
"run_list": [
"recipe[cfe-users::default]"
]
}
License and Authors
Author:: Earth U. ()