100 lines
3.6 KiB
YAML
100 lines
3.6 KiB
YAML
dsl_version: 0.4.0
|
|
service:
|
|
name: glance-api
|
|
ports:
|
|
- {{ glance.api_port }}
|
|
annotations:
|
|
service:
|
|
prometheus.io/probe: "true"
|
|
prometheus.io/probe_path: "/healthcheck"
|
|
containers:
|
|
- name: glance-api
|
|
image: glance-api
|
|
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 }};
|
|
create user '{{ glance.db.username }}'@'%' identified by '{{ glance.db.password }}'
|
|
{% if db.tls.enabled %} require ssl {% endif %};
|
|
grant all privileges on {{ glance.db.name }}.* to '{{ glance.db.username }}'@'%' identified by '{{ glance.db.password }}'
|
|
{% if db.tls.enabled %} require ssl {% endif %};"
|
|
- name: glance-db-sync
|
|
files:
|
|
- glance-api
|
|
dependencies:
|
|
- glance-db-create
|
|
type: single
|
|
command: glance-manage db_sync
|
|
- name: glance-user-create
|
|
dependencies:
|
|
- keystone-create-domain
|
|
type: single
|
|
command: openstack user create --domain {{ service_account.domain }} --password {{ glance.password }} {{ glance.user }}
|
|
- name: glance-role-add
|
|
dependencies:
|
|
- glance-user-create
|
|
type: single
|
|
command: openstack role add --project {{ service_account.project }} --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 {{ address('glance-api', glance.api_port, with_scheme=True) }}
|
|
- name: glance-admin-endpoint-create
|
|
dependencies:
|
|
- glance-service-create
|
|
type: single
|
|
command: openstack endpoint create --region RegionOne image admin {{ address('glance-api', glance.api_port, with_scheme=True) }}
|
|
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
|
|
dependencies:
|
|
- memcached
|
|
# {% if glance.bootstrap.enable %}
|
|
post:
|
|
- name: glance-cirros-image-upload
|
|
type: single
|
|
command: /opt/ccp/bin/glance-cirros-image-upload.sh
|
|
files:
|
|
- glance-cirros-image-upload.sh
|
|
# {% endif %}
|
|
|
|
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.ceph.username }}.keyring
|
|
content: ceph.client.glance.keyring.j2
|
|
glance-swift-conf:
|
|
path: /etc/glance/glance-swift-store.conf
|
|
content: glance-swift-store.conf.j2
|
|
glance-cirros-image-upload.sh:
|
|
path: /opt/ccp/bin/glance-cirros-image-upload.sh
|
|
content: glance-cirros-image-upload.sh.j2
|
|
perm: "500"
|