Inititial setup (#2)
Initialize the Ansible role and establish an interface for server configuration. Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
97
tasks/main.yml
Normal file
97
tasks/main.yml
Normal file
@@ -0,0 +1,97 @@
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user