apiVersion: v1
data:
  config.json: |
    {
        "command": "/usr/sbin/httpd",
        "config_files": [
            {
                "source": "/var/lib/kolla/config_files/keystone.conf",
                "dest": "/etc/keystone/keystone.conf",
                "owner": "keystone",
                "perm": "0600"
            },
            {
                "source": "/var/lib/kolla/config_files/keystone-paste.ini",
                "dest": "/etc/keystone/keystone-paste.ini",
                "owner": "keystone",
                "perm": "0600"
            },
            {
                "source": "/var/lib/kolla/config_files/domains",
                "dest": "/etc/keystone/domains",
                "owner": "keystone",
                "perm": "0700",
                "optional": true
            },
            {
                "source": "/var/lib/kolla/config_files/policy.json",
                "dest": "/etc/keystone/policy.json",
                "owner": "keystone",
                "perm": "0600",
                "optional": true
            },
            {
                "source": "/var/lib/kolla/config_files/wsgi-keystone.conf",
                "dest": "/etc/httpd/conf.d/wsgi-keystone.conf",
                "owner": "keystone",
                "perm": "0644"
            }
        ],
        "permissions": [
            {
                "path": "/var/log/kolla",
                "owner": "keystone:kolla"
            },
            {
                "path": "/var/log/kolla/keystone/keystone.log",
                "owner": "keystone:keystone"
            }
        ]
    }
  keystone-paste.ini: |+
    [filter:debug]
    use = egg:oslo.middleware#debug

    [filter:request_id]
    use = egg:oslo.middleware#request_id

    [filter:build_auth_context]
    use = egg:keystone#build_auth_context

    [filter:token_auth]
    use = egg:keystone#token_auth

    [filter:json_body]
    use = egg:keystone#json_body

    [filter:cors]
    use = egg:oslo.middleware#cors
    oslo_config_project = keystone

    [filter:ec2_extension]
    use = egg:keystone#ec2_extension

    [filter:ec2_extension_v3]
    use = egg:keystone#ec2_extension_v3

    [filter:s3_extension]
    use = egg:keystone#s3_extension

    [filter:url_normalize]
    use = egg:keystone#url_normalize

    [filter:sizelimit]
    use = egg:oslo.middleware#sizelimit

    [app:public_service]
    use = egg:keystone#public_service

    [app:service_v3]
    use = egg:keystone#service_v3

    [app:admin_service]
    use = egg:keystone#admin_service

    [pipeline:public_api]
    pipeline = cors sizelimit url_normalize request_id build_auth_context token_auth json_body ec2_extension public_service

    [pipeline:admin_api]
    pipeline = cors sizelimit url_normalize request_id build_auth_context token_auth json_body ec2_extension s3_extension admin_service

    [pipeline:api_v3]
    pipeline = cors sizelimit url_normalize request_id build_auth_context token_auth json_body ec2_extension_v3 s3_extension service_v3

    [app:public_version_service]
    use = egg:keystone#public_version_service

    [app:admin_version_service]
    use = egg:keystone#admin_version_service

    [pipeline:public_version_api]
    pipeline = cors sizelimit url_normalize public_version_service

    [pipeline:admin_version_api]
    pipeline = cors sizelimit url_normalize admin_version_service

    [composite:main]
    use = egg:Paste#urlmap
    /v2.0 = public_api
    /v3 = api_v3
    / = public_version_api

    [composite:admin]
    use = egg:Paste#urlmap
    /v2.0 = admin_api
    /v3 = api_v3
    / = admin_version_api

  keystone.conf: |+
    [DEFAULT]
    debug = True
    log_file = /var/log/kolla/keystone/keystone.log
    secure_proxy_ssl_header = HTTP_X_FORWARDED_PROTO

    [database]
    connection = mysql+pymysql://keystone:Mz3JMT2Yy55qyZ49dscAop6sJFIqCWvFJuW6p4ni@mariadb/keystone
    max_retries = -1

    [token]
    provider = uuid

    [cache]
    backend = oslo_cache.memcache_pool
    enabled = False
    memcache_servers = memcached

  wsgi-keystone.conf: |
    Listen 0.0.0.0:5000
    Listen 0.0.0.0:35357

    <VirtualHost *:5000>
        WSGIDaemonProcess keystone-public processes=1 threads=1 user=keystone group=keystone display-name=%{GROUP} python-path=/usr/lib/python2.7/site-packages
        WSGIProcessGroup keystone-public
        WSGIScriptAlias / /var/www/cgi-bin/keystone/main
        WSGIApplicationGroup %{GLOBAL}
        WSGIPassAuthorization On
        <IfVersion >= 2.4>
          ErrorLogFormat "%{cu}t %M"
        </IfVersion>
        ErrorLog "/var/log/kolla/keystone/keystone-apache-public-error.log"
        LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\"" logformat
        CustomLog "/var/log/kolla/keystone/keystone-apache-public-access.log" logformat
    </VirtualHost>

    <VirtualHost *:35357>
        WSGIDaemonProcess keystone-admin processes=1 threads=1 user=keystone group=keystone display-name=%{GROUP} python-path=/usr/lib/python2.7/site-packages
        WSGIProcessGroup keystone-admin
        WSGIScriptAlias / /var/www/cgi-bin/keystone/admin
        WSGIApplicationGroup %{GLOBAL}
        WSGIPassAuthorization On
        <IfVersion >= 2.4>
          ErrorLogFormat "%{cu}t %M"
        </IfVersion>
        ErrorLog "/var/log/kolla/keystone/keystone-apache-admin-error.log"
        LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\"" logformat
        CustomLog "/var/log/kolla/keystone/keystone-apache-admin-access.log" logformat
    </VirtualHost>
kind: ConfigMap
metadata:
  name: keystone
