Compare commits

..

47 Commits

Author SHA1 Message Date
8648974b26 set static MAC for infra network 2026-02-23 23:59:33 -05:00
46f7af8881 disable IPAM on infra for podman 2026-02-23 23:53:50 -05:00
7701e23f6d Set static IP on homeassistant 2026-02-23 23:45:34 -05:00
b16a373a8f Use host network for matter server 2026-02-23 23:19:55 -05:00
36d8cac1e9 Enable ipv6 on iot bridge 2026-02-23 22:54:29 -05:00
3e221ae262 Use host networking for OTBR 2026-02-23 22:37:43 -05:00
80a1679745 Add NET_RAW to OTBR 2026-02-23 22:14:37 -05:00
9b69202257 Disable priveleged mode for OTBR 2026-02-23 22:06:48 -05:00
362691464e Add NET_ADMIN capability to OTBR 2026-02-23 21:36:20 -05:00
f2bbd6a1e8 add tun device to OTBR 2026-02-19 19:56:15 -05:00
ca07fcad2d Increate OTBR log level 2026-02-19 19:31:22 -05:00
f4647882bd Correct interface name for thread router container 2026-02-19 18:53:11 -05:00
cb4f8bc6fe why doesnt this work 2026-02-19 18:46:58 -05:00
9bf7f68575 disable DNS on podman 2026-02-19 18:45:22 -05:00
5112efacc1 disable IPAM 2026-02-19 18:42:55 -05:00
3a859a46cb use unmanaged 2026-02-19 17:51:19 -05:00
a601a44a36 remove DHCP tag in podman network 2026-02-19 17:47:49 -05:00
27206160ae switch to DHCP for container networks 2026-02-19 17:45:45 -05:00
0f7dba98eb Use bridge networking 2026-02-19 17:16:15 -05:00
e244c3f252 fix image for podman thread container 2026-02-19 15:34:35 -05:00
2fdd28edde Correct to docker.io for OTBR 2026-02-19 15:19:42 -05:00
4c02b6c69e Use docker hub for openthread 2026-02-19 15:18:15 -05:00
d2e98f9cfc Fix quote on J2 string 2026-02-19 15:13:39 -05:00
7da2a03295 Add matter and openthread support 2026-02-19 15:12:16 -05:00
9ae191dd5c Fix wrong id for infra parent interface 2026-02-19 10:00:24 -05:00
792f114014 Add infra interface to homeassistant 2026-02-19 09:58:08 -05:00
2d1455bc15 Set home assistant to use host network 2026-02-19 09:53:50 -05:00
5643be982a Update home_assistant.yaml 2026-02-19 09:48:18 -05:00
4a92ad7ba4 Use host and iot networks for home assistant 2026-02-19 09:46:00 -05:00
2570aa4c86 Fix home assistant iot network interface name 2026-02-19 09:27:45 -05:00
856ad08b2e Correct user for podman1 2026-02-19 09:25:19 -05:00
adc53c4c50 Correct hostname for podman1 2026-02-19 09:22:02 -05:00
f4b715eefa Add home assistant podman setup 2026-02-19 08:20:00 -05:00
e8f11e061c Prometheus: fix type 2026-01-03 00:38:36 -05:00
c85b1af494 Prometheus: Add homeassistant exporter 2026-01-03 00:35:05 -05:00
cc609acc34 Increase scrape rate 2026-01-02 21:08:38 -05:00
e66463832a Grafana: fix systemd service name 2026-01-02 19:10:43 -05:00
5962b33221 Grafana: install GPG 2026-01-02 19:08:13 -05:00
745bd69d50 Add Grafana 2026-01-02 19:06:29 -05:00
1ea3ed93bb Fix gateway exporter port 2026-01-02 18:04:29 -05:00
3f1bd762c5 Split prometheus into 2 jobs 2026-01-02 17:54:44 -05:00
9f717ba16a Add gateway job to prometheus 2026-01-02 17:47:23 -05:00
7515b52660 Create prometheus user 2026-01-02 17:41:09 -05:00
b2fa6bf075 Create group for prometheus on install 2026-01-02 17:33:11 -05:00
5926b84d49 Add prometheus deployment 2026-01-02 17:27:22 -05:00
ce31fc354a Remove oxidizium 2026-01-01 01:17:27 -05:00
3c09f54ae2 Restart minecraft servers on update 2026-01-01 01:13:54 -05:00
8 changed files with 202 additions and 7 deletions

