Drop discourse-ldap-auth (its authenticator ignores ldap_enabled) and add an idempotent settings script, run after deploy, that disables LDAP login and installs a theme component sending Sign Up to www.eom.dev/members. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
111 lines
3.6 KiB
YAML
111 lines
3.6 KiB
YAML
---
|
|
# tasks file for discourse
|
|
- name: Deploy Discourse
|
|
kubernetes.core.helm:
|
|
name: discourse
|
|
chart_ref: bitnami/discourse
|
|
release_namespace: discourse
|
|
create_namespace: true
|
|
values:
|
|
auth:
|
|
email: discourse@eom.dev
|
|
username: discourse_admin
|
|
password: "{{ discourse_admin_password }}"
|
|
host: "https://discourse.eom.dev"
|
|
siteName: 'Discourse'
|
|
smtp:
|
|
enabled: true
|
|
host: "postfix.eom.dev"
|
|
port: "587"
|
|
protocol: "tls"
|
|
user: "discourse"
|
|
password: "{{ discourse_admin_password }}"
|
|
image:
|
|
debug: false
|
|
repository: bitnamilegacy/discourse
|
|
tag: 3.4.7-debian-12-r0
|
|
service:
|
|
externalTrafficPolicy: Local
|
|
discourse:
|
|
skipInstall: false
|
|
plugins:
|
|
- https://github.com/discourse/discourse-adplugin
|
|
- https://github.com/discourse/discourse-subscriptions
|
|
- https://github.com/discourse/discourse-activity-pub
|
|
- https://github.com/discourse/discourse-openid-connect
|
|
# discourse-ldap-auth removed: its login cannot be disabled by setting,
|
|
# and sign-in goes through Dex (discourse-openid-connect) only.
|
|
- https://github.com/discourse/discourse-math
|
|
- https://github.com/discourse/discourse-post-voting
|
|
- https://github.com/discourse/discourse-prometheus
|
|
- https://github.com/discourse/discourse-reactions
|
|
command:
|
|
- /bin/bash
|
|
args:
|
|
- -c
|
|
- |
|
|
rm -r /opt/bitnami/discourse/plugins/chat
|
|
chown -R discourse:root /opt/bitnami/discourse/plugins
|
|
/opt/bitnami/scripts/discourse/entrypoint.sh /opt/bitnami/scripts/discourse/run.sh
|
|
persistPlugins: false
|
|
compatiblePlugins: true
|
|
resourcesPreset: none
|
|
persistence:
|
|
size: 2Ti
|
|
ingress:
|
|
enabled: true
|
|
ingressClassName: "nginx"
|
|
hostname: discourse.eom.dev
|
|
annotations:
|
|
cert-manager.io/cluster-issuer: ca-issuer
|
|
nginx.ingress.kubernetes.io/proxy-set-header: "X-Forwarded-Proto $scheme"
|
|
tls: true
|
|
postgresql:
|
|
enabled: true
|
|
image:
|
|
repository: bitnamilegacy/postgresql
|
|
auth:
|
|
enablePostgresUser: true
|
|
postgresPassword: "{{ discourse_admin_password }}"
|
|
password: "{{ discourse_admin_password }}"
|
|
primary:
|
|
persistence:
|
|
size: 2Ti
|
|
redis:
|
|
enabled: true
|
|
image:
|
|
repository: bitnamilegacy/redis
|
|
auth:
|
|
password: "{{ discourse_admin_password }}"
|
|
|
|
- name: Find the Discourse pod
|
|
kubernetes.core.k8s_info:
|
|
kind: Pod
|
|
namespace: discourse
|
|
label_selectors:
|
|
- app.kubernetes.io/instance=discourse
|
|
- app.kubernetes.io/name=discourse
|
|
field_selectors:
|
|
- status.phase=Running
|
|
register: discourse_pods
|
|
|
|
- name: Copy the Dex sign-in / membership sign-up settings script
|
|
kubernetes.core.k8s_cp:
|
|
namespace: discourse
|
|
pod: "{{ discourse_pods.resources[0].metadata.name }}"
|
|
container: discourse
|
|
local_path: "{{ role_path }}/files/discourse-sso.rb"
|
|
remote_path: /tmp/discourse-sso.rb
|
|
|
|
- name: Apply Dex sign-in / membership sign-up settings
|
|
kubernetes.core.k8s_exec:
|
|
namespace: discourse
|
|
pod: "{{ discourse_pods.resources[0].metadata.name }}"
|
|
container: discourse
|
|
command: >-
|
|
bash -c 'cd /opt/bitnami/discourse && PATH=/opt/bitnami/ruby/bin:$PATH
|
|
RAILS_ENV=production bundle exec ruby -e
|
|
"require \"/opt/bitnami/discourse/config/environment\"; load \"/tmp/discourse-sso.rb\""'
|
|
register: discourse_sso
|
|
changed_when: false
|