reformat project; start vm provisioning
This commit is contained in:
parent
b6a2668e33
commit
537beb7f67
49
.gitignore
vendored
Normal file
49
.gitignore
vendored
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
## TERRAFORM
|
||||||
|
|
||||||
|
# Compiled files
|
||||||
|
*.tfstate
|
||||||
|
*.tfstate.backup
|
||||||
|
*.tfstate.lock.info
|
||||||
|
|
||||||
|
# logs
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Directories
|
||||||
|
.terraform/
|
||||||
|
.vagrant/
|
||||||
|
|
||||||
|
# SSH Keys
|
||||||
|
*.pem
|
||||||
|
|
||||||
|
# Backup files
|
||||||
|
*.bak
|
||||||
|
|
||||||
|
# Ignored Terraform files
|
||||||
|
*gitignore*.tf
|
||||||
|
|
||||||
|
# Ignore Mac .DS_Store files
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# Ignored vscode files
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
# Ignore Any Generated JSON Files
|
||||||
|
operations/automation-script/apply.json
|
||||||
|
operations/automation-script/configversion.json
|
||||||
|
operations/automation-script/run.template.json
|
||||||
|
operations/automation-script/run.json
|
||||||
|
operations/automation-script/variable.template.json
|
||||||
|
operations/automation-script/variable.json
|
||||||
|
operations/automation-script/workspace.template.json
|
||||||
|
operations/automation-script/workspace.json
|
||||||
|
operations/sentinel-policies-scripts/create-policy.template.json
|
||||||
|
operations/sentinel-policies-scripts/create-policy.json
|
||||||
|
operations/variable-scripts/variable.template.json
|
||||||
|
operations/variable-scripts/variable.json
|
||||||
|
|
||||||
|
# Sentinel runtime directory
|
||||||
|
.sentinel
|
||||||
|
|
||||||
|
|
||||||
|
### ANSIBLE
|
||||||
|
*.retry
|
@ -72,4 +72,9 @@ Production (Docker) - Important Services
|
|||||||
* Nginx Proxy Manager
|
* Nginx Proxy Manager
|
||||||
* Uptime Kuma
|
* Uptime Kuma
|
||||||
|
|
||||||
|
## Storage
|
||||||
|
NAS (TrueNAS Scale)
|
||||||
|
* No Major Requirements
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Deploy Plex
|
|
||||||
community.docker.docker_container:
|
|
||||||
- name: plex
|
|
||||||
- image: lscr.io/linuxserver/plex
|
|
||||||
- restart_policy: unless-stopped
|
|
||||||
- volumes:
|
|
||||||
- "{{ CONFIG_FOLDER }}/plex/config:/config"
|
|
||||||
- "{{ MEDIA_FOLDER }}:/content"
|
|
||||||
|
|
8
applications/group_vars/all
Normal file
8
applications/group_vars/all
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
MEDIA_FOLDER: /mnt/media
|
||||||
|
CONFIG_FOLDER: /mnt/apps
|
||||||
|
DOWNLOADS_FOLDER: /mnt/media/downloads
|
||||||
|
|
||||||
|
TZ: America/New_York
|
||||||
|
PUID: 1000
|
||||||
|
PGID: 1000
|
@ -3,6 +3,8 @@
|
|||||||
- name: Create media network
|
- name: Create media network
|
||||||
community.docker.docker_network:
|
community.docker.docker_network:
|
||||||
name: media
|
name: media
|
||||||
|
ipam_config:
|
||||||
|
subnet: 172.23.27.0/24
|
||||||
|
|
||||||
# Torrent Client
|
# Torrent Client
|
||||||
- name: Deploy Transmission
|
- name: Deploy Transmission
|
||||||
@ -170,7 +172,19 @@
|
|||||||
ports:
|
ports:
|
||||||
- 5055:5055
|
- 5055:5055
|
||||||
|
|
||||||
|
- name: Deploy Requestrr
|
||||||
|
community.docker.docker_container:
|
||||||
|
name: requestrr
|
||||||
|
image: lscr.io/linuxserver/requestrr
|
||||||
|
restart_policy: unless-stopped
|
||||||
|
env:
|
||||||
|
- "TZ={{ TZ }}"
|
||||||
|
- "PUID={{ PUID }}"
|
||||||
|
- "PGID={{ PGID }}"
|
||||||
|
volumes:
|
||||||
|
- "{{ CONFIG_FOLDER }}/requestrr/config:/config"
|
||||||
|
ports:
|
||||||
|
- 4545:4545
|
||||||
|
|
||||||
# - name: Deploy Doplarr
|
# - name: Deploy Doplarr
|
||||||
# community.docker.docker_container:
|
# community.docker.docker_container:
|
13
applications/roles/media/tasks/main.yml
Normal file
13
applications/roles/media/tasks/main.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
- name: Deploy Plex
|
||||||
|
community.docker.docker_container:
|
||||||
|
name: plex
|
||||||
|
image: lscr.io/linuxserver/plex
|
||||||
|
restart_policy: unless-stopped
|
||||||
|
env:
|
||||||
|
- "PUID={{ PUID }}"
|
||||||
|
- "PGID={{ PGID }}"
|
||||||
|
- "VERSION=docker"
|
||||||
|
volumes:
|
||||||
|
- "{{ CONFIG_FOLDER }}/plex/config:/config"
|
||||||
|
- "{{ MEDIA_FOLDER }}:/content"
|
23
machines/vms/.terraform.lock.hcl
generated
Normal file
23
machines/vms/.terraform.lock.hcl
generated
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# This file is maintained automatically by "terraform init".
|
||||||
|
# Manual edits may be lost in future updates.
|
||||||
|
|
||||||
|
provider "registry.terraform.io/telmate/proxmox" {
|
||||||
|
version = "2.9.10"
|
||||||
|
hashes = [
|
||||||
|
"h1:mKgUaboSiulLR8RAHHr7w/VapyEKyQFzj8G+LjOjaLs=",
|
||||||
|
"zh:34670f912770e5e5fa72478335c069f4a5f9c7371eca87224d4dfc4ae26eb4c9",
|
||||||
|
"zh:36885990c5c584a0c86b92e1a2a56b6d7b700d8a2e2b80ab149124c339141e69",
|
||||||
|
"zh:43d8768ebcd781bad9dfb79e8fe3bb604e6c03050b2c4c88feada623737afbd5",
|
||||||
|
"zh:772681e016d0dbc0fe84782597cf40b423327151817b03af3df1a4c3623eda33",
|
||||||
|
"zh:814278951363f708951f8d05957fbeb43b6a1835720e245279c088275ea29605",
|
||||||
|
"zh:82b5865838ffad92d493ab8058938273c13d0b70e8ddc219cd60d87ad0c5870b",
|
||||||
|
"zh:8d53b293a9026d4082cc40332f51543dd36b1b94b76ac59853fd9cbaadbe8886",
|
||||||
|
"zh:ba071e675a90b149a67b58fe9a5c345017bd42574dd317e8f1a4d78bc80c3bcc",
|
||||||
|
"zh:caaa65e27e01efcab65a17e52f3356cc7f1222bcaf8c76bf9cef388d3d167d94",
|
||||||
|
"zh:d61402a8a2dfe4137d5c6789d8a63a9eebacbd3e0a7a6e79ed6ef00761ced064",
|
||||||
|
"zh:da5ae531c69114ab860180222f7254c377181d5493507f4af117d022fdaed708",
|
||||||
|
"zh:e3faeec4d0f394a9d94dd915e1ace16e7eec4dd051d4671a73580407b4358ce6",
|
||||||
|
"zh:ff434dcbccf92759ac4c253f6187a24e6acbc572228284057c79daa52264e0df",
|
||||||
|
"zh:ff60423b80a445a18a608e7b0b886bdfcaf8b4065a56078c4d845904abf48303",
|
||||||
|
]
|
||||||
|
}
|
88
machines/vms/main.tf
Normal file
88
machines/vms/main.tf
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
terraform {
|
||||||
|
required_providers {
|
||||||
|
proxmox = {
|
||||||
|
source = "telmate/proxmox"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
provider "proxmox" {
|
||||||
|
pm_api_url = ""
|
||||||
|
pm_api_token_id = ""
|
||||||
|
pm_api_token_secret = ""
|
||||||
|
pm_tls_insecure = true
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "proxmox_vm_qemu" "media-server" {
|
||||||
|
count = 1
|
||||||
|
name = "plex"
|
||||||
|
vmid = "200"
|
||||||
|
target_node = "milkyway"
|
||||||
|
clone = "ubuntu-2004-cloud"
|
||||||
|
agent = 1
|
||||||
|
os_type = "cloud-init"
|
||||||
|
cores = 4
|
||||||
|
sockets = 1
|
||||||
|
cpu = "host"
|
||||||
|
memory = 4096
|
||||||
|
scsihw = "virtio-scsi-pci"
|
||||||
|
bootdisk = "scsi0"
|
||||||
|
disk {
|
||||||
|
slot = 0
|
||||||
|
size = "50G"
|
||||||
|
type = "scsi"
|
||||||
|
storage = "local-lvm"
|
||||||
|
iothread = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
network {
|
||||||
|
model = "virtio"
|
||||||
|
bridge = "vmbr0"
|
||||||
|
}
|
||||||
|
|
||||||
|
lifecycle {
|
||||||
|
ignore_changes = [
|
||||||
|
network,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
ipconfig0 = "ip=192.168.0.50/24,gw=192.168.0.1"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "proxmox_vm_qemu" "media-manager" {
|
||||||
|
count = 1
|
||||||
|
name = "media-manager"
|
||||||
|
vmid = "201"
|
||||||
|
target_node = "milkyway"
|
||||||
|
clone = "ubuntu-2004-cloud"
|
||||||
|
agent = 1
|
||||||
|
os_type = "cloud-init"
|
||||||
|
cores = 4
|
||||||
|
sockets = 1
|
||||||
|
cpu = "host"
|
||||||
|
memory = 4096
|
||||||
|
scsihw = "virtio-scsi-pci"
|
||||||
|
bootdisk = "scsi0"
|
||||||
|
disk {
|
||||||
|
slot = 0
|
||||||
|
size = "20G"
|
||||||
|
type = "scsi"
|
||||||
|
storage = "local-lvm"
|
||||||
|
iothread = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
network {
|
||||||
|
model = "virtio"
|
||||||
|
bridge = "vmbr0"
|
||||||
|
}
|
||||||
|
|
||||||
|
lifecycle {
|
||||||
|
ignore_changes = [
|
||||||
|
network,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
ipconfig0 = "ip=192.168.0.51/24,gw=192.168.0.1"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
18
templates/hosts.tmpl
Normal file
18
templates/hosts.tmpl
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
[media-managers]
|
||||||
|
%{ for ip in media-managers }
|
||||||
|
${ ip }
|
||||||
|
%{ end for }
|
||||||
|
|
||||||
|
[media-servers]
|
||||||
|
%{ for ip in media-servers }
|
||||||
|
${ ip }
|
||||||
|
%{ end for }
|
||||||
|
|
||||||
|
[docker-servers:children]
|
||||||
|
main-docker
|
||||||
|
media-managers
|
||||||
|
|
||||||
|
[main-docker]
|
||||||
|
%{ for ip in main-docker }
|
||||||
|
${ ip }
|
||||||
|
%{ end for }
|
Loading…
Reference in New Issue
Block a user