Set up Ansible role
This commit is contained in:
81
tasks/main.yml
Normal file
81
tasks/main.yml
Normal file
@@ -0,0 +1,81 @@
|
||||
#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 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
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 42420
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: data
|
||||
- name: config
|
||||
configMap:
|
||||
name: config
|
||||
|
||||
- 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