-
Notifications
You must be signed in to change notification settings - Fork 4
/
preseed-vsphere.cfg
137 lines (137 loc) · 10.2 KB
/
preseed-vsphere.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#### Contents of the preconfiguration file (for jessie)
### Localization
d-i debian-installer/language string en
d-i debian-installer/country string US
d-i debian-installer/locale string en_US.UTF-8
d-i localechooser/supported-locales multiselect en_US.UTF-8
d-i keyboard-configuration/xkb-keymap select de
d-i netcfg/choose_interface select auto
d-i netcfg/link_wait_timeout string 10
d-i netcfg/dhcp_timeout string 60
d-i netcfg/dhcpv6_timeout string 60
d-i netcfg/get_hostname string Vagrant-VM
d-i netcfg/get_domain string localdomain
d-i hw-detect/load_firmware boolean true
d-i mirror/country string manual
d-i mirror/http/hostname string ftp.de.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
d-i passwd/root-login boolean false
# Generierung von PW Hashes mit mkpasswd -m sha-512
#d-i passwd/root-password-crypted password
d-i passwd/root-password password vagrant
d-i passwd/root-password-again password vagrant
d-i passwd/user-fullname string Vagrant
d-i passwd/username string vagrant
d-i passwd/user-password password vagrant
d-i passwd/user-password-again password vagrant
#d-i passwd/user-password-crypted password [MD5 hash]
d-i passwd/user-default-groups string vagrant cdrom floppy audio dip video plugdev netdev sudo
d-i clock-setup/utc boolean true
d-i time/zone string Etc/UTC
d-i clock-setup/ntp boolean true
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
#d-i partman-auto/choose_recipe select home
d-i partman-auto/expert_recipe string \
boot-root :: \
1000 10000 1000000000000 ext4 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ / } \
. \
512 512 512 linux-swap \
method{ swap } format{ } \
.
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/mount_style select uuid
d-i base-installer/kernel/image string linux-image-amd64
d-i apt-setup/non-free boolean true
d-i apt-setup/contrib boolean true
d-i apt-setup/services-select multiselect security, updates
d-i apt-setup/security_host string security.debian.org
#d-i apt-setup/multiarch string i386
tasksel tasksel/first multiselect standard, ssh-server
d-i pkgsel/include string build-essential, ruby-highline, ruby-termios, sudo, ntp, linux-headers-amd64, dpkg, screen, htop, wget, curl, openjdk-7-jre, open-vm-tools, rsync, libpam-systemd, python2.7, fabric, resolvconf, linux-image-amd64, openssh-server
d-i pkgsel/upgrade select full-upgrade
popularity-contest popularity-contest/participate boolean false
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i grub-installer/bootdev string /dev/sda
#d-i grub-installer/bootdev string default
#d-i debian-installer/add-kernel-opts string nousb
d-i finish-install/reboot_in_progress note
d-i cdrom-detect/eject boolean true
d-i debian-installer/exit/poweroff boolean true
d-i preseed/late_command string \
in-target sed -i 's/^%sudo.*$/%sudo ALL=(ALL:ALL) NOPASSWD: ALL/g' /etc/sudoers; \
in-target /bin/sh -c "echo 'Defaults env_keep += \"SSH_AUTH_SOCK DEBIAN_FRONTEND\"' >> /etc/sudoers"; \
in-target /bin/sh -c "echo 'export DEBIAN_FRONTEND=noninteractive' >> /home/vagrant/.bashrc"; \
in-target /bin/sh -c "echo 'export DEBIAN_FRONTEND=noninteractive' >> /root/.bashrc"; \
in-target /bin/sh -c "echo 'blacklist ipv6' >> /etc/modprobe.d/blacklist.conf"; \
in-target /bin/sh -c "echo 'net.ipv6.conf.all.disable_ipv6 = 1' >> /etc/sysctl.d/01-disable-ipv6.conf"; \
in-target mkdir -p /home/vagrant/.ssh; \
in-target /bin/sh -c "echo 'fs.file-max = 404358' >> /etc/sysctl.conf"; \
in-target /bin/sh -c "echo 'fs.file-max = 404358' >> /etc/sysctl.d/99-sysctl.conf"; \
in-target /bin/sh -c "echo '* - nofile 404358' >> /etc/security/limits.conf"; \
in-target /bin/sh -c "echo 'root - nofile 404358' >> /etc/security/limits.conf"; \
in-target /bin/sh -c "echo 'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key' >> /home/vagrant/.ssh/authorized_keys"; \
in-target /bin/sh -c "echo 'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key' >> /home/vagrant/.ssh/id_rsa.pub"; \
in-target /bin/sh -c "echo 'Host *' >> /home/vagrant/.ssh/config"; \
in-target /bin/sh -c "echo ' StrictHostKeyChecking no' >> /home/vagrant/.ssh/config"; \
in-target /bin/sh -c "echo ' UserKnownHostsFile=/dev/null' >> /home/vagrant/.ssh/config"; \
in-target /bin/sh -c "echo '-----BEGIN RSA PRIVATE KEY-----' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'MIIEogIBAAKCAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzI' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'w+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoP' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'kcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NO' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'Td0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcW' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'yLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQIBIwKCAQEA4iqWPJXtzZA68mKd' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'ELs4jJsdyky+ewdZeNds5tjcnHU5zUYE25K+ffJED9qUWICcLZDc81TGWjHyAqD1' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'Bw7XpgUwFgeUJwUlzQurAv+/ySnxiwuaGJfhFM1CaQHzfXphgVml+fZUvnJUTvzf' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'TK2Lg6EdbUE9TarUlBf/xPfuEhMSlIE5keb/Zz3/LUlRg8yDqz5w+QWVJ4utnKnK' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'iqwZN0mwpwU7YSyJhlT4YV1F3n4YjLswM5wJs2oqm0jssQu/BT0tyEXNDYBLEF4A' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'sClaWuSJ2kjq7KhrrYXzagqhnSei9ODYFShJu8UWVec3Ihb5ZXlzO6vdNQ1J9Xsf' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo '4m+2ywKBgQD6qFxx/Rv9CNN96l/4rb14HKirC2o/orApiHmHDsURs5rUKDx0f9iP' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'cXN7S1uePXuJRK/5hsubaOCx3Owd2u9gD6Oq0CsMkE4CUSiJcYrMANtx54cGH7Rk' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'EjFZxK8xAv1ldELEyxrFqkbE4BKd8QOt414qjvTGyAK+OLD3M2QdCQKBgQDtx8pN' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'CAxR7yhHbIWT1AH66+XWN8bXq7l3RO/ukeaci98JfkbkxURZhtxV/HHuvUhnPLdX' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo '3TwygPBYZFNo4pzVEhzWoTtnEtrFueKxyc3+LjZpuo+mBlQ6ORtfgkr9gBVphXZG' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'YEzkCD3lVdl8L4cw9BVpKrJCs1c5taGjDgdInQKBgHm/fVvv96bJxc9x1tffXAcj' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo '3OVdUN0UgXNCSaf/3A/phbeBQe9xS+3mpc4r6qvx+iy69mNBeNZ0xOitIjpjBo2+' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'dBEjSBwLk5q5tJqHmy/jKMJL4n9ROlx93XS+njxgibTvU6Fp9w+NOFD/HvxB3Tcz' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo '6+jJF85D5BNAG3DBMKBjAoGBAOAxZvgsKN+JuENXsST7F89Tck2iTcQIT8g5rwWC' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'P9Vt74yboe2kDT531w8+egz7nAmRBKNM751U/95P9t88EDacDI/Z2OwnuFQHCPDF' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'llYOUI+SpLJ6/vURRbHSnnn8a/XG+nzedGH5JGqEJNQsz+xT2axM0/W/CRknmGaJ' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'kda/AoGANWrLCz708y7VYgAtW2Uf1DPOIYMdvo6fxIB5i9ZfISgcJ/bbCUkFrhoH' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo '+vq/5CIWxCPp0f85R4qxxQ5ihxJ0YDQT9Jpx4TMss4PSavPaBH3RXow5Ohe+bYoQ' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo 'NE5OgEXk2wVfZczCZpigBKbKZHNYcelXtTt/nP3rsCuGcM4h53s=' >> /home/vagrant/.ssh/id_rsa"; \
in-target /bin/sh -c "echo '-----END RSA PRIVATE KEY-----' >> /home/vagrant/.ssh/id_rsa"; \
in-target chmod 640 /home/vagrant/.ssh/id_rsa.pub; \
in-target chmod 600 /home/vagrant/.ssh/id_rsa; \
in-target chown -R vagrant:vagrant /home/vagrant/; \
in-target chmod -R go-rwx /home/vagrant/.ssh/authorized_keys; \
in-target cp -r /home/vagrant/.ssh /root/; \
in-target chown -R root:root /root/.ssh/; \
in-target sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config; \
in-target rm /etc/udev/rules.d/70-persistent-net.rules; \
in-target /bin/sh -c "echo '#!/bin/bash' >> /home/vagrant/change_hostname.sh"; \
in-target /bin/sh -c "echo 'get_ip=\$(sudo ifconfig | grep -E -o \"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\" | head -n1)' >> /home/vagrant/change_hostname.sh"; \
in-target /bin/sh -c "echo 'sudo -s bash -c \"echo \\\"\$get_ip \$1\\\" >> /etc/hosts\"' >> /home/vagrant/change_hostname.sh"; \
in-target /bin/sh -c "echo 'sudo -s bash -c \"sudo hostname \$1;' >> /home/vagrant/change_hostname.sh"; \
in-target /bin/sh -c "echo 'sudo -s bash -c \"echo \\\"\$1\\\" > /etc/hostname\"' >> /home/vagrant/change_hostname.sh"; \
in-target /bin/sh -c "echo 'sudo -s bash -c \"sudo sed -i \"s/127.0.1.1.*$//g\" /etc/hosts' >> /home/vagrant/change_hostname.sh"; \
in-target /bin/sh -c "echo 'sudo hostnamectl set-hostname \$1' >> /home/vagrant/change_hostname.sh"; \
in-target cp /home/vagrant/change_hostname.sh /root/change_hostname.sh; \
in-target chmod 775 /home/vagrant/change_hostname.sh /root/change_hostname.sh; \
in-target chown vagrant:vagrant /home/vagrant/change_hostname.sh; \
in-target chown root:root /root/change_hostname.sh; \
in-target apt-get clean;