Skip to content

Commit 1ac336a

Browse files
author
Mafyuh
committedSep 15, 2024
Merge branch 'main' of https://git.mafyuh.dev/mafyuh/iac
2 parents 88b8cb4 + 6af7d30 commit 1ac336a

File tree

9 files changed

+205
-11
lines changed

9 files changed

+205
-11
lines changed
 

‎docker/ag-main/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ services:
2222
- 5443:5443/udp
2323

2424
adguardhome-sync:
25-
image: ghcr.io/linuxserver/adguardhome-sync@sha256:9469d0e6b3a09ed88a9c3c522de6c905d1aeff673e490e1c9b26e4f76caa0f4c
25+
image: ghcr.io/linuxserver/adguardhome-sync@sha256:46a8549d84a56bc8f81f69b38ce1f39d60da4fbcac8b582e3981da39d097bc40
2626
container_name: adguardhome-sync
2727
environment:
2828
- PUID=1000

‎docker/arm/docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ services:
109109
networks:
110110
- gitea_main
111111
n8n:
112-
image: ghcr.io/n8n-io/n8n:1.58.1
112+
image: ghcr.io/n8n-io/n8n:1.59.0
113113
container_name: n8n
114114
ports:
115115
- 5678:5678
@@ -139,7 +139,7 @@ services:
139139
ipv4_address: 172.25.0.25
140140

141141
syncthing:
142-
image: ghcr.io/linuxserver/syncthing@sha256:2339cd2967d886ef16d9ba3c332060330915b53111aa022eba7313a1136f0a4a
142+
image: ghcr.io/linuxserver/syncthing@sha256:cd9ec0abcab9eb51a5f1d2fd19cad2d5e84e479e6589d809121614080b37c4f2
143143
container_name: syncthing
144144
hostname: ARM #optional
145145
environment:

‎docker/arrs/docker-compose.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
- PGID=1000
1616

1717
lidarr:
18-
image: ghcr.io/linuxserver/lidarr@sha256:a77af413426b8509fad2d02f5b89104a5766ee6ebb13497d73993e74f6cfa0a8
18+
image: ghcr.io/linuxserver/lidarr@sha256:1a543b03bbb76a6683bbbe77e4366917f0e7eae67f2e5e6c005dd40344ec7008
1919
container_name: lidarr
2020
ports:
2121
- "8686:8686"
@@ -31,7 +31,7 @@ services:
3131
- PGID=1000
3232

3333
prowlarr:
34-
image: ghcr.io/linuxserver/prowlarr@sha256:9dd32e2270d174b07bd33a1f54e2b79e03ad944df62ed93efa08f4a381adc9a1
34+
image: ghcr.io/linuxserver/prowlarr@sha256:c1318191d5211ac7462c754422eafe350ed0de61c4160065a420896068ec1ccc
3535
container_name: prowlarr
3636
ports:
3737
- "9696:9696"
@@ -57,7 +57,7 @@ services:
5757
- PGID=1000
5858

5959
sonarr:
60-
image: ghcr.io/linuxserver/sonarr@sha256:138998077a802c18b76c26636301fcd5517b7bfaf75db025d457199176078a12
60+
image: ghcr.io/linuxserver/sonarr@sha256:28cc44346fc87805b52a4376a89edc12cf082a5530cffee800a6c05dee482734
6161
container_name: sonarr
6262
ports:
6363
- "8989:8989"
@@ -130,7 +130,7 @@ services:
130130
restart: unless-stopped
131131

132132
pinchflat:
133-
image: ghcr.io/kieraneglin/pinchflat@sha256:16dca569fa5f890f60d3b04f0cd25d2af7ccd960ad635ae8ba1e514619df189f
133+
image: ghcr.io/kieraneglin/pinchflat@sha256:2642214c8e04c5092f4c983ac7fe7804e1acadd5a9677d5101d0bb49c4185f14
134134
environment:
135135
- TZ=America/New_York
136136
ports:
@@ -140,7 +140,7 @@ services:
140140
- /data/media/Youtube/downloads:/downloads
141141

