6dfd98d6452f13c7d6bdfccf1079509ac15a320d
[inetstation.git] / modules / system / manifests / init.pp
1 class system {
2
3         class { 'apt':
4                 purge => {
5                         'sources.list' => true,
6                         'sources.list.d' => true,
7                         'preferences' => true,
8                         'preferences.d' => true,
9                 },
10                 sources => {
11                         'debian' => {
12                                 location => 'http://ftp.de.debian.org/debian/',
13                                 release => "${lsbdistcodename}",
14                                 repos => 'main non-free contrib',
15                         },
16                         'debian-security' => {
17                                 location => 'http://security.debian.org/',
18                                 release => "${lsbdistcodename}/updates",
19                                 repos => 'main non-free contrib',
20                         },
21                         'debian-volatile' => {
22                                 location => 'http://ftp.de.debian.org/debian/',
23                                 release => "${lsbdistcodename}-updates",
24                                 repos => 'main non-free contrib',
25                         },
26                 },
27                 update => {
28                         frequency => 'always',
29                 },
30         }
31         
32
33         exec { 'add-architecture-i386':
34                 command => '/usr/bin/dpkg --add-architecture i386',
35                 unless => '/bin/fgrep -q i386 /var/lib/dpkg/arch',
36                 notify => Exec['apt_update'],
37         }
38
39         exec { 'aptget-update':
40                 command => '/usr/bin/apt-get update',
41                 refreshonly => true,
42         }
43
44         $packages = [
45                 'sudo',
46                 'lsof',
47                 'vim',
48                 'screen',
49                 'rsync',
50                 'tcpdump',
51                 'pv',
52                 'openssh-server',
53                 'locales-all',
54                 'libpam-tmpdir',
55                 'broadcom-sta-dkms',
56                 'firmware-iwlwifi',
57         ]
58   
59         package { $packages:
60                 ensure => installed,
61         }
62
63         include pam
64         include pam::mkhomedir
65
66         file { '/etc/pam.d/common-session':
67                 source => 'puppet:///modules/system/etc/pam.d/common-session',
68                 require => Exec['pam_auth_update'],
69         }
70
71         exec { 'systemd-reload':
72                 command => '/bin/systemctl daemon-reload',
73                 refreshonly => true,
74         }
75
76         file { '/etc/systemd/logind.conf':
77                 source => 'puppet:///modules/system/etc/systemd/logind.conf',
78                 notify => Exec['systemd-reload'],
79         }
80
81         package { 'chrony':
82                 ensure => installed,
83         }
84
85         service { 'chrony':
86                 ensure => running,
87                 enable => true,
88                 hasstatus  => false,
89                 hasrestart => true,
90                 require => Package['chrony'],
91         }
92
93         package { 'network-manager':
94                 ensure => installed,
95         }
96
97         package { 'network-manager-gnome':
98                 ensure => installed,
99         }
100
101         file { '/etc/network/interfaces':
102                 ensure => file,
103                 source => 'puppet:///modules/system/etc/network/interfaces',
104                 mode => 'a=r',
105                 require => Package['network-manager'],
106         }
107
108         file { '/etc/NetworkManager/dispatcher.d/99-wlan':
109                 ensure => file,
110                 source => 'puppet:///modules/system/etc/NetworkManager/dispatcher.d/99-wlan',
111                 mode => 'a=rx',
112                 require => Package['network-manager'],
113         }
114
115         file { '/etc/NetworkManager/system-connections/ffm.freifunk.net':
116                 ensure => file,
117                 source => 'puppet:///modules/system/etc/NetworkManager/system-connections/ffm.freifunk.net',
118                 mode => 'a=,u=r',
119                 require => Package['network-manager'],
120         }
121
122         file { '/etc/NetworkManager/system-connections/wired':
123                 ensure => file,
124                 source => 'puppet:///modules/system/etc/NetworkManager/system-connections/wired',
125                 mode => 'a=,u=r',
126                 require => Package['network-manager'],
127         }
128
129         package { 'wicd*':
130                 ensure => absent,
131                 require => Package['network-manager'],
132         }
133
134         printer { "mfp01":
135                 ensure       => present,
136                 uri          => 'dnssd://mfp01._ipp._tcp.local/',
137                 description  => 'mfp01',
138                 location     => 'In the same network.',
139                 require      => [ 
140                                 Package['avahi-utils'],
141                                 Package['avahi-daemon'],
142                                 Package['libnss-mdns'],
143                                 Package['cups'],
144                                 Package['hplip'],
145                         ],
146                 model        => 'drv:///hpcups.drv/hp-deskjet_990c.ppd', 
147                 shared       => false,
148                 error_policy => 'abort_job',
149                 enabled      => true,
150                 page_size    => 'A4',
151         }
152 }