diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2017-08-14 19:02:29 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2017-08-24 00:33:58 +0200 |
commit | ba2cf1b5d938810077b0fd73844faf432e8e8f9d (patch) | |
tree | 40884fcc70af8eb349979b2ff62e3e4435bae5a5 /modules/base_configuration/manifests | |
parent | eb9fec57fcfcc84f0e310e343167a10fb13ca0c8 (diff) | |
download | Puppet-ba2cf1b5d938810077b0fd73844faf432e8e8f9d.tar.gz Puppet-ba2cf1b5d938810077b0fd73844faf432e8e8f9d.tar.zst Puppet-ba2cf1b5d938810077b0fd73844faf432e8e8f9d.zip |
Install OVH vps from scratch
Diffstat (limited to 'modules/base_configuration/manifests')
-rw-r--r-- | modules/base_configuration/manifests/init.pp | 94 |
1 files changed, 82 insertions, 12 deletions
diff --git a/modules/base_configuration/manifests/init.pp b/modules/base_configuration/manifests/init.pp index a46dd8b..8b2ce4c 100644 --- a/modules/base_configuration/manifests/init.pp +++ b/modules/base_configuration/manifests/init.pp | |||
@@ -1,27 +1,59 @@ | |||
1 | class base_configuration ( | 1 | class base_configuration ( |
2 | $hostname = undef, | 2 | $hostname = undef, |
3 | $username = "immae", | 3 | $username = "immae", |
4 | $userid = 1000 | 4 | $userid = 1000, |
5 | $code_path = undef, | ||
6 | $device = undef, | ||
5 | ) { | 7 | ) { |
8 | unless empty($device) { | ||
9 | class { 'grub_install': | ||
10 | device => $device, | ||
11 | } | ||
12 | } | ||
13 | |||
14 | class { 'locales': } | ||
15 | |||
16 | unless empty($code_path) { | ||
17 | class { 'cron_puppet': | ||
18 | code_path => $code_path, | ||
19 | } | ||
20 | } | ||
21 | |||
6 | service { "sshd": | 22 | service { "sshd": |
7 | ensure => "running", | 23 | #ensure => "running", |
8 | enable => true, | 24 | enable => true, |
9 | } | 25 | } |
10 | service { "systemd-networkd.socket": | 26 | service { "systemd-networkd": |
11 | ensure => "running", | 27 | #ensure => "running", |
12 | enable => true, | 28 | enable => true, |
13 | } | 29 | } |
14 | service { "systemd-networkd": | 30 | service { "systemd-resolved": |
15 | ensure => "running", | 31 | #ensure => "running", |
16 | enable => true, | 32 | enable => true, |
17 | } | 33 | } |
18 | 34 | ||
35 | file { "/etc/localtime": | ||
36 | ensure => "link", | ||
37 | target => "../usr/share/zoneinfo/Europe/Paris" | ||
38 | } | ||
39 | |||
40 | exec { "set_locale": | ||
41 | command => "/usr/bin/systemd-firstboot --locale=fr_FR.UTF-8", | ||
42 | creates => "/etc/locale.conf", | ||
43 | } | ||
44 | |||
19 | unless empty($hostname) { | 45 | unless empty($hostname) { |
20 | class { 'systemd::hostname': | 46 | exec { "set_hostname": |
21 | hostname => $hostname | 47 | command => "/usr/bin/systemd-firstboot --hostname=$hostname", |
48 | creates => "/etc/hostname", | ||
22 | } | 49 | } |
23 | } | 50 | } |
24 | 51 | ||
52 | file { "/etc/vconsole.conf": | ||
53 | ensure => "link", | ||
54 | target => "/dev/null", | ||
55 | } | ||
56 | |||
25 | user { "${username}:${userid}": | 57 | user { "${username}:${userid}": |
26 | name => $username, | 58 | name => $username, |
27 | uid => $userid, | 59 | uid => $userid, |
@@ -70,6 +102,42 @@ class base_configuration ( | |||
70 | password => '!' | 102 | password => '!' |
71 | } | 103 | } |
72 | 104 | ||
105 | file { '/etc/modprobe.d/pcspkr_no_autoload.conf': | ||
106 | ensure => "present", | ||
107 | path => "/etc/modprobe.d/pcspkr_no_autoload.conf", | ||
108 | source => 'puppet:///modules/base_configuration/pcspkr_no_autoload.conf', | ||
109 | mode => "0644", | ||
110 | owner => "root", | ||
111 | group => "root" | ||
112 | } | ||
113 | |||
114 | file { '/etc/systemd/system/getty@tty1.service.d/': | ||
115 | ensure => "directory", | ||
116 | path => "/etc/systemd/system/getty@tty1.service.d/", | ||
117 | mode => "0755", | ||
118 | owner => "root", | ||
119 | group => "root" | ||
120 | } | ||
121 | |||
122 | file { '/etc/systemd/system/getty@tty1.service.d/noclear.conf': | ||
123 | ensure => "present", | ||
124 | path => "/etc/systemd/system/getty@tty1.service.d/noclear.conf", | ||
125 | source => 'puppet:///modules/base_configuration/getty_conf_override.conf', | ||
126 | recurse => true, | ||
127 | mode => "0644", | ||
128 | owner => "root", | ||
129 | group => "root" | ||
130 | } | ||
131 | |||
132 | file { '/etc/systemd/network/en-dhcp.network': | ||
133 | ensure => "present", | ||
134 | path => "/etc/systemd/network/en-dhcp.network", | ||
135 | source => 'puppet:///modules/base_configuration/en-dhcp.network', | ||
136 | mode => "0644", | ||
137 | owner => "root", | ||
138 | group => "root" | ||
139 | } | ||
140 | |||
73 | file { '/etc/pacman.d/mirrorlist': | 141 | file { '/etc/pacman.d/mirrorlist': |
74 | ensure => "present", | 142 | ensure => "present", |
75 | path => "/etc/pacman.d/mirrorlist", | 143 | path => "/etc/pacman.d/mirrorlist", |
@@ -108,7 +176,7 @@ class base_configuration ( | |||
108 | create_mode => '0664', | 176 | create_mode => '0664', |
109 | create_owner => 'root', | 177 | create_owner => 'root', |
110 | create_group => 'utmp', | 178 | create_group => 'utmp', |
111 | rotate => '1', | 179 | rotate => 1, |
112 | minsize => '1M', | 180 | minsize => '1M', |
113 | } | 181 | } |
114 | logrotate::rule { 'btmp': | 182 | logrotate::rule { 'btmp': |
@@ -119,7 +187,7 @@ class base_configuration ( | |||
119 | create_mode => '0600', | 187 | create_mode => '0600', |
120 | create_owner => 'root', | 188 | create_owner => 'root', |
121 | create_group => 'utmp', | 189 | create_group => 'utmp', |
122 | rotate => '1', | 190 | rotate => 1, |
123 | } | 191 | } |
124 | 192 | ||
125 | ensure_packages(["whois"], { 'install_options' => '--asdeps' }) | 193 | ensure_packages(["whois"], { 'install_options' => '--asdeps' }) |
@@ -136,4 +204,6 @@ class base_configuration ( | |||
136 | logpath => '', | 204 | logpath => '', |
137 | order => 10 | 205 | order => 10 |
138 | } | 206 | } |
207 | |||
208 | class { 'aur': } | ||
139 | } | 209 | } |