Skip to content

Commit

Permalink
iAdd extremeEDGE autoinstall
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorific committed Dec 2, 2024
1 parent c0433c5 commit 31f08ae
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
```
curl -LO https://releases.ubuntu.com/22.04.5/ubuntu-22.04.5-live-server-amd64.iso
docker pull docker.io/polymathrobotics/ubuntu-autoinstall
docker run -it --rm \
--mount type=bind,source="$(pwd)",target=/data \
docker.io/polymathrobotics/ubuntu-autoinstall \
-a autoinstall.yaml \
-g grub.cfg \
-i \
-s ubuntu-22.04.5-live-server-amd64.iso \
-d ubuntu-autoinstall.iso
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#cloud-config
autoinstall:
version: 1
network:
network:
version: 2
ethernets:
enp5s0f2: {}
enp5s0f3: {}
enp1s0:
dhcp4: true
enp2s0: {}
bridges:
br0:
dhcp4: true
interfaces:
- enp1s0
storage:
layout:
name: lvm
sizing-policy: all
packages:
# Prerequisites for chef bootstrap
- bzip2
- ca-certificates
- curl
- file
- jq
- lsb
- unzip
ssh:
install-server: true
allow-pw: true
late-commands:
- curtin in-target -- sed -ie 's/GRUB_TIMEOUT=.*/GRUB_TIMEOUT=30/' /etc/default/grub
- curtin in-target -- sed -ie 's/GRUB_TIMEOUT_STYLE=.*/GRUB_TIMEOUT=countdown/' /etc/default/grub
- curtin in-target -- sed -ie 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX="console=tty1 console=ttyS4,115200n8 systemd.wants=serial-getty@ttyS4"/' /etc/default/grub
- curtin in-target -- sed -ie 's/#GRUB_TERMINAL=.*/GRUB_TERMINAL="console"/' /etc/default/grub
- curtin in-target -- update-grub
user-data: # cloud-init starts here
hostname: robot00
users:
- name: automat
uid: 63112
primary_group: users
groups: users
shell: /bin/bash
plain_text_passwd: polymath2023
sudo: ALL=(ALL) NOPASSWD:ALL
lock_passwd: false
ssh_authorized_keys:
# ilia
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDVdLlEOOn1psgeq0b2nm/kfTFOWz+O6mzf2/QmJ1tonCrYcg/fWndpXXaCsu/iH0it2k9F8tYe8H1UjTd9J8yLZ145MJkXinIphmUEW1ccG/LlC+AZHTPpelr/CK8ZrVh5u78jeuJjlN317OuW5OyAjWN+blt/P0dYI1uAsUEJUslxk7ldoKA3ppc8zERRU6+778EApIfV+KO4vyrYILMKhYTV1wEds1f27xcZwyXvTrqSgDERyBBVPSPKMqGcrxoobcAGyMMuChKEYu/i4k0tESZgC5+dolpXHhB+0UTgp0dTAomKmbLd7aMpDKO3t7cPguCUEcjbM9ovaDTcbVy3k0JGC+b6jxinziEv8K4RvNrF4w3jGT5eorD32cJDzvqsE/rtjjgLyk7vMxX6QYLugYOiC3hTnvGlRJQ65E8ZvX5fBUap96bAooNuvRy68wxsK8zS5CHwDBRAtWdY6XiRo5GnFfOWhSZHnjqjkZiMpuR66Byr0xHu0VOi5lQbPR0= iliabara@Metis
# taylor
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEV40AiHWQUCXY7Yh3s5Vj/ZtRc1BWex6D2+eoEnRXM7 mahowald
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINy9cJcJl8oN6bRtcBc4RZq8f/T6P1AFR3YS1YRYi5YY sheila
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHGTw44QBehDXY6ebitrYydyAAhDFLBSkQ59RovcVsvX joan
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMWwrOVfOWfax6HR4Y+Mg01jT9No2zXHqkATnqwHuFKU emily
chpasswd: {expire: false}
ssh_pwauth: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1
terminal_input console serial
terminal_output console serial

set timeout=30
set default=0

set gfxpayload=text

menuentry "Ubuntu Server Autoinstall" {
set gfxpayload=text
linux /casper/vmlinuz console=tty1 console=ttyS4,115200n8 systemd.wants=serial-getty@ttyS4 autoinstall ds=nocloud\;s=/cdrom/nocloud/ ---
initrd /casper/initrd
}
menuentry "Ubuntu Server with the HWE kernel" {
set gfxpayload=text
linux /casper/hwe-vmlinuz autoinstall ds=nocloud\;s=/cdrom/nocloud/ ---
initrd /casper/hwe-initrd
}
grub_platform
if [ "$grub_platform" = "efi" ]; then
menuentry 'Boot from next volume' {
exit 1
}
menuentry 'UEFI Firmware Settings' {
fwsetup
}
else
menuentry 'Test memory' {
linux16 /boot/memtest86+.bin
}
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
describe user('automat') do
it { should exist }
its('uid') { should eq 63112 }
it { should belong_to_primary_group 'users' }
end

describe file('/etc/default/grub') do
it { should exist }
its('content') { should match /^GRUB_TIMEOUT=countdown$/ }
its('content') { should match /^GRUB_TIMEOUT=30$/ }
its('content') { should match /^GRUB_TERMINAL="console"$/ }
its('content') { should match /^GRUB_CMDLINE_LINUX="console=tty1 console=ttyS4,115200n8 systemd\.wants=serial-getty@ttyS4"$/ }
end

0 comments on commit 31f08ae

Please sign in to comment.