Various modifications.
[chaosvm.git] / modules / common / manifests / users.pp
1 class common::users {
2
3   # required to delete primary usergroups
4   augeas { 'allow_not_existent_group':
5     context => '/files/etc/login.defs',
6     changes => [ 'set USERGROUPS_ENAB no' ],
7   }
8
9   define account (
10     $comment,
11     $groups,
12     $uid,
13     $sshtype,
14     $sshkey,
15     $ensure,
16     $membership = 'inclusive',
17     $shell = '/bin/bash',
18   ) {
19     
20     user { $name:
21       ensure => $ensure,
22       comment => $comment,
23       uid => $uid,
24       gid => $name,
25       groups => $groups,
26       membership => $membership,
27       home => "/home/$name",
28       managehome => true,
29       shell => $shell,
30       require => Augeas['allow_not_existent_group'],
31     }
32     
33     group { $name:
34       ensure => $ensure,
35       system => false,
36       gid => $uid,
37     }
38   
39     ssh_authorized_key { $name:
40       ensure   => $ensure,
41       user     => $name,
42       type     => $sshtype,
43       key      => $sshkey,
44     }
45     
46   }
47   
48   @account { 'mschuster':
49     ensure => present,
50     comment => 'Markus Schuster',
51     uid => 1000,
52     sshtype => 'ssh-dss',
53     sshkey => 'AAAAB3NzaC1kc3MAAAEBANLHnxKhSkYGfYbL6C801cqoXH4lIfV40ebfiiVEqZkYyQotsi0UHYtpfGXH39yydD7J9mWXu+zypKX4II1CZVk3ohemQVe9NZuvRzVlya2oO+FKLUw86cY65XPak0fIY9pGJuTxMLz7PczmBF53jgpq4e3q6nAaf98hzDfWqp2l6Gw7miLNgsQ2e81znH68IchRPSngjVncTxsUL1ok+Ve/U4WKSGYdB1ATJhnZZ76ug41yxGwKYb5ZwjRFC6Y54r7vg3SOhEu3YQ65KRlbzHoGhAckCFqoyA+Z0S+2e71V/JSbnXf0AdFsRJUfWWBi5HxgCX83XNLRqqrHQ19wZx8AAAAVANa0KMWZaIhiHCcPd5aUXqCXn1onAAABAHzBpd5SmYFTsyFBgiQRBn31KCptzehalZ6whaOY8SyZR4Brqyp3ryaqkww3NdX2D8fQfT2X+ZPKfyFXHl4SyOq5XvvE9qcB/kC2e8JsntJ3yKbWNnMlXPiMYkuTYrrpwilI95Sa2ndH5AnntWy5iBqgny/ElI5qABLfG5ZBkOUEuTVJtYN0qqW9Xupwe5XZjwQ4LpA/SqsdD7Zx8zxXObdzNyXDtm9HpQZ8InmHF8VWzx+HAV/7iF58emLbctbqMrBfsfbb2abwv0KrE/8f8bds+vvP00cYwcH3/+5tie+gkgIThFbO1CAddhpkUKKiTNIwUYQdIUZIb2cbJzwr57YAAAEAfGg4nPZgfL/PjIWRPGlD+VFCzocdS/9z9DpdrumIGr+tVcEE++jkwrkPPiAQiI340K4nFj+iRd/w1Xqo5noColi0USsecTeeC3mFhIWGqvgbro/V574rISGRPnLmSjXxmiZWhMFpMlmF2eMYKL7oNIXttVBMrAK84V3shvu20omHfFbVYdWP7uMN8WLs7LOZ+I3gI+DzLXXMfqCxW+qfkfHXPk62vq+BmARNgDpsExLYRCqG4olhDyoZZQjT3El7/QZVmy5YlhJzeJdXpEJFnBv9Fh1NmrIXz+soKcSo3Pu6AvMmfFR0EYeDqcs19QMpofemnAnHm9BTH9DA94RSMQ==',
54   }
55   
56   @account { 'phofmann':
57     ensure => present,
58     comment => 'Pascal Hofmann',
59     uid => 1001,
60     sshtype => 'ssh-rsa',
61     sshkey => 'AAAAB3NzaC1yc2EAAAABIwAAAQEA7cWQ6yRH9d4EQv6Om5u6Xa5eXhbNrtEUnQuk408iquJFL22Ok3EvnHAFHycmtbngCR23Cu/TuwkjW9lYq7tO5NLmc+80Kc6WCHZbKX/ST6ShVhm7U49WUtYkx0AC6PJl1MxTWRiNzriRY8zZ+ENTXph27py3mkGgbTzHeiAicP3lhQ/LMYwZzpCJ80vxgKKHvOlVYRA/NXP8YfKA4dQK6AS5ecFK2S0h5J27zFBorO3uLO78hdRdduyF/uzCfEgWud+xXnk8uhe29+twJTS2WF7CnGjuFU3OzHAZEjQK8s3GHFa56QrhTFPdzn9cWnJrRYAB+7lJ7gXEMJBXimoBAw==',
62   }
63
64   @account { 'ygoebel':
65     ensure => present,
66     comment => 'Yves Goebel',
67     uid => 1002,
68     sshtype => 'ssh-rsa',
69     sshkey => 'AAAAB3NzaC1yc2EAAAABIwAAAgEA49yBpOBHpaX4DtrORmmLL18PsnFMB7uDWKjtOGfKPyUdhmhayHmpqFpDojOPOtuceCA5I1VsGL8TnIJHmqCr15fmbCcOuW+LLuraGLQLGiaFOB8ueaQgSjivjxMerSA902RFPrWHI2o7sdYkqfFAsGFSzoULgV4l/6E2Fbx7egf0IxgxRzD9K9bTTyEIGNQtcVAIHxrsisyre94j/Xqh4qwkJWrqhoJJv3iUVenscDxHA01nwVdtVo9z3p53SGVb8kvuyTyVLly2NT3hCoyguAz1t8P/yovQ/6Au+gCi9nvECdhXjtBRAyHzAQKI1ugRL2PDqZuC371URalj6RV5epdU/g2QDLjKE27vTjWb2BPDV2fhdh4cARCGlstzTsMPIx0R/+MnHnj1HcSb0qoLTJXDjVavtmG2LQKUqBs7ll4E6r/gQHIJMew2FXJgcwHHRmGAUi/7XJqdkwu5Axye3RwWm47pIbWWsyEDSY7SiYSc70QCrQl8cjQldBsV9umt7ala2WPRAcm1sSJzvOQX5GSz41YbZJ5XGRAnmW9ZeTN/aum1iqxLdkqYot4vy9Zzc/CRAOtd3Yh2376R3FZepR1rNjRSXSliwNuVFrZoqoRcaQdYRynQDZoXirE50noeuqJe4tPDg1voiOOFRzOYUozYnjdFXXv0B2MCcwLkKt8=',
70   }
71
72   @account { 'acoutandin':
73     ensure => present,
74     comment => 'Arwed Coutandin',
75     uid => 1003,
76     sshtype => 'ssh-rsa',
77     sshkey => 'AAAAB3NzaC1yc2EAAAADAQABAAACAQCy1WLtWfqorPk0+flp4Yjn9Phm5SK0zWB4pjTb8bNXZE/uHs7+/SUyIiLWh3lb0e7a3wv6CqiULlZYxs1Rx9r2b8AGU9ik8gvab9hteDjti0wC2xA+WLiFteRHfripM+XiNqpFbpb4FjlG6XlwZNJBENYw8WVLZDu+SbTtNAaqdRTSDUn6dKRZ+ZjkKl4mo6OyZ5m1ICnHYJtCJXovyTBp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wiLKGt2FTKXg8FCV6UhtbAkgCQZhfrcaGcSJcPl9TzqnA+phKtx1+I/De0O+69K2nwJoj45O1qVuLFTiMwJYwvEbPo4QfUOlSxv5cj99USVpXwQFZ4q8Eyz9/WvXOh2KZdFGpDyEj6wQ==', # arwed@macbookair
79   }
80
81   @account { 'aschiermeier':
82     ensure => present,
83     comment => 'Andreas Schiermeier',
84     uid => 1004,
85     sshtype => 'ssh-rsa',
86     sshkey => 'AAAAB3NzaC1yc2EAAAADAQABAAACAQCjOdP3+ujw2DNNMBYDkyDlSV4MQ5/fiJwX8d62NvwkxUX0rHbPcoQdnwuHakwRgJs9azE/KIa3PlCw4vd2tBF+WRNcCcA/483FUFAlIuzt8kvopt4X7yxgCL4K5yJsWhn9jTHRaQ0yZEmABLSJ4LO3Fl0m8eAyol4ylLvT/+e+lNskEC4e8CqfEzVTeOUefe62Ick1BbPGu1LyliJIpQ0y/up0deOylbWf7ll5+22wqxF89et7ZS+xKtdzJ/whvFeWlUvSdErYfWwGzYuGx/5HaWklKjXNQ7Y4ulM5OFD2yonnDi+CQzn5wc/VxVIgqDiqZI1hDXdus5GklcBaaXDsYoEImppyL+18aJ5YKX3vAVt5fW6q94yzS9v3sQqUMsKhgoFcdx645txwgfNgqsRNTXG1SgaamH4HEkwkawoSYI/QWcPgWJbwVG9nTkEpRh8/feFv29LMepSQqWGHoXBvz3xphLV5sQgo6U2h4HOuNC3nFa6KdWnllnL7JMEluyKyZSegHytio87RrHkkhsE0NgFvqWGxlTq3016iglAdHsQn5KJUdICY1bOVGnesJjo0AKKUydW/pQJU82h/V+CeBkImzyX+CLXMpJitU0BE2Bq2ZdhpBHlP3DICsPwbTheBcL8AQUaLo9iTiaFk4VnSnj92wLra5YnevP2U3nL3rQ==',
87   }
88
89   @account { 'mandre':
90     ensure => present,
91     comment => 'Max Andre',
92     uid => 1005,
93     sshtype => 'ssh-rsa',
94     sshkey => 'AAAAB3NzaC1yc2EAAAADAQABAAACAQDNuRDKJUsn8AALnw18GZinTgbIozx9JsKoIOhQqGkQ0npePebqH6CuKM72uzhmp7K/LvTkwQX9C4pCktFJubKiGu3viohp8YtoaiB8KPjAnvg+DVU9DsyuIj8lzgmSuMWHFKGkdvIojQ1Jy2Dnz6LmWU1K2NaRi4iZgIJwTY++RbzcNij1YanqWJu8Gtj5Sw59ulUQqMN6h4/wozFhEcnP63crzgtGU+vAC63Id6gWoaVYj4B1JS9g1HIU6dr6kuKl6JJ/dygqSUhxIWOEn5qBd0Oa19hxRYQq1yYAkIBz6BSMO1S6etu8ibj1xk3yqY++63cuNv+BsetGm2Fs5HBVVvjYg11pLanRt+nL+cMwhyZlI8DeSwhRiIH3QTqS/p8KpR1Bvsuj+aIqAMQzWpjL3ROMUxlIu7MFmwXR1L3+B84DnVHf15QqE1cESeYJVc7qOSbdtv+eAdZIKT2sHk2uYva1g4R93AlZ6LqdD6vZfV3333OOJk8DNYTgzJ1yfA+3VXRvlRuYhFUqXmdcNjOuT7JHbvcD3zmGtcS7o34zqBOpncBAAoDhuObje0qA8QGXRIemzSeeoT6fTIkcHCD9LDkPJUUNL5556b1aHjfgC7ryBb4V/sNofOuG3Azpq+VVc5NG2o0pdNfb4hZVomBe++OkoPuNKBHPysFeicSl4w==',
95   }
96
97   @account { 'kwolff':
98     ensure => present,
99     comment => 'Kris Wolff',
100     uid => 1006,
101     sshtype => 'ssh-rsa',
102     sshkey => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQCnvAXTLtbkUOFb19Ax57QNSHD/w1MlrqeXPQK/Pegi/uqfFX500UZ/g5vKxuUkhSsPBlZRPKX+458W5R71MHvFR4rQdZrN0FxLLdkBbtwze7NcVqHgynF5KM+RhpSe27oK90FtDlLc6ls7stPdSRwjkDEon7BUyHYhhq+1kiQ/kWSuZY69iY6K4kduh0ZNBdq4bdUGMu0PeaXSJ3P4txRayR7wJEpXrFexnRwbwqiiGpKTieOPNnG38theJ7rJizytHk/j9S8Wk2Cbe6I/S8IA13lnoRzDR/DVUnqDfEQg5/KAz9Vjui3swgyAvEr9e5m70fxzQsVOuplY+49sfxWR',
103   }
104
105   # make sure all absent users are realized!
106   Account <| ensure == absent |> {
107     groups => 'nogroup',
108   }
109
110 }