name: openstack/glance-api/glance-api
enabled: {{ enable_glance | bool }}
container:
  image: "{{ glance_api_image }}:{{ glance_api_tag }}"
  parameters:
    - key: volume
      value: "kolla_logs_{{ deployment_id }}_{{ timestamp }}:/var/log/kolla"
service:
  daemon:
    dependencies:
     - path: glance_ansible_tasks/create_database
     - path: glance_ansible_tasks/database_user_create
     - path: glance-api/db_sync
    command: glance-api
  mem: {{ glance_api_mem }}
  cpus: {{ glance_api_cpus }}
  instances: {{ controller_nodes }}
  constraints: {{ controller_constraints }}
commands:
  extend_start:
    command: kolla_extend_start
  db_sync:
    run_once: True
    dependencies:
     - path: glance_ansible_tasks/create_database
     - path: glance_ansible_tasks/database_user_create
    command: kolla_extend_start
    env:
      KOLLA_BOOTSTRAP:
    files:
      glance.conf.j2:
        source: ["config/glance/templates/glance-api.conf.j2",
                 "config/glance/templates/glance-file.conf.j2",
                 "/etc/kolla-mesos/config/global.conf",
                 "/etc/kolla-mesos/config/database.conf",
                 "/etc/kolla-mesos/config/messaging.conf",
                 "/etc/kolla-mesos/config/glance.conf",
                 "/etc/kolla-mesos/config/glance/glance-api.conf"]
        dest: /etc/glance/glance-api.conf
        owner: glance
        perm: "0600"
