WIP: Add support for creating a test cluster
This will help with verifying backups and making sure my configuration is dynamic.
This commit is contained in:
parent
2d733b278c
commit
25fcdd2292
@ -106,6 +106,8 @@
|
||||
- name: photoprism-media
|
||||
path: /srv/volumes/photos/Photoprism
|
||||
read_only: false
|
||||
|
||||
# TODO: If test hosts, use a different path
|
||||
- name: photoprism-storage
|
||||
path: /srv/volumes/nas-container/photoprism
|
||||
read_only: false
|
||||
|
25
ansible_playbooks/spin-test-cluster.yml
Normal file
25
ansible_playbooks/spin-test-cluster.yml
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
- name: Stop prod cluster
|
||||
hosts: nomad_instances
|
||||
vars:
|
||||
template_vm_name: jammy-cloud-tmpl
|
||||
|
||||
tasks:
|
||||
- name: Stop prod cluster
|
||||
community.general.proxmox_kvm:
|
||||
name: "{{ test_prod_vm }}"
|
||||
state: stopped
|
||||
delegate_to: localhost
|
||||
when: test_prod_vm
|
||||
|
||||
- name: Create test instances
|
||||
community.general.proxmox_kvm:
|
||||
clone: "{{ template_vm_name }}"
|
||||
name: "{{ ansible_hostname }}"
|
||||
ipconfig:
|
||||
ipconfig0: "ip={{ test_ip_address }},gw=192.168.2.1"
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Wait for cluster to spin up
|
||||
|
||||
- import_playbook: setup-cluster.yml
|
55
ansible_playbooks/test_ansible_hosts.yml
Normal file
55
ansible_playbooks/test_ansible_hosts.yml
Normal file
@ -0,0 +1,55 @@
|
||||
---
|
||||
all:
|
||||
children:
|
||||
servers:
|
||||
hosts:
|
||||
tn1.thefij:
|
||||
test_prod_vm: n1
|
||||
test_ip_address: 192.168.2.201
|
||||
|
||||
nomad_node_role: both
|
||||
nomad_unique_host_volumes:
|
||||
- name: mysql-data
|
||||
path: /srv/volumes/mysql
|
||||
owner: "999"
|
||||
group: "100"
|
||||
mode: "0755"
|
||||
read_only: false
|
||||
- name: postgres-data
|
||||
path: /srv/volumes/postgres
|
||||
owner: "999"
|
||||
group: "999"
|
||||
mode: "0755"
|
||||
read_only: false
|
||||
tn2.thefij:
|
||||
test_prod_vm: n2
|
||||
test_ip_address: 192.168.2.202
|
||||
|
||||
nomad_node_class: ingress
|
||||
nomad_node_role: both
|
||||
nomad_unique_host_volumes:
|
||||
- name: nextcloud-data
|
||||
path: /srv/volumes/nextcloud
|
||||
owner: "root"
|
||||
group: "bin"
|
||||
mode: "0755"
|
||||
read_only: false
|
||||
- name: gitea-data
|
||||
path: /srv/volumes/gitea
|
||||
owner: "root"
|
||||
group: "bin"
|
||||
mode: "0755"
|
||||
read_only: false
|
||||
- name: sonarr-data
|
||||
path: /srv/volumes/sonarr
|
||||
owner: "root"
|
||||
group: "bin"
|
||||
mode: "0755"
|
||||
read_only: false
|
||||
tn3:
|
||||
test_ip_address: 192.168.2.203
|
||||
nomad_node_role: both
|
||||
|
||||
nomad_instances:
|
||||
children:
|
||||
servers: {}
|
@ -37,9 +37,11 @@ job "traefik" {
|
||||
|
||||
dns {
|
||||
servers = [
|
||||
# TODO: Get these IP addresses from ansible? Or, do these need to be here?
|
||||
"192.168.2.101",
|
||||
"192.168.2.102",
|
||||
"192.168.2.30",
|
||||
# Fallback DNS IP should be static
|
||||
"192.168.2.170",
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user