142142
syncthing:
143-
image: ghcr.io/linuxserver/syncthing@sha256:2339cd2967d886ef16d9ba3c332060330915b53111aa022eba7313a1136f0a4a
143+
image: ghcr.io/linuxserver/syncthing@sha256:cd9ec0abcab9eb51a5f1d2fd19cad2d5e84e479e6589d809121614080b37c4f2
144144
container_name: syncthing
145145
hostname: ARRS
146146
environment:

‎docker/downloaders/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.9'
22
services:
33
sabnzbd:
4-
image: ghcr.io/linuxserver/sabnzbd@sha256:66576a72ecb80c8d9e8ebffd4699995b29bfff4aefba4c6eae14baac3cbf6716
4+
image: ghcr.io/linuxserver/sabnzbd@sha256:cf7743af338e1cdfc97f6e6c605c8c45d737a4f268ab96ba6cec565134cea5e1
55
container_name: sabnzbd
66
environment:
77
- PUID=1000

‎docker/jellyfin/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ services:
3737
privileged: true
3838

3939
syncthing:
40-
image: ghcr.io/linuxserver/syncthing@sha256:2339cd2967d886ef16d9ba3c332060330915b53111aa022eba7313a1136f0a4a
40+
image: ghcr.io/linuxserver/syncthing@sha256:cd9ec0abcab9eb51a5f1d2fd19cad2d5e84e479e6589d809121614080b37c4f2
4141
container_name: syncthing
4242
hostname: JF
4343
environment:

‎docker/netboot/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
services:
33
netbootxyz:
4-
image: ghcr.io/linuxserver/netbootxyz@sha256:18f5faec9e1f4362e6d1d1e7cbde3a2c8d6733dc7c00a9958b3aa88d28e8eb4b
4+
image: ghcr.io/linuxserver/netbootxyz@sha256:16fdc41c85cd9fd3057868e539b9300aaf95f9fc29be1b13bf78334802e0b10f
55
container_name: netboot
66
environment:
77
- PUID=1000
+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
packer {
2+
required_plugins {
3+
name = {
4+
version = "~> 1"
5+
source = "github.com/hashicorp/proxmox"
6+
}
7+
}
8+
}
9+
10+
variable "proxmox_api_url" {
11+
type = string
12+
}
13+
14+
variable "proxmox_api_token_id" {
15+
type = string
16+
}
17+
18+
variable "proxmox_api_token_secret" {
19+
type = string
20+
sensitive = true
21+
}
22+
23+
# Resource Definiation for the VM Template
24+
source "proxmox-clone" "ubuntu-server-jammy2" {
25+
26+
# Proxmox Connection Settings
27+
proxmox_url = "${var.proxmox_api_url}"
28+
username = "${var.proxmox_api_token_id}"
29+
token = "${var.proxmox_api_token_secret}"
30+
insecure_skip_tls_verify = true
31+
32+
# VM General Settings
33+
node = "prox"
34+
35+
clone_vm_id = "8100"
36+
37+
vm_id = "9998"
38+
vm_name = "ubuntu-server-jammy2"
39+
template_description = "Custom Ubuntu Server see https://git.mafyuh.dev/mafyuh/iac/src/branch/main/packer/ubuntu-jammy/ubuntu-jammy2.pkr.hcl"
40+
41+
# VM System Settings
42+
qemu_agent = true
43+
44+
# VM Hard Disk Settings
45+
scsi_controller = "virtio-scsi-pci"
46+
47+
disks {
48+
disk_size = "4G"
49+
format = "raw"
50+
storage_pool = "Fast2Tb"
51+
type = "virtio"
52+
}
53+
54+
# VM CPU Settings
55+
cores = "2"
56+
cpu_type = "x86-64-v2-AES"
57+
58+
# VM Memory Settings
59+
memory = "2048"
60+
61+
# VM Network Settings
62+
network_adapters {
63+
model = "virtio"
64+
bridge = "vmbr0"
65+
firewall = "false"
66+
}
67+
68+
69+
ssh_username = "mafyuh"
70+
# WSL Filesystem
71+
ssh_private_key_file = "~/.ssh/id_rsa"
72+
}
73+
74+
75+
build {
76+
77+
name = "ubuntu-server-jammy2"
78+
sources = ["source.proxmox-clone.ubuntu-server-jammy2"]
79+
80+
## Cleanup for re-template
81+
provisioner "shell" {
82+
inline = [
83+
"while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done",
84+
"sudo rm /etc/ssh/ssh_host_*",
85+
"sudo truncate -s 0 /etc/machine-id",
86+
"sudo apt -y autoremove --purge",
87+
"sudo apt -y clean",
88+
"sudo apt -y autoclean",
89+
"sudo cloud-init clean",
90+
"sudo rm -f /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg",
91+
"sudo rm -f /etc/netplan/00-installer-config.yaml",
92+
"sudo sync"
93+
]
94+
}
95+
96+
97+
provisioner "file" {
98+
source = "files/pve.cfg"
99+
destination = "/tmp/pve.cfg"
100+
}
101+
102+
103+
provisioner "shell" {
104+
inline = [ "sudo cp /tmp/pve.cfg /etc/cloud/cloud.cfg.d/pve.cfg" ]
105+
}
106+
107+
# Install Commonly Used Things - add alias's - set git config
108+
provisioner "shell" {
109+
inline = [
110+
"sudo apt-get install -y ca-certificates curl gnupg lsb-release nfs-common qemu-guest-agent net-tools",
111+
"curl -fsSL https://get.docker.com | sudo sh",
112+
"echo \"alias dcu='docker compose up -d'\" >> ~/.bashrc",
113+
"echo \"alias dcd='docker compose down'\" >> ~/.bashrc",
114+
"git config --global user.name \"Mafyuh\"",
115+
"git config --global user.email \"matt@mafyuh.com\"",
116+
"sudo apt-get -y update"
117+
]
118+
}
119+
}

