Skip to content

Commit 274fbfd

Browse files
committed
rewrote accounts profile to utilize iteration
1 parent 4d422f6 commit 274fbfd

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

site/profile/manifests/accounts.pp

+34-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,39 @@
2525
$groups = hiera_hash('groups_hash',{}),
2626
) {
2727

28+
$accounts.each |$key, $value| {
29+
accounts::user { $key:
30+
ensure => $value['ensure'],
31+
shell => $value['shell'],
32+
comment => $value['comment'],
33+
home => $value['home'],
34+
home_mode => $value['home_mode'],
35+
uid => $value['uid'],
36+
gid => $value['gid'],
37+
groups => $value['groups'],
38+
membership => $value['membership'],
39+
password => $value['password'],
40+
locked => $value['locked'],
41+
sshkeys => $value['sshkeys'],
42+
managehome => $value['managehome'],
43+
bashrc_content => $value['bashrc_content'],
44+
bash_profile_content => $value['bash_profile_content'],
45+
}
46+
}
2847

29-
create_resources(accounts::user, $accounts)
30-
create_resources(group, $groups)
48+
$groups.each |$key, $value| {
49+
group { $key:
50+
ensure => $value['ensure'],
51+
allowdupe => $value['allowdupe'],
52+
attribute_membership => $value['attribute_membership'],
53+
attributes => $value['attributes'],
54+
auth_membership => $value['auth_membership'],
55+
forcelocal => $value['forcelocal'],
56+
gid => $value['gid'],
57+
ia_load_module => $value['ia_load_module'],
58+
members => $value['members'],
59+
provider => $value['provider'],
60+
system => $value['system'],
61+
}
62+
}
3163
}

0 commit comments

Comments
 (0)