124 lines
4.7 KiB
YAML
124 lines
4.7 KiB
YAML
dsl_version: 0.4.0
|
|
service:
|
|
name: nova-api
|
|
ports:
|
|
- {{ nova.api_port }}
|
|
- {{ nova.metadata.port }}
|
|
annotations:
|
|
service:
|
|
prometheus.io/probe: "true"
|
|
containers:
|
|
- name: nova-api
|
|
image: nova-api
|
|
privileged: true
|
|
pre:
|
|
- name: nova-db-create
|
|
type: single
|
|
command: mysql -v -u root -p{{ db.root_password }} -h {{ address(service.database) }} -e 'create database `{{ nova.db.name }}`;
|
|
create database `{{ nova.db.api_name }}`;
|
|
grant all privileges on `{{ nova.db.name }}`.* to "{{ nova.db.username }}"@"%" identified by "{{ nova.db.password }}";
|
|
grant all privileges on `{{ nova.db.api_name }}`.* to "{{ nova.db.username }}"@"%" identified by "{{ nova.db.password }}"'
|
|
dependencies:
|
|
- {{ service.database }}
|
|
files:
|
|
- nova.conf
|
|
- name: nova-db-sync
|
|
type: single
|
|
command: nova-manage db sync
|
|
dependencies:
|
|
- nova-db-create
|
|
files:
|
|
- nova.conf
|
|
- name: nova-api-db-sync
|
|
type: single
|
|
command: nova-manage api_db sync
|
|
dependencies:
|
|
- nova-db-sync
|
|
files:
|
|
- nova.conf
|
|
- name: nova-db-migrations
|
|
type: single
|
|
command: nova-manage db online_data_migrations
|
|
dependencies:
|
|
- nova-api-db-sync
|
|
files:
|
|
- nova.conf
|
|
- name: nova-user-create
|
|
type: single
|
|
command: openstack user create --project service --password {{ nova.db.password }} {{ nova.db.username }}
|
|
dependencies:
|
|
- keystone-create-project
|
|
- name: nova-role-add
|
|
dependencies:
|
|
- nova-user-create
|
|
type: single
|
|
command: openstack role add --project service --user {{ nova.db.username }} admin
|
|
|
|
- name: nova-service-legacy-create
|
|
dependencies:
|
|
- keystone
|
|
type: single
|
|
command: openstack service create --name nova_legacy --description "Nova Compute Service (Legacy 2.0)" compute_legacy
|
|
- name: nova-public-legacy-endpoint-create
|
|
dependencies:
|
|
- nova-service-legacy-create
|
|
type: single
|
|
command: openstack endpoint create --region RegionOne compute_legacy public {{ address('nova-api', nova.api_port, external=True, with_scheme=True) }}/v2/$\(project_id\)s
|
|
- name: nova-internal-legacy-endpoint-create
|
|
dependencies:
|
|
- nova-service-legacy-create
|
|
type: single
|
|
command: openstack endpoint create --region RegionOne compute_legacy internal {{ address('nova-api', nova.api_port, with_scheme=True) }}/v2/$\(project_id\)s
|
|
- name: nova-admin-legacy-endpoint-create
|
|
dependencies:
|
|
- nova-service-legacy-create
|
|
type: single
|
|
command: openstack endpoint create --region RegionOne compute_legacy admin {{ address('nova-api', nova.api_port, with_scheme=True) }}/v2/$\(project_id\)s
|
|
|
|
- name: nova-service-create
|
|
dependencies:
|
|
- keystone
|
|
type: single
|
|
command: openstack service create --name nova --description "Nova Compute Service" compute
|
|
- name: nova-public-endpoint-create
|
|
dependencies:
|
|
- nova-service-create
|
|
type: single
|
|
command: openstack endpoint create --region RegionOne compute public {{ address('nova-api', nova.api_port, external=True, with_scheme=True) }}/v2.1
|
|
- name: nova-internal-endpoint-create
|
|
dependencies:
|
|
- nova-service-create
|
|
type: single
|
|
command: openstack endpoint create --region RegionOne compute internal {{ address('nova-api', nova.api_port, with_scheme=True) }}/v2.1
|
|
- name: nova-admin-endpoint-create
|
|
dependencies:
|
|
- nova-service-create
|
|
type: single
|
|
command: openstack endpoint create --region RegionOne compute admin {{ address('nova-api', nova.api_port, with_scheme=True) }}/v2.1
|
|
|
|
daemon:
|
|
command: nova-api --config-file /etc/nova/nova.conf
|
|
files:
|
|
- nova.conf
|
|
# {% if nova.bootstrap.enable %}
|
|
post:
|
|
# {% for flavor in nova.bootstrap.flavors %}
|
|
- name: nova-bootstrap-flavor-{{ flavor.id }}
|
|
type: single
|
|
command: /opt/ccp/bin/create-flavor.sh {{ flavor.name }} {{ flavor.id }} {{ flavor.ram }} {{ flavor.disk }} {{ flavor.vcpus }}
|
|
files:
|
|
- create-flavor.sh
|
|
# {% endfor %}
|
|
# {% endif %}
|
|
|
|
files:
|
|
nova.conf:
|
|
path: /etc/nova/nova.conf
|
|
content: nova.conf.j2
|
|
perm: "0600"
|
|
|
|
create-flavor.sh:
|
|
path: /opt/ccp/bin/create-flavor.sh
|
|
content: create-flavor.sh.j2
|
|
perm: "0700"
|