{% set apache_binary = 'apache2' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd' %}
{% set apache_conf_dir = 'apache2/conf-enabled' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd/conf.d' %}
{
    "command": "/usr/sbin/{{ apache_binary }} -DFOREGROUND",
    "config_files": [
        {
            "source": "{{ container_config_directory }}/trove.conf",
            "dest": "/etc/trove/trove.conf",
            "owner": "trove",
            "perm": "0600"
        },
        {
            "source": "{{ container_config_directory }}/trove-wsgi.conf",
            "dest": "/etc/{{ apache_conf_dir }}/trove-wsgi.conf",
            "owner": "trove",
            "perm": "0600"
        }{% if trove_policy_file is defined %},
        {
            "source": "{{ container_config_directory }}/{{ trove_policy_file }}",
            "dest": "/etc/trove/{{ trove_policy_file }}",
            "owner": "trove",
            "perm": "0600"
        }{% endif %}{% if trove_enable_tls_backend | bool %},
        {
            "source": "{{ container_config_directory }}/trove-cert.pem",
            "dest": "/etc/trove/certs/trove-cert.pem",
            "owner": "trove",
            "perm": "0600"
        },
        {
            "source": "{{ container_config_directory }}/trove-key.pem",
            "dest": "/etc/trove/certs/trove-key.pem",
            "owner": "trove",
            "perm": "0600"
        }{% if kolla_copy_ca_into_containers | bool %},
        {
            "source": "{{ container_config_directory }}/ca-certificates",
            "dest": "/var/lib/kolla/share/ca-certificates",
            "owner": "root",
            "perm": "0600"
        }{% endif %}
    {% endif %}],
    "permissions": [
        {
            "path": "/var/log/kolla/trove",
            "owner": "trove:trove",
            "recurse": true
        },
        {
            "path": "/var/run/trove",
            "owner": "trove:trove"
        }
    ]
}