5
deploy_monitoring.yaml Normal file
View File

@@ -0,0 +1,5 @@
- name: Deploy Gitea
hosts: monitoring
roles:
- prometheus
- grafana

26
grafana/tasks/main.yaml Normal file
View File

@@ -0,0 +1,26 @@
- name: Install dependencies
become: true
ansible.builtin.apt:
name: gpg
state: latest
- name: Download Grafana GPG keys
become: true
ansible.builtin.get_url:
url: https://apt.grafana.com/gpg.key
dest: /etc/apt/keyrings/grafana.gpg
- name: Add Grafana repository
become: true
ansible.builtin.apt_repository:
repo: "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main"
state: present
- name: Install Grafana
become: true
ansible.builtin.apt:
name: grafana
state: latest
- name: Start Grafana
become: true
ansible.builtin.systemd_service:
name: grafana-server
state: restarted
enabled: true

99
home_assistant.yaml Normal file
View File

@@ -0,0 +1,99 @@
- name: Setup Home Assistant
hosts: podman1
become: true
become_user: root
tasks:
- name: Pull Home Assistant image
containers.podman.podman_image:
name: ghcr.io/home-assistant/home-assistant:stable
- name: Pull Matter Server image
containers.podman.podman_image:
name: ghcr.io/matter-js/python-matter-server:stable
- name: Pull openthread image
containers.podman.podman_image:
name: docker.io/openthread/border-router:latest
- name: Create network for iot interface
containers.podman.podman_network:
name: iot
interface_name: br5
ipam_driver: "dhcp"
disable_dns: "true"
ipv6: true
opt:
mode: "unmanaged"
- name: Create network for infra interface
containers.podman.podman_network:
name: infra
interface_name: br2
ipam_driver: "dhcp"
disable_dns: "true"
opt:
mode: "unmanaged"
#- name: Create network for infra interface
# containers.podman.podman_network:
# name: access
# interface_name: br4
# ipam_driver: "dhcp"
# disable_dns: "true"
# opt:
# mode: "unmanaged"
- name: Create config directories
ansible.builtin.file:
path: "{{item}}"
state: directory
loop:
- /var/homeassistant
- /var/matter_server
- /var/thread_router
- name: Create Home Assistant Container
containers.podman.podman_container:
name: homeassistant
image: ghcr.io/home-assistant/home-assistant:stable
recreate: true
restart_policy: "unless-stopped"
hostname: homeassistant1
network:
- "infra:mac=0a:a1:a2:9a:00:8c"
- iot
privileged: true
state: started
volumes:
- "/var/homeassistant:/config"
- name: Create Matter Server Container
containers.podman.podman_container:
name: matter
image: ghcr.io/matter-js/python-matter-server:stable
hostname: matter1
recreate: true
restart_policy: "unless-stopped"
network: host
privileged: true
state: started
volumes:
- "/var/matter_server:/data"
- name: Create OpenThread container
containers.podman.podman_container:
name: thread
image: docker.io/openthread/border-router:latest
hostname: openthread1
recreate: true
restart_policy: "unless-stopped"
network: host
cap_add:
- NET_ADMIN
- NET_RAW
device:
- "/dev/serial/by-id/usb-Nabu_Casa_ZBT-2_10B41DE60794-if00:/dev/ttyACM5"
- "/dev/net/tun"
state: started
volumes:
- "/var/thread_router:/data"
env:
OT_RCP_DEVICE: "spinel+hdlc+uart:///dev/ttyACM5?uart-baudrate=460800"
OT_INFRA_IF: "br5"
OT_THREAD_IF: "wpan0"
OT_LOG_LEVEL: "7"
OT_REST_LISTEN_ADDR: "0.0.0.0"
OT_REST_LISTEN_PORT: "8981"
OT_WEB_LISTEN_ADDR: "0.0.0.0"
OT_WEB_LISTEN_PORT: "8980"

