5f4c49eb528158bdf98d8963e384aa5e00630786
[noc.git] / ansible / roles / preseed / templates / preseed_ubuntu-xenial.cfg.j2
1 #########################################################################
2 #  realraum preseed file for Ubuntu xenial based VMs
3 #########################################################################
4
5 d-i debian-installer/language string en
6 d-i debian-installer/country string AT
7 d-i debian-installer/locale string en_US.UTF-8
8 d-i localechooser/preferred-locale string en_US.UTF-8
9 d-i localechooser/supported-locales multiselect de_DE.UTF-8, de_AT.UTF-8
10 d-i console-setup/ask_detect boolean false
11 d-i keyboard-configuration/xkb-keymap select us
12 d-i keyboard-configuration/layoutcode string us
13
14
15 #d-i netcfg/choose_interface select enp1s1
16 #d-i netcfg/disable_autoconfig boolean false
17 #d-i netcfg/get_ipaddress string {{ hostvars[hostname].network_cooked.primary.ip }}
18 #d-i netcfg/get_netmask string {{ hostvars[hostname].network_cooked.primary.mask }}
19 #d-i netcfg/get_gateway string {{ hostvars[hostname].network_cooked.primary.gateway }}
20 #d-i netcfg/get_nameservers string {{ hostvars[hostname].network_cooked.nameservers | join(' ') }}
21 #d-i netcfg/confirm_static boolean true
22
23 d-i netcfg/get_hostname string {{ hostname }}
24 d-i netcfg/get_domain string {{ hostvars[hostname].network_cooked.domain }}
25 d-i netcfg/wireless_wep string
26
27
28 d-i mirror/country string manual
29 d-i mirror/http/hostname string debian.ffgraz.net
30 d-i mirror/http/directory string /ubuntu
31 d-i mirror/http/proxy string
32
33
34 d-i passwd/make-user boolean false
35 d-i passwd/root-login boolean true
36 d-i passwd/root-password password this-very-very-secure-password-will-be-removed-by-latecommand
37 d-i passwd/root-password-again password this-very-very-secure-password-will-be-removed-by-latecommand
38
39
40 d-i clock-setup/utc boolean true
41 d-i time/zone string Europe/Vienna
42 d-i clock-setup/ntp boolean false
43
44
45 d-i partman-auto/disk string /dev/{{ hostvars[hostname].install_cooked.disks.primary }}
46 d-i partman-auto/method string lvm
47 d-i partman-auto/purge_lvm_from_device boolean true
48 d-i partman-auto-lvm/new_vg_name string {{ hostname }}
49 d-i partman-auto-lvm/guided_size string max
50
51 d-i partman-lvm/device_remove_lvm boolean true
52 d-i partman-lvm/confirm boolean true
53 d-i partman-lvm/confirm_nooverwrite boolean true
54
55 d-i partman-auto/expert_recipe string                                   \
56       boot-root ::                                                      \
57               1000 10000 -1 ext4                                        \
58                       $defaultignore{ } $primary{ } $bootable{ }        \
59                       method{ lvm } vg_name{ {{ hostname }} }             \
60               .                                                         \
61               2048 10000 2560 ext4                                      \
62                       $lvmok{ } in_vg{ {{ hostname }} }                   \
63                       method{ format } format{ }                        \
64                       use_filesystem{ } filesystem{ ext4 }              \
65                       mountpoint{ / }                                   \
66               .                                                         \
67               1024 11000 1280 ext4                                      \
68                       $lvmok{ } in_vg{ {{ hostname }} }                   \
69                       method{ format } format{ }                        \
70                       use_filesystem{ } filesystem{ ext4 }              \
71                       mountpoint{ /var }                                \
72               .                                                         \
73               768 10000 768 ext4                                        \
74                       $lvmok{ } in_vg{ {{ hostname }} }                   \
75                       method{ format } format{ }                        \
76                       use_filesystem{ } filesystem{ ext4 }              \
77                       mountpoint{ /var/log }                            \
78                       options/nodev{ nodev } options/noatime{ noatime } \
79                       options/noexec{ noexec }                          \
80               .                                                         \
81               16 20000 -1 ext4                                          \
82                       $lvmok{ } in_vg{ {{ hostname }} }                   \
83                       method( keep } lv_name{ dummy }                   \
84               .
85
86 d-i partman-auto-lvm/no_boot boolean true
87 d-i partman-basicfilesystems/no_swap true
88 d-i partman-partitioning/confirm_write_new_label boolean true
89 d-i partman/choose_partition select finish
90 d-i partman/confirm boolean true
91 d-i partman/confirm_nooverwrite boolean true
92
93
94 d-i base-installer/install-recommends boolean false
95 d-i apt-setup/security_host string debian.ffgraz.net
96
97 tasksel tasksel/first multiselect
98 d-i pkgsel/include string openssh-server python
99 d-i pkgsel/upgrade select safe-upgrade
100 popularity-contest popularity-contest/participate boolean false
101 d-i pkgsel/update-policy select none
102
103 d-i grub-installer/choose_bootdev string /dev/{{ hostvars[hostname].install_cooked.disks.primary }}
104 d-i grub-installer/only_debian boolean true
105 d-i grub-installer/with_other_os boolean false
106
107 d-i finish-install/reboot_in_progress note
108
109
110 d-i preseed/late_command string \
111     lvremove -f {{ hostname }}/dummy; \
112     in-target bash -c "apt-get update -q && apt-get full-upgrade -y -q"; \
113     in-target bash -c "passwd -d root; passwd -l root; umask 077; mkdir -p /root/.ssh/; echo -e '{{ noc_ssh_keys | join('\\n') }}' > /root/.ssh/authorized_keys"; \
114     in-target bash -c "sed -e 's/^\(\s*#*\s*Port.*\)/Port 22000/' -i /etc/ssh/sshd_config"