Deploy tes3mp

This commit is contained in:
Salt 2022-07-11 00:59:07 -05:00
parent 7f22884627
commit a5708348ca
3 changed files with 57 additions and 0 deletions

View File

@ -2,6 +2,13 @@
# vim:ft=ansible:
# Game servers
---
- hosts: vm-test3mp-1.home.mgmt.desu.ltd
gather_facts: no
roles:
- role: docker-tes3mp
vars:
tes3mp_server_hostname: "The N'Wah Spitoon"
tags: [ tes3mp ]
- hosts: vm-minecraft-2.home.mgmt.desu.ltd
gather_facts: no
roles:

View File

@ -0,0 +1,19 @@
# vim:ft=ansible:
# Overall app settings
tes3mp_name: generic
# Container settings
tes3mp_uid: 0
tes3mp_gid: 0
tes3mp_state: started
tes3mp_image: tes3mp/server:0.8.1
tes3mp_restart_policy: unless-stopped
tes3mp_timezone: "America/Chicago"
# Container network settings
tes3mp_external_port: 25565
tes3mp_data_prefix: "/data/tes3mp/{{ tes3mp_name }}"
# TES3MP settings
tes3mp_server_maximum_players: 8
tes3mp_server_hostname: "Some Ansible-deployed server"
tes3mp_server_password: "dicks"

View File

@ -0,0 +1,31 @@
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
- name: assure tes3mp {{ tes3mp_name }} directory structure
file:
state: directory
owner: "{{ tes3mp_uid }}"
group: "{{ tes3mp_gid }}"
mode: "0750"
path: "{{ item }}"
recurse: yes
with_items:
- "{{ tes3mp_data_prefix }}/data"
- "{{ tes3mp_data_prefix }}/scripts"
- name: assure tes3mp {{ tes3mp_name }} container
docker_container:
name: "tes3mp-{{ tes3mp_name }}"
state: started
image: "{{ tes3mp_image }}"
restart_policy: "{{ tes3mp_restart_policy }}"
pull: yes
user: "{{ tes3mp_uid }}:{{ tes3mp_gid }}"
env:
TZ: "{{ tes3mp_timezone }}"
TES3MP_SERVER_MAXIMUM_PLAYERS: "{{ tes3mp_server_maximum_players }}"
TES3MP_SERVER_HOSTNAME: "{{ tes3mp_server_hostname }}"
TES3MP_SERVER_PASSWORD: "{{ tes3mp_server_password }}"
ports:
- "25565:25565/udp"
volumes:
- "{{ tes3mp_data_prefix }}/data:/server/data"
- "{{ tes3mp_data_prefix }}/scripts:/server/scripts"