-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
102 lines (102 loc) · 3.78 KB
/
template.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
---
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