View File

@@ -8,7 +8,27 @@ devops_servers:
devops_1: devops_1:
ansible_host: devops-1.malcolms.xyz ansible_host: devops-1.malcolms.xyz
hypervisors:
hosts:
PMX1:
ansible_host: 10.2.2.1
ansible_user: root
PMX2:
ansible_host: 10.2.2.2
ansible_user: root
PMX3:
ansible_host: 10.2.2.3
ansible_user: root
container_servers:
hosts:
podman1:
ansible_host: podman1.malcolms.xyz
all_servers: all_servers:
children: children:
minecraft_servers: minecraft_servers:
devops_servers: devops_servers:
hosts:
monitoring:
ansible_host: monitoring.malcolms.xyz

View File

@@ -1,4 +1,3 @@
- name: Setup directory - name: Setup directory
become: true become: true
become_user: root become_user: root
@@ -31,7 +30,7 @@
owner: minecraft owner: minecraft
src: start.sh.j2 src: start.sh.j2
dest: "/var/minecraft/{{mc_instance}}/start.sh" dest: "/var/minecraft/{{mc_instance}}/start.sh"
mode: '550' mode: "550"
- name: Create mods directory - name: Create mods directory
ansible.builtin.file: ansible.builtin.file:
path: "/var/minecraft/{{mc_instance}}/mods" path: "/var/minecraft/{{mc_instance}}/mods"
@@ -55,6 +54,4 @@
ansible.builtin.systemd_service: ansible.builtin.systemd_service:
name: "minecraft-{{mc_instance}}" name: "minecraft-{{mc_instance}}"
enabled: true enabled: true
state: started state: restarted

View File

@@ -0,0 +1,29 @@
- name: Create Groups
become: true
ansible.builtin.group:
name: prometheus
state: present
- name: Create Users
become: true
ansible.builtin.group:
name: prometheus
state: present
- name: Install Prometheus
become: true
become_user: root
ansible.builtin.apt:
name: prometheus
state: latest
- name: Install config
become: true
become_user: root
ansible.builtin.template:
src: prometheus.yml.j2
dest: "/etc/prometheus/prometheus.yml"
- name: Start service
become: true
become_user: root
ansible.builtin.systemd_service:
name: prometheus
enabled: true
state: restarted

View File

@@ -0,0 +1,21 @@
global:
scrape_interval: 5s
evaluation_interval: 15s
rule_files:
# - "first.rules"
# - "second.rules"
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ["localhost:9090"]
- job_name: gateway_ucode
static_configs:
- targets: ["10.1.1.1:9101"]
- job_name: gateway_lua
static_configs:
- targets: ["10.1.1.1:9100"]
- job_name: homeassistant
static_configs:
- targets: ["10.1.3.3"]

View File

@@ -32,8 +32,6 @@
dest: "lithium.jar" dest: "lithium.jar"
- url: https://cdn.modrinth.com/data/P7dR8mSH/versions/gB6TkYEJ/fabric-api-0.140.2%2B1.21.11.jar - url: https://cdn.modrinth.com/data/P7dR8mSH/versions/gB6TkYEJ/fabric-api-0.140.2%2B1.21.11.jar
dest: "fabric-api.jar" dest: "fabric-api.jar"
- url: https://cdn.modrinth.com/data/TLtbk2Er/versions/ysmdOYj0/oxidizium-1.1.3.jar
dest: "oxidizium.jar"
proxy_secret: "AVXMVzev80E6" proxy_secret: "AVXMVzev80E6"
roles: roles:
- modded_minecraft_server - modded_minecraft_server