117 lines
2.9 KiB
YAML
117 lines
2.9 KiB
YAML
---
|
|
# tasks file for git
|
|
- name: Create a config map for httpd
|
|
vars:
|
|
httpd_server_name: "git.eom.dev"
|
|
httpd_conf_extra:
|
|
- httpd-auth.conf
|
|
- httpd-git.conf
|
|
k8s:
|
|
state: present
|
|
api_version: v1
|
|
kind: ConfigMap
|
|
name: git
|
|
namespace: "eom-{{ target_namespace }}"
|
|
definition:
|
|
data:
|
|
httpd.conf: "{{ lookup('template', 'httpd.conf.j2') }}"
|
|
httpd-auth.conf: "{{ lookup('template', 'httpd-auth.conf.j2') }}"
|
|
httpd-git.conf: "{{ lookup('file', 'httpd-gitweb.conf') }}"
|
|
mime.types: "{{ lookup('file', 'mime.types') }}"
|
|
|
|
- name: Create persistent volume for git
|
|
k8s:
|
|
state: present
|
|
definition:
|
|
apiVersion: v1
|
|
kind: PersistentVolume
|
|
metadata:
|
|
name: "eom-{{ target_namespace }}-git"
|
|
spec:
|
|
capacity:
|
|
storage: 32Gi
|
|
accessModes:
|
|
- ReadWriteMany
|
|
persistentVolumeReclaimPolicy: Retain
|
|
storageClassName: standard
|
|
hostPath:
|
|
path: "/data/store-0/eom-{{ target_namespace }}/git"
|
|
nodeAffinity:
|
|
required:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: kubernetes.io/hostname
|
|
operator: In
|
|
values:
|
|
- alpha-worker-0
|
|
|
|
- name: Create a persistent volume claim for git
|
|
k8s:
|
|
state: present
|
|
definition:
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: git
|
|
namespace: "eom-{{ target_namespace }}"
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteMany
|
|
resources:
|
|
requests:
|
|
storage: 32Gi
|
|
storageClassName: standard
|
|
volumeName: "eom-{{ target_namespace }}-git"
|
|
|
|
- name: Create a deployment
|
|
k8s:
|
|
definition:
|
|
apiVersion: v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: git
|
|
namespace: "eom-{{ target_namespace }}"
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: git
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: git
|
|
spec:
|
|
containers:
|
|
- name: gitweb
|
|
image: ericomeehan/gitweb
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: /usr/local/apache2/conf
|
|
- name: data
|
|
mountPath: /usr/local/apache2/htdocs
|
|
ports:
|
|
- containerPort: 80
|
|
volumes:
|
|
- name: config
|
|
configMap:
|
|
name: git
|
|
- name: data
|
|
persistentVolumeClaim:
|
|
claimName: git
|
|
|
|
- name: Expose deployment as a service
|
|
k8s:
|
|
definition:
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: git
|
|
namespace: "eom-{{ target_namespace }}"
|
|
spec:
|
|
selector:
|
|
app: git
|
|
ports:
|
|
- port: 80
|
|
name: git-80
|
|
type: ClusterIP
|