84 lines
2.9 KiB
YAML
84 lines
2.9 KiB
YAML
service:
|
|
name: glance-api
|
|
ports:
|
|
- {{ glance.api_port }}
|
|
containers:
|
|
- name: glance-api
|
|
image: glance-api
|
|
# TODO(sreshetniak): add probes
|
|
probes:
|
|
readiness: "true"
|
|
liveness:
|
|
command: "true"
|
|
type: "exec"
|
|
pre:
|
|
- name: glance-db-create
|
|
dependencies:
|
|
- {{ service.database }}
|
|
type: single
|
|
command:
|
|
mysql -u root -p{{ db.root_password }} -h {{ address(service.database) }} -e "create database {{ glance.db.name }};
|
|
grant all privileges on {{ glance.db.name }}.* to '{{ glance.db.username }}'@'%' identified by '{{ glance.db.password }}';"
|
|
- name: glance-db-sync
|
|
files:
|
|
- glance-api
|
|
dependencies:
|
|
- glance-db-create
|
|
type: single
|
|
command: glance-manage db_sync
|
|
- name: glance-user-create
|
|
dependencies:
|
|
- keystone
|
|
type: single
|
|
command: openstack user create --domain default --password {{ glance.password }} {{ glance.user }}
|
|
- name: glance-role-add
|
|
dependencies:
|
|
- glance-user-create
|
|
type: single
|
|
command: openstack role add --project {{ openstack.project_name }} --user {{ glance.user }} admin
|
|
- name: glance-service-create
|
|
dependencies:
|
|
- keystone
|
|
type: single
|
|
command: openstack service create --name glance --description "OpenStack Image service" image
|
|
- name: glance-public-endpoint-create
|
|
dependencies:
|
|
- glance-service-create
|
|
type: single
|
|
command: openstack endpoint create --region RegionOne image public {{ address('glance-api', glance.api_port, external=True, with_scheme=True) }}
|
|
- name: glance-internal-endpoint-create
|
|
dependencies:
|
|
- glance-service-create
|
|
type: single
|
|
command: openstack endpoint create --region RegionOne image internal http://{{ address('glance-api') }}:{{ glance.api_port.cont }}
|
|
- name: glance-admin-endpoint-create
|
|
dependencies:
|
|
- glance-service-create
|
|
type: single
|
|
command: openstack endpoint create --region RegionOne image admin http://{{ address('glance-api') }}:{{ glance.api_port.cont }}
|
|
daemon:
|
|
files:
|
|
- glance-api
|
|
# {% if glance.ceph.enable %}
|
|
- ceph-conf
|
|
- glance-ceph-key
|
|
# {% endif %}
|
|
# {% if glance.swift.enable %}
|
|
- glance-swift-conf
|
|
# {% endif %}
|
|
command: glance-api
|
|
|
|
files:
|
|
glance-api:
|
|
path: /etc/glance/glance-api.conf
|
|
content: glance-api.conf.j2
|
|
ceph-conf:
|
|
path: /etc/ceph/ceph.conf
|
|
content: ceph.conf.j2
|
|
glance-ceph-key:
|
|
path: /etc/ceph/ceph.client.glance.keyring
|
|
content: ceph.client.glance.keyring.j2
|
|
glance-swift-conf:
|
|
path: /etc/glance/glance-swift-store.conf
|
|
content: glance-swift-store.conf.j2
|