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