-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscrap-metal-auto-install.yaml
117 lines (117 loc) · 3.98 KB
/
scrap-metal-auto-install.yaml
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
#cloud-config
# - Required Extra Vars:
# $INTERFACE
# $IP_ADDRESS
# $GATEWAY_IP
# $DNS_SERVER_IP
# $ROOT_USER
autoinstall:
version: 1
update: yes
keyboard: {layout: us, toggle: null, variant: ''}
locale: en_US.UTF-8
network:
bridges:
br0:
dhcp4: no
dhcp6: no
interfaces: [${INTERFACE}]
addresses: [${IP_ADDRESS}/24]
routes:
- to: default
via: ${GATEWAY_IP}
mtu: 1500
nameservers:
addresses: [${DNS_SERVER_IP}]
parameters:
stp: true
forward-delay: 4
ethernets:
${INTERFACE}:
dhcp4: no
dhcp6: no
renderer: networkd
version: 2
storage:
layout:
name: direct
match:
ssd: yes
size: smallest
identity:
hostname: ${VM_NAME}
password: ${PASSWD}
username: ${ROOT_USER}
ssh:
allow-pw: true
install-server: true
authorized-keys: ['${VM_KEY}']
packages:
- software-properties-common
- ca-certificates
- curl
- wget
- git
user-data: # Cloud-init starts here after reboot
disable_root: false
users:
- name: ${USER}
groups: users, admin, docker, sudo
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
lock_passwd: false
passwd: ${PASSWD}
ssh_import_id:
- gh:${GITHUB_USER}
- name: ${VM_ADMIN}
gecos: system acct
groups: users, admin, docker, sudo
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
lock_passwd: false
ssh_authorized_keys:
- ${VM_KEY}
apt:
primary:
- arches: [default]
uri: http://us.archive.ubuntu.com/ubuntu/
sources:
kubectl.list:
source: deb [arch=amd64] https://apt.kubernetes.io/ kubernetes-xenial main
keyid: 59FE0256827269DC81578F928B57C5C2836F4BEB
helm.list:
source: deb https://baltocdn.com/helm/stable/debian/ all main
keyid: 81BF832E2F19CD2AA0471959294AC4827C1A168A
package_update: ${UPDATE}
package_upgrade: ${UPGRADE}
packages:
- kubectl
- wget
- helm
- htop
- docker.io
- build-essential
- python3-pip
- procps
- file
- whois
runcmd:
- mkdir -p /new_kernel
- wget -O /new_kernel/linux-headers-5.19.0-051900-generic_5.19.0-051900.202207312230_amd64.deb https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.19/amd64/linux-headers-5.19.0-051900-generic_5.19.0-051900.202207312230_amd64.deb
- wget -O /new_kernel/linux-headers-5.19.0-051900_5.19.0-051900.202207312230_all.deb https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.19/amd64/linux-headers-5.19.0-051900_5.19.0-051900.202207312230_all.deb
- wget -O /new_kernel/linux-image-unsigned-5.19.0-051900-generic_5.19.0-051900.202207312230_amd64.deb https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.19/amd64/linux-image-unsigned-5.19.0-051900-generic_5.19.0-051900.202207312230_amd64.deb
- wget -O /new_kernel/linux-modules-5.19.0-051900-generic_5.19.0-051900.202207312230_amd64.deb https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.19/amd64/linux-modules-5.19.0-051900-generic_5.19.0-051900.202207312230_amd64.deb
- dpkg -i /new_kernel/*
- wget https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
- chmod +x /install.sh
- chmod 777 /install.sh
- sudo -u ${USER} NONINTERACTIVE=1 /bin/bash /install.sh
- sudo -u ${USER} /home/linuxbrew/.linuxbrew/bin/brew shellenv >> /home/${USER}/.profile
- export GRUB_CMDLINE_LINUX_DEFAULT="GRUB_CMDLINE_LINUX_DEFAULT=\"preempt=voluntary iommu=pt amd_iommu=on intel_iommu=on\""
- sed -i "s/GRUB_CMDLINE_LINUX_DEFAULT=\"\"/$GRUB_CMDLINE_LINUX_DEFAULT/g" /etc/default/grub
- sed -i "s/GRUB_DEFAULT=0/GRUB_DEFAULT=saved/g" /etc/default/grub
- sed -i "s/FONTSIZE=\"8x16\"/FONTSIZE=\"16x32\"/g" /etc/default/console-setup
- grub-reboot 1
- update-grub
- update-initramfs -k all -u
- reboot now