From 4f664e4987e6ba37b2960f2ef267b44770c58525 Mon Sep 17 00:00:00 2001 From: Eric Meehan Date: Wed, 24 Dec 2025 13:16:20 -0500 Subject: [PATCH] Basic definitions --- defaults/main.yml | 4 +++ tasks/main.yml | 85 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 4e0e87a..2b543ac 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,3 +1,7 @@ #SPDX-License-Identifier: MIT-0 --- # defaults file for ansible-role-tes3mp +TES3MP_SERVER_GENERAL_HOSTNAME: "TES3MP Server" +TES3MP_SERVER_GENERAL_PLAYERS: "16" +TES3MP_SERVER_GENERAL_PASSWORD: "changeme" +TES3MP_SERVER_MASTERSERVER_ENABLED: "false" diff --git a/tasks/main.yml b/tasks/main.yml index f7a263c..bca4216 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,3 +1,88 @@ #SPDX-License-Identifier: MIT-0 --- # tasks file for ansible-role-tes3mp +- name: Create tes3mp namespace + k8s: + state: present + definition: + apiVersion: v1 + kind: Namespace + metadata: + name: tes3mp + +- name: Create PVC for tes3mp + k8s: + state: present + definition: + apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + name: tes3mp + namespace: tes3mp + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 32Gi + +- name: Create Deployment for tes3mp + k8s: + state: present + definition: + apiVersion: v1 + kind: Deployment + metadata: + name: tes3mp + namespace: tes3mp + labels: + app: tes3mp + spec: + replicas: 1 + selector: + matchLabels: + app: tes3mp + template: + metadata: + labels: + app: tes3mp + spec: + containers: + - name: tes3mp + image: tes3mp/server + volumeMounts: + - name: data + mountPath: /server/data + ports: + - containerPort: 25565 + env: + - name: TES3MP_SERVER_GENERAL_HOSTNAME + value: "{{ TES3MP_SERVER_GENERAL_HOSTNAME }}" + - name: TES3MP_SERVER_GENERAL_PLAYERS + value: "{{ TES3MP_SERVER_GENERAL_PLAYERS }}" + - name: TES3MP_SERVER_GENERAL_PASSWORD + value: "{{ TES3MP_SERVER_GENERAL_PASSWORD }}" + - name: TES3MP_SERVER_MASTERSERVER_ENABLED + value: "{{ TES3MP_SERVER_MASTERSERVER_ENABLED }}" + volumes: + - name: data + persistentVolumeClaim: + claimName: tes3mp + +- name: Create Service for tes3mp + k8s: + state: present + definition: + apiVersion: v1 + kind: Service + metadata: + name: tes3mp + namespace: tes3mp + spec: + selector: + app: tes3mp + ports: + - port: 25565 + name: tes3mp + type: LoadBalancer +