infrastructure/k8s/roles/fider/tasks/main.yml

45 lines
1.4 KiB
YAML
Raw Normal View History

2023-04-17 13:35:15 +00:00
---
- name: Create fider namespace
kubernetes.core.k8s:
name: fider
api_version: v1
kind: Namespace
state: present
definition:
metadata:
labels:
prometheus: default
- name: Create Fider secrets
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
kind: Secret
metadata:
name: fider-secret-config
namespace: fider
data:
# Connection string to the PostgreSQL database
DATABASE_URL: "{{ 'postgres://%s:%s@default-cluster-primary.postgres.svc:5432/fider?sslmode=require' | format(fider.db.user, fider.db.password) | b64encode }}"
2023-04-17 13:35:15 +00:00
# SMTP credentials
EMAIL_NOREPLY: "{{ fider.smtp.user | b64encode }}"
EMAIL_SMTP_USERNAME: "{{ fider.smtp.user | b64encode }}"
EMAIL_SMTP_PASSWORD: "{{ fider.smtp.password | b64encode }}"
# JWT secret key
JWT_SECRET: "{{ fider.jwt.secret | b64encode }}"
# OAuth
OAUTH_GITHUB_CLIENTID: "{{ fider.github.clientId | b64encode }}"
OAUTH_GITHUB_SECRET: "{{ fider.github.clientSecret | b64encode }}"
# Blob storage
BLOB_STORAGE_S3_ACCESS_KEY_ID: "{{ fider.blob.accessKeyId | b64encode }}"
BLOB_STORAGE_S3_SECRET_ACCESS_KEY: "{{ fider.blob.secretAccessKey | b64encode }}"
2023-04-17 13:35:15 +00:00
2023-07-11 18:56:33 +00:00
- name: Deploy Fider kustomization
2023-04-17 13:35:15 +00:00
k8s:
definition: "{{ lookup('kubernetes.core.kustomize', dir=([role_path, 'files'] | path_join)) }}"