{%- macro load_file(filename) %}{% include filename %}{%- endmacro -%}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: bodhi-configmap
  labels:
    app: bodhi
data:
  krb5.conf: |-
    [logging]
     default = FILE:/var/log/krb5libs.log
     kdc = FILE:/var/log/krb5kdc.log
     admin_server = FILE:/var/log/kadmind.log
    [libdefaults]
     default_realm = {{ ipa_realm }}
     rdns = false
     dns_canonicalize_hostname = false
     dns_lookup_realm = false
     dns_lookup_kdc = false
     ticket_lifetime = 24h
     renew_lifetime = 7d
     forwardable = true
    [realms]
     {{ ipa_realm }} = {
      kdc = https://id{{ env_suffix }}.fedoraproject.org/KdcProxy
     }
    [domain_realm]
     .fedoraproject.org = FEDORAPROJECT.ORG
     fedoraproject.org = FEDORAPROJECT.ORG
    {% if env == "staging" %}
     .stg.iad2.fedoraproject.org = STG.FEDORAPROJECT.ORG
    {% endif %}
     .stg.fedoraproject.org = STG.FEDORAPROJECT.ORG
     stg.fedoraproject.org = STG.FEDORAPROJECT.ORG
  start.sh: |-
    mkdir /httpdir/run
    ln -s /etc/httpd/modules /httpdir/modules
    truncate --size=0 /httpdir/accesslog /httpdir/errorlog
    tail -qf /httpdir/accesslog /httpdir/errorlog &
    exec httpd -f /etc/bodhi/httpd.conf -DFOREGROUND -DNO_DETACH
  httpd.conf: |-
    {{ load_file('httpd.conf.j2') | indent }}
  logging.yaml: |-
    {{ load_file('logging.yaml') | indent }}
  production.ini: |-
    {{ load_file('production.ini.j2') | indent }}
  celeryconfig.py: |-
    {{ load_file('celeryconfig.py.j2') | indent }}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: fedora-messaging-configmap
  labels:
    app: bodhi
data:
  config.toml: |-
    {{ load_file('fedora-messaging.toml.j2') | indent }}
