1 heat_template_version: pike
4 OpenStack containerized Nova API service
10 DockerNovaConfigImage:
11 description: The container image to use for the nova config_volume
15 description: Mapping of service endpoint -> protocol. Typically set
16 via parameter_defaults in the resource registry.
20 description: Mapping of service_name -> network name. Typically set
21 via parameter_defaults in the resource registry. This
22 mapping overrides those in ServiceNetMapDefaults.
29 description: Role name on which the service is applied
33 description: Parameters specific to the role
39 type: ./containers-common.yaml
42 type: ../../puppet/services/nova-api.yaml
44 EndpointMap: {get_param: EndpointMap}
45 ServiceNetMap: {get_param: ServiceNetMap}
46 DefaultPasswords: {get_param: DefaultPasswords}
47 RoleName: {get_param: RoleName}
48 RoleParameters: {get_param: RoleParameters}
52 description: Role data for the Nova API role.
54 service_name: {get_attr: [NovaApiBase, role_data, service_name]}
57 - get_attr: [NovaApiBase, role_data, config_settings]
58 - apache::default_vhost: false
59 nova_wsgi_enabled: false
60 nova::api::service_name: '%{::nova::params::api_service_name}'
61 nova::wsgi::apache_api::ssl: false
62 step_config: &step_config
65 - - "['Nova_cell_v2'].each |String $val| { noop_resource($val) }"
66 - {get_attr: [NovaApiBase, role_data, step_config]}
67 service_config_settings: {get_attr: [NovaApiBase, role_data, service_config_settings]}
68 # BEGIN DOCKER SETTINGS
71 puppet_tags: nova_config
72 step_config: *step_config
73 config_image: {get_param: DockerNovaConfigImage}
75 /var/lib/kolla/config_files/nova_api.json:
76 command: /usr/bin/nova-api
78 - source: "/var/lib/kolla/config_files/src/*"
81 preserve_properties: true
87 # db sync runs before permissions set by kolla_config
90 image: &nova_api_image {get_param: DockerNovaApiImage}
94 - /var/log/containers/nova:/var/log/nova
95 command: ['/bin/bash', '-c', 'chown -R nova:nova /var/log/nova']
99 image: *nova_api_image
103 volumes: &nova_api_bootstrap_volumes
105 - {get_attr: [ContainersCommon, volumes]}
107 - /var/lib/config-data/nova/etc/nova/:/etc/nova/:ro
108 - /var/log/containers/nova:/var/log/nova
109 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage api_db sync'"
110 # FIXME: we probably want to wait on the 'cell_v2 update' in order for this
111 # to be capable of upgrading a baremetal setup. This is to ensure the name
112 # of the cell is 'default'
115 image: *nova_api_image
119 volumes: *nova_api_bootstrap_volumes
120 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 map_cell0'"
121 nova_api_create_default_cell:
123 image: *nova_api_image
126 volumes: *nova_api_bootstrap_volumes
127 # NOTE: allowing the exit code 2 is a dirty way of making
128 # this idempotent (if the resource already exists a conflict
132 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 create_cell --name=default'"
135 image: *nova_api_image
138 volumes: *nova_api_bootstrap_volumes
140 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage db sync'"
144 image: *nova_api_image
149 volumes: &nova_api_volumes
151 - {get_attr: [ContainersCommon, volumes]}
153 - /var/lib/kolla/config_files/nova_api.json:/var/lib/kolla/config_files/config.json:ro
154 - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro
155 - /var/log/containers/nova:/var/log/nova
157 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
159 image: *nova_api_image
164 volumes: *nova_api_volumes
166 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
167 command: "/usr/sbin/crond -n"
169 nova_api_discover_hosts:
171 image: *nova_api_image
174 volumes: *nova_api_bootstrap_volumes
176 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 discover_hosts'"
178 - name: create persistent logs directory
180 path: /var/log/containers/nova
183 - name: Stop and disable nova_api service
185 service: name=openstack-nova-api state=stopped enabled=no