1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
body file control
{
inputs => { "$(sys.libdir)/stdlib.cf" };
}
### Users main BEGIN ###
bundle agent main
{
vars:
"users" slist => { "jack", "john" };
"skel" string => "/etc/skel";
users:
!windows::
"$(users)"
policy => "present",
home_dir => "/home/$(users)",
home_bundle => home_skel($(users), $(skel));
}
### Users main END ###
### Home Bundle BEGIN ###
bundle agent home_skel(user, skel)
# @brief Initialize a user's home directory with the contents of skel
# @param user The user's home directory to create
# @param skel The directory to seed the user's home with
{
files:
"/home/$(user)/."
create => "true",
copy_from => seed_cp($(skel)),
depth_search => recurse("inf");
}
### Home Bundle END ###
### Locked User BEGIN ###
bundle agent service_accounts
{
vars:
"users" slist => { "apache", "libuuid" };
users:
!windows::
"$(users)"
policy => "locked";
}
### Locked User END ###
|