# Source: keycloak/charts/keycloak/templates/configmap-startup.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: keycloak-startup
  labels:
    helm.sh/chart: keycloak-9.5.0
    app.kubernetes.io/name: keycloak
    app.kubernetes.io/instance: keycloak
    app.kubernetes.io/version: "11.0.2"
    app.kubernetes.io/managed-by: Helm
    gitops.jenkins-x.io/pipeline: 'namespaces'
  annotations:
    meta.helm.sh/release-name: 'keycloak'
  namespace: keycloak
data:
  keycloak.cli: |
    embed-server --server-config=standalone-ha.xml --std-out=echo
    batch

    echo Configuring node identifier

    ## Sets the node identifier to the node name (= pod name). Node identifiers have to be unique. They can have a
    ## maximum length of 23 characters. Thus, the chart's fullname template truncates its length accordingly.
    /subsystem=transactions:write-attribute(name=node-identifier, value=${jboss.node.name})

    echo Finished configuring node identifier

    run-batch
    stop-embedded-server
