Skip to content

Commit

Permalink
Create template.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsn0w authored Sep 28, 2024
1 parent b913f9e commit 348c01a
Showing 1 changed file with 102 additions and 0 deletions.
102 changes: 102 additions & 0 deletions template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
apiVersion: tinkerbell.org/v1alpha1
kind: Template
metadata:
name: ubuntu
namespace: tink-system
spec:
data: |
version: "0.1"
name: ubuntu
global_timeout: 1800
tasks:
- name: "OS Installation"
worker: "{{.device_1}}"
volumes:
- /dev:/dev
- /dev/console:/dev/console
- /lib/firmware:/lib/firmware
actions:
- name: "Stream Ubuntu image with actions/image2disk"
image: quay.io/tinkerbell/actions/image2disk:latest
timeout: 600
environment:
DEST_DISK: {{ index .Hardware.Disks 0}}
IMG_URL: "http://192.168.1.250:8080/jammy-server-cloudimg-amd64.raw.gz"
COMPRESSED: true
- name: "Grow-partition"
image: quay.io/tinkerbell/actions/cexec:latest
timeout: 90
environment:
BLOCK_DEVICE: {{ index .Hardware.Disks 0 }}
FS_TYPE: ext4
CHROOT: y
DEFAULT_INTERPRETER: "/bin/sh -c"
CMD_LINE: "growpart {{ index .Hardware.Disks 0 }} 1 && resize2fs {{ index .Hardware.Disks 0 }}1"
- name: "install openssl"
image: quay.io/tinkerbell/actions/cexec:latest
timeout: 90
environment:
BLOCK_DEVICE: {{ index .Hardware.Disks 0 }}1
FS_TYPE: ext4
CHROOT: y
DEFAULT_INTERPRETER: "/bin/sh -c"
CMD_LINE: "apt -y update && apt -y install openssl"
- name: "create tink user and tink password"
image: quay.io/tinkerbell/actions/cexec:latest
timeout: 90
environment:
BLOCK_DEVICE: {{ index .Hardware.Disks 0 }}1
FS_TYPE: ext4
CHROOT: y
DEFAULT_INTERPRETER: "/bin/sh -c"
CMD_LINE: "useradd -p $(openssl passwd -1 tink) -s /bin/bash -d /home/tink/ -m -G sudo tink"
- name: "enable ssh"
image: quay.io/tinkerbell/actions/cexec:latest
timeout: 90
environment:
BLOCK_DEVICE: {{ index .Hardware.Disks 0 }}1
FS_TYPE: ext4
CHROOT: y
DEFAULT_INTERPRETER: "/bin/sh -c"
CMD_LINE: "ssh-keygen -A; systemctl enable ssh.service; echo 'PasswordAuthentication yes' > /etc/ssh/sshd_config.d/60-cloudimg-settings.conf"
- name: "disable apparmor"
image: quay.io/tinkerbell/actions/cexec:latest
timeout: 90
environment:
BLOCK_DEVICE: {{ index .Hardware.Disks 0 }}1
FS_TYPE: ext4
CHROOT: y
DEFAULT_INTERPRETER: "/bin/sh -c"
CMD_LINE: "systemctl disable apparmor; systemctl disable snapd"
- name: "write netplan"
image: quay.io/tinkerbell/actions/writefile:latest
timeout: 90
environment:
DEST_DISK: {{ index .Hardware.Disks 0 }}1
FS_TYPE: ext4
DEST_PATH: /etc/netplan/config.yaml
CONTENTS: |
network:
version: 2
renderer: networkd
ethernets:
id0:
match:
name: en*
dhcp4: true
UID: 0
GID: 0
MODE: 0644
DIRMODE: 0755
- name: "kexec into os"
image: ghcr.io/jacobweinstock/waitdaemon:latest
timeout: 90
pid: host
environment:
BLOCK_DEVICE: {{ formatPartition ( index .Hardware.Disks 0 ) 1 }}
FS_TYPE: ext4
IMAGE: quay.io/tinkerbell/actions/kexec:latest
WAIT_SECONDS: 10
volumes:
- /var/run/docker.sock:/var/run/docker.sock

0 comments on commit 348c01a

Please sign in to comment.