{% set cloudkitty_cmd = 'apache2' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd' %}
{% set cloudkitty_dir = 'apache2/conf-enabled' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd/conf.d' %}
{
    "command": "{{ cloudkitty_cmd }} -DFOREGROUND",
    "config_files": [
        {
            "source": "{{ container_config_directory }}/cloudkitty.conf",
            "dest": "/etc/cloudkitty/cloudkitty.conf",
            "owner": "cloudkitty",
            "perm": "0600"
        },
        {
            "source": "{{ container_config_directory }}/wsgi-cloudkitty.conf",
            "dest": "/etc/{{ cloudkitty_dir }}/wsgi-cloudkitty.conf",
            "owner": "cloudkitty",
            "perm": "0600"
        }{% if cloudkitty_policy_file is defined %},
        {
            "source": "{{ container_config_directory }}/{{ cloudkitty_policy_file }}",
            "dest": "/etc/cloudkitty/{{ cloudkitty_policy_file }}",
            "owner": "cloudkitty",
            "perm": "0600"
        }{% endif %}{% if cloudkitty_custom_metrics_used %},
        {
            "source": "{{ container_config_directory }}/{{ cloudkitty_custom_metrics_yaml_file }}",
            "dest": "/etc/cloudkitty/{{ cloudkitty_custom_metrics_yaml_file }}",
            "owner": "cloudkitty",
            "perm": "0600"
        }{% endif %}{% 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 %}
    ],
    "permissions": [
        {
            "path": "/var/log/kolla/cloudkitty",
            "owner": "cloudkitty:cloudkitty",
            "recurse": true
        }
    ]
}
