Report abuse

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
48
49
50
51
52
53
54
define userCreation ($name ,$uid, $group, $extraGroups="", $shell) {
        user { "$name":
                name => "$name",
                uid => "$uid",
                gid => "$group",
                groups => $extraGroups,
                shell => "$shell",
                home => "/home/$name",

#                require => Group[$group],
                ensure   => present,
        }

        file { "/home/$name/":
                owner   => "$name",
                group   => "$group",
                mode    => "700",
                source  => "puppet:///users/home/$name",
        }
        $ssh_users +=["$name"]
}

define groupCreation ($name, $gid) {

        group {"$name":
                name => "$name",
                gid => "$gid",
                #cant think of a reason for duplicates so..
                allowdupe => false,
        }

}
class engineeringUser {

        $ssh_users =["adam"]
        #setting this a variable so other files like sudo can use it
        $engineeringGroup = "Engineering"
        $engineeringGid = "11000"

        groupCreation { "$engineeringGroup":
                name => "$engineeringGroup",
                gid => "$engineeringGid",
        }

        userCreation { "adam":
                group => "$engineeringGid",
#                extraGroups => ["test2","test3"],
                shell => "/bin/bash",
                uid => "10000",
                name => "adam",
                require => Group["$engineeringGroup"],
        }

}