‎terraform/ubu.tf

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
resource "proxmox_virtual_environment_vm" "Ubu" {
2+
3+
# VM General Settings
4+
node_name = "prox"
5+
vm_id = 5000
6+
name = "Ubu"
7+
description = "My attempt to move things to 1 VM"
8+
tags = ["tofu", "ubuntu-22", "auto-homelab-repo", "infrastructure"]
9+
10+
agent {
11+
enabled = true # read 'Qemu guest agent' section, change to true only when ready
12+
}
13+
14+
clone {
15+
vm_id = 9998
16+
}
17+
18+
# VM CPU Settings
19+
cpu {
20+
cores = 2
21+
type = "host"
22+
architecture = "x86_64"
23+
}
24+
25+
# VM Memory Settings
26+
memory {
27+
dedicated = 6144
28+
}
29+
30+
# VM Network Settings
31+
network_device {
32+
bridge = "vmbr0"
33+
vlan_id = 1
34+
}
35+
36+
# VM Disk Settings
37+
disk {
38+
datastore_id = "Fast2Tb"
39+
size = 120
40+
interface = "scsi0"
41+
}
42+
43+
vga {
44+
type = "serial0"
45+
}
46+
47+
initialization {
48+
ip_config {
49+
ipv4 {
50+
address = var.ubu_ip_address
51+
gateway = var.vlan_gateway
52+
}
53+
}
54+
55+
user_data_file_id = proxmox_virtual_environment_file.cloud_config.id
56+
}
57+
58+
lifecycle {
59+
ignore_changes = [
60+
initialization[0].user_account[0].keys,
61+
initialization[0].user_account[0].password,
62+
initialization[0].user_account[0].username,
63+
initialization[0].user_data_file_id
64+
]
65+
}
66+
67+
}
68+
69+
output "vm_ipv4_address" {
70+
value = proxmox_virtual_environment_vm.Ubu.ipv4_addresses[1][0]
71+
}

‎terraform/vars.tf

+4
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,8 @@ variable "kasm_ip" {
5252

5353
variable "kasm_ssh_ip" {
5454
type = string
55+
}
56+
57+
variable "ubu_ip_address" {
58+
type = string
5559
}

0 commit comments

Comments
 (0)
Please sign in to comment.