generated from HariSekhon/Template-Repo
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathautoinstall-user-data
182 lines (179 loc) · 6.04 KB
/
autoinstall-user-data
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#cloud-config
# XXX: first line must be #cloud-config otherwise this is not respected and it falls into interactive mode
#
# Author: Hari Sekhon
# Date: 2023-05-29 21:23:52 +0100 (Mon, 29 May 2023)
#
# vim:ts=2:sts=2:sw=2:et:filetype=yaml
#
# https://github.com/HariSekhon/Packer
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
# ============================================================================ #
# A u t o I n s t a l l f o r U b u n t u
# ============================================================================ #
# https://ubuntu.com/server/docs/install/autoinstall-reference
---
autoinstall:
# wait for user input in these sections for additional customization - can use this to further refine using a generated autoinstall-user-data
#interactive-sections:
# - storage
refresh-installer:
update: no # crashes trying to update on Qemu x86_64 - see https://bugs.launchpad.net/ubuntu/+source/subiquity/+bug/2022856
apt:
disable_components: []
geoip: true
preserve_sources_list: false
primary:
- arches:
- amd64
- i386
uri: http://gb.archive.ubuntu.com/ubuntu
- arches:
- default
uri: http://ports.ubuntu.com/ubuntu-ports
drivers:
install: false
early-commands:
- systemctl stop sshd # stop sshd during the installer or else packer will try to connect too early
identity:
hostname: server1
# pw is 'packer' to match Packer settings in template.pkr.hcl
password: $6$SKgUj12luWUiaMpN$pSRLDN.ExoNlBfNm4b5r8RtukZOkyr4mClu0A/hA7ghxAfPQfDw9jb8NvPyl64exP6EZMRAkzwMAyu3ycrrsm0
realname: packer
username: packer
kernel:
package: linux-generic
keyboard:
layout: gb
toggle: null
variant: ''
late-commands:
- 'echo "packer ALL=(ALL) NOPASSWD: ALL" > /target/etc/sudoers.d/packer'
# Import my SSH key from GitHub
# errors out installer
#- curtin in-target --target=/target -- ssh-import-id gh:harisekhon
- 'printf "%-30s %s\n" "Build Date:" "`date`" >> /target/etc/build_release'
#- sed -i 's/^ca:/#ca:/' /target/etc/inittab
#
#- "echo 'ubuntu ALL=(ALL) NOPASSWD: ALL' > /target/etc/sudoers.d/99_ubuntu_user"
#- "curtin in-target --target=/target -- chmod 440 /etc/sudoers.d/99_ubuntu_user"
#- "sed -ie 's/GRUB_TIMEOUT=.*/GRUB_TIMEOUT=5/' /target/etc/default/grub"
#- "curtin in-target --target=/target -- apt-get -y dist-upgrade"
#- "curtin in-target --target=/target -- apt-get -y autoremove"
#- "curtin in-target --target=/target -- apt-get autoclean"
#- "curtin in-target --target=/target -- apt-get clean"
#- "curtin in-target --target=/target -- rm -rf /var/lib/apt/lists/*"
locale: en_GB.UTF-8
network:
ethernets:
enp0s3:
dhcp4: true
version: 2
packages:
- apt-transport-https
#- build-essential
- bash-completion
- bind9-utils
- ca-certificates
#- cloud-init
- curl
#- gnupg
- iptables
- iputils-ping
- less
#- net-tools # breaks installer
#- ntp # breaks installer
#- ntpdate # breaks installer
- open-vm-tools
- openssh-server
- procps
- psmisc
#- socat
#- tcpdump
#- time
#- traceroute # breaks installer
- tmux
- vim
- wget
#- zip
#- unzip
#proxy: http://proxy_host:proxy_port/
#shutdown: "poweroff"
snaps:
- channel: stable
classic: true
name: aws-cli
- channel: stable
classic: false
name: docker
- channel: stable
classic: false
name: doctl
- channel: stable
classic: false
name: etcd
- channel: stable
classic: true
name: google-cloud-sdk
- channel: stable
classic: false
name: juju
- channel: stable
classic: true
name: keepalived
- channel: stable
classic: true
name: microk8s
- channel: stable
classic: false
name: postgresql10
- channel: stable
classic: false
name: prometheus
- channel: stable
classic: false
name: stress-ng
source:
#id: ubuntu-server-minimal
id: ubuntu-server
search_drivers: false
ssh:
# needed by Packer to log in and finish configuring
allow-pw: true
allow_public_ssh_keys: true
authorized-keys:
- 'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvihSRU+YjBKvKiacDfUoZ7ghoVMcwNh4cWIYUNFGZosXOzNtyOcBpIb71TCgLFhOd+aMWKXCEC67BpNSIjt+a/FLD27AwmgVHv6cPlE3G0JJ9zmIrNmx9511dshTsxUW2O0SbYG+3InuO7FUkSrld+kA1OucyjgmZU7/+Cs9shpAEOaIVYmGlpDGRucAHpwtckvdgRTtnA3WNZ/Qg1vU6Ik4Xm03vjrW6lSiuTffYO1kbdcMQ4IZBlzfmovOtXQ0PomvN5NMCpgOyQuoNlvyS11tOXoqNiWOkiLE15XEzAQth9hHbNiH8jHJbAtkHqWWh0KK4IUyNGvoL6QfNxsTlw== harisekhon@github/3807063 # ssh-import-id gh:harisekhon'
- 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDQe6MuFOGBezYp/PoAr0x4ptWVFlkYyE6VVooEQ1DpQ5tcOcrsFIX/qW7nnZkOUsjxpXSN90sNrP7uOUa0IaU5MxDE0mMr+13HXUUmloA5HbIdbRi2wGTGaXE/uVXBEZKeD6+LD1AHM8dgEOgWF/j+XUQ0zcarg6Q45bE54my+9pWwQzciVa8LVdRYK+Rct5YR6Vo2cbjYAZ44G4d0Fq/k6nYwd0UhQfYcXP7R+bPBiiXDrECK/xn/OauYVY2QunfcfKyVBAWgpTkCDi+Nw6GFvgHwTd7WJ/IqZy9Lqyz2ymqn2yRyiHiKlH65+5RuP+9otpx9YshuBUyRrF4NGhNfm9LQ9vbckpk67h7I8w4nkh6w77N6wg+dlDDv42H6dPpX0IrSLmEsxeCWp5W+C4rHSlw62Yhsw2nO2bw251Qyb/UwGTk87pxg9jLjlp5YL0bcwONYX0ZSUPNoId4z1FNKcOmo1B5oRmwyQq2ua9hvieMhivQpqHa7IxB8MPOOtY8= harisekhon@github/76141680 # ssh-import-id gh:harisekhon'
install-server: true
storage:
#swap:
# size: 0
layout:
name: lvm
match:
size: largest
timezone: UTC
updates: security
#user-data:
# disable_root: true
# timezone: UTC
# package_upgrade: true
#users:
# - default
# - name: devops
# passwd: '...' # put hash here
# shell: /bin/bash
# lock-passwd: false
# ssh_pwauth: True
# chpasswd: { expire: False }
# sudo: ALL=(ALL) NOPASSWD:ALL
# groups: users, dialout, sudo, wheel
# ssh_authorized_keys:
# - ssh-rsa ...
version: 1