Commit 101fe8609e8e447c59b53262e62cb8bfc7e72411
1 parent
a84c73ea
Version 0.2.0. Add chef_environment to name of databag used.
Showing
5 changed files
with
22 additions
and
15 deletions
... | ... | @@ -24,8 +24,8 @@ So far, it's just Ubuntu 14.04. |
24 | 24 | <tr> |
25 | 25 | <td><tt>['cfe-users']['data_bag']</tt></td> |
26 | 26 | <td>String</td> |
27 | - <td>Name of data bag containg user items to be created/removed.</td> | |
28 | - <td><tt>'users_devs'</tt></td> | |
27 | + <td>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.</td> | |
28 | + <td><tt>'users_devs_{node_env}'</tt></td> | |
29 | 29 | </tr> |
30 | 30 | <tr> |
31 | 31 | <td><tt>['cfe-users']['admin_group']</tt></td> |
... | ... | @@ -36,8 +36,8 @@ So far, it's just Ubuntu 14.04. |
36 | 36 | <tr> |
37 | 37 | <td><tt>['cfe-users']['admin_data_bag']</tt></td> |
38 | 38 | <td>String</td> |
39 | - <td>Name of data bag containing admin user items to be created/removed.</td> | |
40 | - <td><tt>'users_sysadmins'</tt></td> | |
39 | + <td>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.</td> | |
40 | + <td><tt>'users_sysadmins_{node_env}'</tt></td> | |
41 | 41 | </tr> |
42 | 42 | <tr> |
43 | 43 | <td><tt>['cfe-users']['post_run_reboot']</tt></td> |
... | ... | @@ -51,7 +51,7 @@ So far, it's just Ubuntu 14.04. |
51 | 51 | |
52 | 52 | By default, dev users will be under a group called `devs`, and admins are are called `sysadmins`. |
53 | 53 | |
54 | -Simply create a data bag called `users_devs` in your cookbook. Every item inside will correspond to a user under the `devs` group. Similarly, create a data bag called `users_sysadmins`, containing items that correspond to admin users. | |
54 | +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. | |
55 | 55 | |
56 | 56 | Each user data bag item must contain the following attributes (example for Ubuntu 14.04 user): |
57 | 57 | ```json | ... | ... |
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 | # Cookbook Name:: cfe-users |
4 | 4 | # Attribute:: default |
5 | 5 | # |
6 | -# Copyright 2016, Chromedia Far East, Inc. | |
6 | +# Copyright 2017, Chromedia Far East, Inc. | |
7 | 7 | # |
8 | 8 | # Licensed under the Apache License, Version 2.0 (the "License"); |
9 | 9 | # you may not use this file except in compliance with the License. |
... | ... | @@ -18,13 +18,15 @@ |
18 | 18 | # limitations under the License. |
19 | 19 | # |
20 | 20 | |
21 | -default['cfe-users']['group'] = 'devs' | |
22 | -default['cfe-users']['gid'] = 4000 | |
23 | -default['cfe-users']['data_bag'] = 'users_devs' | |
21 | +default['cfe-users']['group'] = 'devs' | |
22 | +default['cfe-users']['gid'] = 4000 | |
23 | +default['cfe-users']['data_bag'] = | |
24 | + "users_devs_#{node.chef_environment}" | |
24 | 25 | |
25 | -default['cfe-users']['admin_group'] = 'sysadmins' | |
26 | -default['cfe-users']['admin_gid'] = 4001 | |
27 | -default['cfe-users']['admin_data_bag'] = 'users_sysadmins' | |
26 | +default['cfe-users']['admin_group'] = 'sysadmins' | |
27 | +default['cfe-users']['admin_gid'] = 4001 | |
28 | +default['cfe-users']['admin_data_bag'] = | |
29 | + "users_sysadmins_#{node.chef_environment}" | |
28 | 30 | |
29 | 31 | default['cfe-users']['post_run_reboot'] = true |
30 | 32 | |
... | ... | @@ -33,7 +35,7 @@ default['authorization']['sudo']['groups'] = [ |
33 | 35 | node['cfe-users']['admin_group'] |
34 | 36 | ] |
35 | 37 | |
36 | -# Cookbook sudo constants. Do not modify. | |
38 | +# Cookbook sudo constants. | |
37 | 39 | |
38 | 40 | default['authorization']['sudo']['passwordless'] = true |
39 | 41 | default['authorization']['sudo']['include_sudoers_d'] = false | ... | ... |
... | ... | @@ -4,7 +4,7 @@ maintainer_email 'sysadmin@chromedia.com' |
4 | 4 | license 'Apache License' |
5 | 5 | description 'Simplifies setting up of users in Linux servers.' |
6 | 6 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) |
7 | -version '0.1.1' | |
7 | +version '0.2.0' | |
8 | 8 | |
9 | 9 | depends 'users', '~> 4.0.1' |
10 | 10 | depends 'sudo', '~> 3.1.0' | ... | ... |
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 | # Cookbook Name:: cfe-users |
4 | 4 | # Recipes:: default |
5 | 5 | # |
6 | -# Copyright 2016, Chromedia Far East, Inc. | |
6 | +# Copyright 2017, Chromedia Far East, Inc. | |
7 | 7 | # |
8 | 8 | # Licensed under the Apache License, Version 2.0 (the "License"); |
9 | 9 | # you may not use this file except in compliance with the License. | ... | ... |