Add Terraform with Equinix Metal:
This gets the Tinkerbell Sandbox up and running with Terraform on Equinix Metal. Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
This commit is contained in:
		| @@ -0,0 +1,32 @@ | ||||
| { | ||||
|   "id": "0eba0bf8-3772-4b4a-ab9f-6ebe93b90a94", | ||||
|   "metadata": { | ||||
|     "facility": { | ||||
|       "facility_code": "onprem", | ||||
|       "plan_slug": "c2.medium.x86", | ||||
|       "plan_version_slug": "" | ||||
|     }, | ||||
|     "instance": {}, | ||||
|     "state": "provisioning" | ||||
|   }, | ||||
|   "network": { | ||||
|     "interfaces": [ | ||||
|       { | ||||
|         "dhcp": { | ||||
|           "arch": "x86_64", | ||||
|           "ip": { | ||||
|             "address": "192.168.50.43", | ||||
|             "gateway": "192.168.50.4", | ||||
|             "netmask": "255.255.255.0" | ||||
|           }, | ||||
|           "mac": "08:00:27:9e:f5:3a", | ||||
|           "uefi": false | ||||
|         }, | ||||
|         "netboot": { | ||||
|           "allow_pxe": true, | ||||
|           "allow_workflow": true | ||||
|         } | ||||
|       } | ||||
|     ] | ||||
|   } | ||||
| } | ||||
							
								
								
									
										91
									
								
								deploy/compose/manifests/template/ubuntu-equinix-metal.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										91
									
								
								deploy/compose/manifests/template/ubuntu-equinix-metal.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,91 @@ | ||||
| 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: "grow-partition" | ||||
|         image: cexec:v1.0.0 | ||||
|         timeout: 90 | ||||
|         environment: | ||||
|           BLOCK_DEVICE: /dev/sda1 | ||||
|           FS_TYPE: ext4 | ||||
|           CHROOT: y | ||||
|           DEFAULT_INTERPRETER: "/bin/sh -c" | ||||
|           CMD_LINE: "growpart /dev/sda 1 && resize2fs /dev/sda1" | ||||
|       - name: "fix-serial" | ||||
|         image: cexec:v1.0.0 | ||||
|         timeout: 90 | ||||
|         pid: host | ||||
|         environment: | ||||
|           BLOCK_DEVICE: /dev/sda1 | ||||
|           FS_TYPE: ext4 | ||||
|           CHROOT: y | ||||
|           DEFAULT_INTERPRETER: "/bin/sh -c" | ||||
|           CMD_LINE: "sed -e 's|ttyS0|ttyS1,115200|g' -i /etc/default/grub.d/50-cloudimg-settings.cfg ; update-grub" | ||||
|       - 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: | ||||
|                     enp1s0f0: | ||||
|                         dhcp4: true | ||||
|           UID: 0 | ||||
|           GID: 0 | ||||
|           MODE: 0644 | ||||
|           DIRMODE: 0755 | ||||
		Reference in New Issue
	
	Block a user
	 Jacob Weinstock
					Jacob Weinstock