Skip to content

feat(vps): add devserver.lepinoid.net backend to HAProxy minecraft proxy - #89

Open
turtton wants to merge 1 commit into
mainfrom
feat/lepinoid-proxy
Open

feat(vps): add devserver.lepinoid.net backend to HAProxy minecraft proxy#89
turtton wants to merge 1 commit into
mainfrom
feat/lepinoid-proxy

Conversation

@turtton

@turtton turtton commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • haproxy-minecrafthaproxy_minecraft_serversdevserver.lepinoid.netlepinoid-dev:25565 を追加
  • ansible/README.md に VPS (os3-387) 向けのロール・Playbook・Inventoryの記述を追加し、haproxy-minecraftへのサーバー追加手順を明記

動作

  • haproxy.cfg.j2 がリストをループ展開するため、既存エントリと同じパターンで反映される
  • 設定変更時は notify: restart haproxy-minecraft で自動再起動 (既存セッションは一瞬切断)
  • backend lepinoid-dev はHAProxy起動時に名前解決される (init-addr libc,last) ため、VPSのTailscaleから解決可能であることが前提

反映方法

ansible-playbook playbooks/vps.yml --tags haproxy-minecraft

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

✅ Dry-run passed

Ansible output
ok: [data]

TASK [tailscale : Connect to Tailscale] ****************************************
skipping: [main]
skipping: [data]
skipping: [toliunit]

TASK [tailscale : Apply Tailscale DNS settings] ********************************
skipping: [main]
skipping: [toliunit]
skipping: [data]

TASK [monitoring_agent : Validate API token is set] ****************************
ok: [main] => {
    "changed": false,
    "msg": "All assertions passed"
}
ok: [data] => {
    "changed": false,
    "msg": "All assertions passed"
}
ok: [toliunit] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [monitoring_agent : Create pve-exporter system group] *********************
ok: [main]
ok: [toliunit]
ok: [data]

TASK [monitoring_agent : Create pve-exporter system user] **********************
ok: [main]
ok: [toliunit]
ok: [data]

TASK [monitoring_agent : Check if old prometheus-pve-exporter binary exists] ***
ok: [main]
ok: [data]
ok: [toliunit]

TASK [monitoring_agent : Stop old pve-exporter if running (migration from prometheus-pve-exporter)] ***
skipping: [main]
skipping: [data]
skipping: [toliunit]

TASK [monitoring_agent : Remove old prometheus-pve-exporter binary] ************
skipping: [main]
skipping: [data]
skipping: [toliunit]

TASK [monitoring_agent : Download pve-exporter binary] *************************
ok: [main]
ok: [toliunit]
ok: [data]

TASK [monitoring_agent : Create config directory] ******************************
ok: [main]
ok: [toliunit]
ok: [data]

TASK [monitoring_agent : Deploy pve-exporter config] ***************************
ok: [main]
ok: [toliunit]
ok: [data]

TASK [monitoring_agent : Deploy systemd service] *******************************
ok: [main]
ok: [toliunit]
ok: [data]

TASK [monitoring_agent : Enable and start pve-exporter] ************************
ok: [main]
ok: [toliunit]
ok: [data]

PLAY RECAP *********************************************************************
data                       : ok=25   changed=2    unreachable=0    failed=0    skipped=4    rescued=0    ignored=0   
main                       : ok=25   changed=2    unreachable=0    failed=0    skipped=4    rescued=0    ignored=0   
toliunit                   : ok=25   changed=2    unreachable=0    failed=0    skipped=4    rescued=0    ignored=0   

Comment /ansible-apply to apply these changes.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

✅ VPS dry-run passed

Ansible output

TASK [docker_host : Install Docker and Compose plugin] *************************
ok: [os3-387-26840]

TASK [docker_host : Ensure docker group exists] ********************************
ok: [os3-387-26840]

TASK [docker_host : Add ansible user to docker group] **************************
ok: [os3-387-26840]

TASK [docker_host : Configure Docker daemon] ***********************************
ok: [os3-387-26840]

TASK [docker_host : Enable and start Docker] ***********************************
ok: [os3-387-26840]

TASK [nftables_vps : Install nftables] *****************************************
ok: [os3-387-26840]

TASK [nftables_vps : Render nftables ruleset] **********************************
ok: [os3-387-26840]

TASK [nftables_vps : Enable and start nftables] ********************************
ok: [os3-387-26840]

TASK [haproxy_minecraft : Ensure install directory exists] *********************
ok: [os3-387-26840]

TASK [haproxy_minecraft : Deploy compose file] *********************************
ok: [os3-387-26840]

TASK [haproxy_minecraft : Deploy HAProxy configuration] ************************
--- before: /opt/haproxy-minecraft/haproxy.cfg
+++ after: /home/runner/.ansible/tmp/ansible-local-3467q9yw43ra/tmpls114o0r/haproxy.cfg.j2
@@ -23,6 +23,7 @@
 
     use_backend minecraft_1 if { var(txn.mc_host) -m str atm10.turtton.net }
     use_backend minecraft_2 if { var(txn.mc_host) -m str build.lepinoid.net }
+    use_backend minecraft_3 if { var(txn.mc_host) -m str devserver.lepinoid.net }
 
     # 設定していないドメインやVPSのIP直打ちは拒否する。
     default_backend reject_unknown_host
@@ -33,5 +34,8 @@
 backend minecraft_2
     server minecraft_2 "testserver:49966" check inter 5s fall 3 rise 2 init-addr libc,last
 
+backend minecraft_3
+    server minecraft_3 "lepinoid-dev:25565" check inter 5s fall 3 rise 2 init-addr libc,last
+
 backend reject_unknown_host
     tcp-request content reject

changed: [os3-387-26840]

TASK [haproxy_minecraft : Deploy HAProxy Lua script] ***************************
ok: [os3-387-26840]

TASK [haproxy_minecraft : Deploy environment file] *****************************
--- before: /opt/haproxy-minecraft/.env
+++ after: /home/runner/.ansible/tmp/ansible-local-3467q9yw43ra/tmpx5vxd263/env.j2
@@ -2,3 +2,5 @@
 MC_BACKEND_1=atm10:25565
 MC_DOMAIN_2=build.lepinoid.net
 MC_BACKEND_2=testserver:49966
+MC_DOMAIN_3=devserver.lepinoid.net
+MC_BACKEND_3=lepinoid-dev:25565

changed: [os3-387-26840]

TASK [haproxy_minecraft : Deploy systemd service] ******************************
ok: [os3-387-26840]

TASK [haproxy_minecraft : Enable and start haproxy-minecraft] ******************
ok: [os3-387-26840]

RUNNING HANDLER [haproxy_minecraft : Restart haproxy-minecraft] ****************
changed: [os3-387-26840]

PLAY RECAP *********************************************************************
os3-387-26840              : ok=39   changed=5    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0   

Comment /vps-apply to apply these changes.

Also document the VPS (os3-387) roles, playbooks, and inventory in
ansible/README.md, including how to add new haproxy-minecraft servers.
@turtton
turtton force-pushed the feat/lepinoid-proxy branch from dd6fe4f to c6eda49 Compare July 20, 2026 14:23
@turtton

turtton commented Jul 20, 2026

Copy link
Copy Markdown
Owner Author

TODO: サーバーに人がいないタイミングでtestserverの方の設定を変えた上で適用する

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant