Dropped redundant definition.
[inetstation.git] / modules / system / manifests / init.pp
1 class system {
2
3         class { 'apt':
4                 purge => [
5                         'sources.list',
6                         'sources.list.d',
7                         'preferences',
8                         'preferences.d',
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         file { '/etc/network/interfaces':
98                 ensure => file,
99                 source => 'puppet:///modules/system/etc/network/interfaces',
100                 mode => 'a=r',
101                 require => Package['network-manager'],
102         }
103
104         file { '/etc/NetworkManager/system-connections/ffm.freifunk.net':
105                 ensure => file,
106                 source => 'puppet:///modules/system/etc/NetworkManager/system-connections/ffm.freifunk.net',
107                 mode => 'a=,u=r',
108                 require => Package['network-manager'],
109         }
110
111         file { '/etc/NetworkManager/system-connections/wired':
112                 ensure => file,
113                 source => 'puppet:///modules/system/etc/NetworkManager/system-connections/wired',
114                 mode => 'a=,u=r',
115                 require => Package['network-manager'],
116         }
117
118         package { 'wicd*':
119                 ensure => absent,
120                 require => Package['network-manager'],
121         }
122
123 }