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