-
Notifications
You must be signed in to change notification settings - Fork 2
/
ubuntu.toml
154 lines (129 loc) · 6 KB
/
ubuntu.toml
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
[ structure.ubuntu-base ]
description = 'Base Ubuntu'
parents = [ 'linux-base' ]
[ structure.ubuntu-base.config_values ]
installer_pxe = 'ubuntu'
mirror_server = 'us.archive.ubuntu.com'
distro = 'ubuntu'
'vcenter_guest_id:VCenter' = 'ubuntu64Guest'
'>package_list:VCenter' = [ 'open-vm-tools' ]
'virtualbox_guest_type:VirtualBox' = 'Ubuntu_64'
'<postinstall_command_list' = [ 'sed "s/#PermitRootLogin.*/PermitRootLogin yes/" -i /etc/ssh/sshd_config' ]
[ structure.ubuntu-trusty-base ]
description = 'Base Ubuntu Trusty Tahr (14.04 LTS)'
parents = [ 'ubuntu-base' ]
[ structure.ubuntu-trusty-base.config_values ]
distro_version = 'trusty'
'azure_image:Azure' = { 'publisher' = 'Canonical', 'offer' = 'UbuntuServer', 'sku' = '14.04-LTS', 'version' = 'latest' }
[ structure.ubuntu-xenial-base ]
description = 'Base Ubuntu Xenial Xerus (16.04 LTS)'
parents = [ 'ubuntu-base' ]
[ structure.ubuntu-xenial-base.config_values ]
distro_version = 'xenial'
'awsec2_image_id:AWS' = 'ami-efd0428f'
'docker_image:Docker' = 'ubuntu:xenial'
'azure_image:Azure' = { 'publisher' = 'Canonical', 'offer' = 'UbuntuServer', 'sku' = '16.04-LTS', 'version' = 'latest' }
[ structure.ubuntu-bionic-base ]
description = 'Base Ubuntu Bionic Beaver (18.04 LTS)'
parents = [ 'ubuntu-base' ]
[ structure.ubuntu-bionic-base.config_values ]
distro_version = 'bionic'
'docker_image:Docker' = 'ubuntu:bionic'
'azure_image:Azure' = { 'publisher' = 'Canonical', 'offer' = 'UbuntuServer', 'sku' = '18.04-LTS', 'version' = 'latest' }
[ structure.ubuntu-focal-base ]
description = 'Base Ubuntu Focal Fossa (20.04 LTS)'
parents = [ 'ubuntu-base' ]
[ structure.ubuntu-focal-base.config_values ]
distro_version = 'focal'
'docker_image:Docker' = 'ubuntu:focal'
'azure_image:Azure' = { 'publisher' = 'Canonical', 'offer' = 'UbuntuServer', 'sku' = '20.04-LTS', 'version' = 'latest' }
[ pxe.ubuntu ]
boot_script = """echo Ubuntu Installer
kernel {{ __pxe_location }}/ubuntu-installer/vmlinuz auto url={{ __pxe_template_location }} locale=en_US.UTF-8 keyboard-configuration/layoutcode=us netcfg/no_default_route=true ksdevice=bootif interface={{ _primary_interface }} domain={{ _domain_name }} hostname={{ _hostname }} BOOTIF={{ _primary_interface_mac.replace( ':', '-' ) }}
initrd {{ __pxe_location }}/ubuntu-installer/initrd
boot
"""
template = """
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/xkb-keymap select us
### Network settings
d-i netcfg/enable boolean true
d-i netcfg/disable_autoconfig boolean true
d-i netcfg/disable_dhcp boolean true
d-i netcfg/choose_interface select {{ _primary_interface }}
d-i netcfg/get_ipaddress string {{ _primary_address.address }}
d-i netcfg/get_netmask string {{ _primary_address.netmask }}
{% if _primary_address.gateway %}
d-i netcfg/get_gateway string {{ _primary_address.gateway }}
{% else %}
d-i netcfg/get_gateway string
d-i netcfg/no_default_route boolean true
{% endif %}
d-i netcfg/get_nameservers string {{ dns_servers.0 }}
d-i netcfg/confirm_static boolean true
d-i netcfg/get_hostname string {{ _hostname }}
d-i netcfg/get_domain string {{ _domain_name }}
d-i netcfg/hostname string {{ _hostname }}
### Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string {{ mirror_server }}
d-i mirror/http/directory string /ubuntu/
d-i mirror/http/proxy string {{ mirror_proxy }}
# Suite to install.
d-i mirror/suite string {{ distro_version }}
### Account setup
d-i passwd/make-user boolean false
d-i user-setup/allow-password-weak boolean true
d-i passwd/root-login boolean true
d-i passwd/root-password-crypted password {{ root_password_hash }}
d-i user-setup/encrypt-home boolean false
### Clock and time zone setup
d-i clock-setup/utc boolean true
d-i time/zone string UTC
# Controls whether to use NTP to set the clock during the install
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server string {{ ntp_servers.0 }}
### Partitioning
## Partitioning example
d-i partman-auto/disk string {{ install_device|default( '/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 atomic
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
### Base system installation
#d-i base-installer/install-recommends boolean false
#d-i base-installer/kernel/image string linux-generic
### Package selection
tasksel tasksel/first multiselect server
d-i pkgsel/include string openssh-server {{ package_list|join( ' ' ) }}
d-i pkgsel/upgrade select safe-upgrade
d-i pkgsel/update-policy select none
popularity-contest popularity-contest/participate boolean false
### Boot loader installation
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i grub-installer/bootdev string {{ boot_device|default( '/dev/sda' ) }}
### Finishing up the installation
d-i finish-install/keep-consoles boolean true
d-i finish-install/reboot_in_progress note
d-i debian-installer/exit/poweroff boolean true
### Needed to get the network config to save
d-i preseed/early_command string kill-all-dhcp; netcfg
### Post install
{% if postinstall_script or postinstall_command_list %}
d-i preseed/late_command string echo -e '#!/bin/sh -xe\\necho "Start post install..."\\n\\
{% if postinstall_script %} wget -vO /target/root/postinstall_script {{ postinstall_script }}\\n\\
chmod +x /target/root/postinstall_script\\n\\
chroot /target /root/postinstall_script > /target/root/postinstall_script.log 2>&1\\n\\
{% endif %}{% for cmd in postinstall_command_list %}chroot /target {{ cmd }}\\n\\
{% endfor %}echo "Post install complete"\\n' > /target/root/post_script ; chmod +x /target/root/post_script ; ./target/root/post_script > /target/root/post_script.log 2>&1
{% endif %}
"""