ansible-role-vintage-story/tasks/main.yml
Eric Meehan 137e8279db Inititial setup (#2)
Initialize the Ansible role and establish an interface for server configuration.

Reviewed-on: #2
2025-09-12 17:38:18 +00:00

98 lines
2.3 KiB
YAML

#SPDX-License-Identifier: MIT-0
---
# tasks file for ansible-role-vintage-story
- name: Create Vintage Story namespace
k8s:
state: present
definition:
apiVersion: v1
kind: Namespace
metadata:
name: vintage-story
- name: Create a persistent volume claim
k8s:
state: present
definition:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data
namespace: vintage-story
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 32Gi
- name: Create a ConfigMap
k8s:
state: present
definition:
apiVersion: v1
kind: ConfigMap
metadata:
name: config
namespace: vintage-story
data:
serverconfig.json: "{{ lookup('template', 'serverconfig.json.j2') }}"
- name: Create Deployment for Vintage Story
k8s:
definition:
apiVersion: v1
kind: Deployment
metadata:
name: vintage-story
namespace: vintage-story
spec:
replicas: 1
selector:
matchLabels:
app: vintage-story
template:
metadata:
labels:
app: vintage-story
spec:
containers:
- name: vintage-story
image: devidian/vintagestory
volumeMounts:
- name: data
mountPath: /gamedata
- name: config
mountPath: /gamedata/vs/serverconfig.json
subPath: serverconfig.json
imagePullPolicy: IfNotPresent
ports:
- containerPort: 42420
volumes:
- name: data
persistentVolumeClaim:
claimName: data
- name: config
configMap:
name: config
items:
- key: serverconfig.json
path: serverconfig.json
- name: Create Service for Vintage Story
k8s:
definition:
apiVersion: v1
kind: Service
metadata:
name: vintage-story
namespace: vintage-story
spec:
selector:
app: vintage-story
ports:
- port: 42420
name: http
type: LoadBalancer