This simplifies the stand-up of a sandbox:
Only 2 main Vagrant calls are now needed (`vagrant up` and `vagrant up machine1`). This PR only updates the Vagrant Virtualbox setup. The Vagrant Libvirt and Terraform still need to be updated. This uses docker-compose as the entry point for standing up the stack and makes the stand-up of the sandbox more portal. Vagrant and Terraform are only responsible for standing up infrastructure and then running docker-compose, not for running any glue scripts. The docker-compose calls out to single-shot services to do all the glue required to get the fully functional Tinkerbell stack up and running. All the single-shot services are idempotent. This increases portability and the development iteration loop. This also simplifies the required steps needed to get a fully functioning sandbox up and running. This is intended to help people looking to get started by getting them to a provisioned machine quicker and more easily. Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
This commit is contained in:
76
deploy/compose/manifests/template/ubuntu.yaml
Normal file
76
deploy/compose/manifests/template/ubuntu.yaml
Normal file
@ -0,0 +1,76 @@
|
||||
version: "0.1"
|
||||
name: debian_Focal
|
||||
global_timeout: 1800
|
||||
tasks:
|
||||
- name: "os-installation"
|
||||
worker: "{{.device_1}}"
|
||||
volumes:
|
||||
- /dev:/dev
|
||||
- /dev/console:/dev/console
|
||||
- /lib/firmware:/lib/firmware:ro
|
||||
actions:
|
||||
- name: "stream-ubuntu-image"
|
||||
image: image2disk:v1.0.0
|
||||
timeout: 600
|
||||
environment:
|
||||
DEST_DISK: /dev/sda
|
||||
IMG_URL: "http://192.168.50.4:8080/focal-server-cloudimg-amd64.raw.gz"
|
||||
COMPRESSED: true
|
||||
- name: "install-openssl"
|
||||
image: cexec:v1.0.0
|
||||
timeout: 90
|
||||
environment:
|
||||
BLOCK_DEVICE: /dev/sda1
|
||||
FS_TYPE: ext4
|
||||
CHROOT: y
|
||||
DEFAULT_INTERPRETER: "/bin/sh -c"
|
||||
CMD_LINE: "apt -y update && apt -y install openssl"
|
||||
- name: "create-user"
|
||||
image: cexec:v1.0.0
|
||||
timeout: 90
|
||||
environment:
|
||||
BLOCK_DEVICE: /dev/sda1
|
||||
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: cexec:v1.0.0
|
||||
timeout: 90
|
||||
environment:
|
||||
BLOCK_DEVICE: /dev/sda1
|
||||
FS_TYPE: ext4
|
||||
CHROOT: y
|
||||
DEFAULT_INTERPRETER: "/bin/sh -c"
|
||||
CMD_LINE: "ssh-keygen -A; systemctl enable ssh.service; sed -i 's/^PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config"
|
||||
- name: "disable-apparmor"
|
||||
image: cexec:v1.0.0
|
||||
timeout: 90
|
||||
environment:
|
||||
BLOCK_DEVICE: /dev/sda1
|
||||
FS_TYPE: ext4
|
||||
CHROOT: y
|
||||
DEFAULT_INTERPRETER: "/bin/sh -c"
|
||||
CMD_LINE: "systemctl disable apparmor; systemctl disable snapd"
|
||||
- name: "write-netplan"
|
||||
image: writefile:v1.0.0
|
||||
timeout: 90
|
||||
environment:
|
||||
DEST_DISK: /dev/sda1
|
||||
FS_TYPE: ext4
|
||||
DEST_PATH: /etc/netplan/config.yaml
|
||||
CONTENTS: |
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
enp0s3:
|
||||
dhcp4: true
|
||||
enp0s8:
|
||||
dhcp4: true
|
||||
ens33:
|
||||
dhcp4: true
|
||||
UID: 0
|
||||
GID: 0
|
||||
MODE: 0644
|
||||
DIRMODE: 0755
|
Reference in New Issue
Block a user