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: Dictionary packing service data
24 description: Mapping of service_name -> network name. Typically set
25 via parameter_defaults in the resource registry. This
26 mapping overrides those in ServiceNetMapDefaults.
33 description: Role name on which the service is applied
37 description: Parameters specific to the role
45 internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
50 type: ./containers-common.yaml
53 type: ../../puppet/services/database/mysql-client.yaml
56 type: ../../puppet/services/nova-api.yaml
58 EndpointMap: {get_param: EndpointMap}
59 ServiceData: {get_param: ServiceData}
60 ServiceNetMap: {get_param: ServiceNetMap}
61 DefaultPasswords: {get_param: DefaultPasswords}
62 RoleName: {get_param: RoleName}
63 RoleParameters: {get_param: RoleParameters}
67 description: Role data for the Nova API role.
69 service_name: {get_attr: [NovaApiBase, role_data, service_name]}
72 - get_attr: [NovaApiBase, role_data, config_settings]
73 - apache::default_vhost: false
74 logging_source: {get_attr: [NovaApiBase, role_data, logging_source]}
75 logging_groups: {get_attr: [NovaApiBase, role_data, logging_groups]}
76 step_config: &step_config
79 - - "['Nova_cell_v2'].each |String $val| { noop_resource($val) }"
80 - {get_attr: [NovaApiBase, role_data, step_config]}
81 - {get_attr: [MySQLClient, role_data, step_config]}
82 service_config_settings: {get_attr: [NovaApiBase, role_data, service_config_settings]}
83 # BEGIN DOCKER SETTINGS
86 puppet_tags: nova_config
87 step_config: *step_config
88 config_image: {get_param: DockerNovaConfigImage}
90 /var/lib/kolla/config_files/nova_api.json:
91 command: /usr/sbin/httpd -DFOREGROUND
93 - source: "/var/lib/kolla/config_files/src/*"
96 preserve_properties: true
101 /var/lib/kolla/config_files/nova_api_cron.json:
102 command: /usr/sbin/crond -n
104 - source: "/var/lib/kolla/config_files/src/*"
107 preserve_properties: true
109 - path: /var/log/nova
113 # db sync runs before permissions set by kolla_config
116 image: &nova_api_image {get_param: DockerNovaApiImage}
120 - /var/log/containers/nova:/var/log/nova
121 - /var/log/containers/httpd/nova-api:/var/log/httpd
122 command: ['/bin/bash', '-c', 'chown -R nova:nova /var/log/nova']
126 image: *nova_api_image
130 volumes: &nova_api_bootstrap_volumes
132 - {get_attr: [ContainersCommon, volumes]}
134 - /var/lib/config-data/nova/etc/my.cnf.d/tripleo.cnf:/etc/my.cnf.d/tripleo.cnf:ro
135 - /var/lib/config-data/nova/etc/nova/:/etc/nova/:ro
136 - /var/log/containers/nova:/var/log/nova
137 - /var/log/containers/httpd/nova-api:/var/log/httpd
138 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage api_db sync'"
139 # FIXME: we probably want to wait on the 'cell_v2 update' in order for this
140 # to be capable of upgrading a baremetal setup. This is to ensure the name
141 # of the cell is 'default'
144 image: *nova_api_image
148 volumes: *nova_api_bootstrap_volumes
149 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 map_cell0'"
150 nova_api_create_default_cell:
152 image: *nova_api_image
155 volumes: *nova_api_bootstrap_volumes
156 # NOTE: allowing the exit code 2 is a dirty way of making
157 # this idempotent (if the resource already exists a conflict
161 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 create_cell --name=default'"
164 image: *nova_api_image
167 volumes: *nova_api_bootstrap_volumes
169 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage db sync'"
173 image: *nova_api_image
180 - {get_attr: [ContainersCommon, volumes]}
182 - /var/lib/kolla/config_files/nova_api.json:/var/lib/kolla/config_files/config.json:ro
183 - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro
184 - /var/log/containers/nova:/var/log/nova
185 - /var/log/containers/httpd/nova-api:/var/log/httpd
188 - internal_tls_enabled
189 - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
193 - internal_tls_enabled
194 - /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
197 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
199 image: *nova_api_image
208 - {get_attr: [ContainersCommon, volumes]}
210 - /var/lib/kolla/config_files/nova_api_cron.json:/var/lib/kolla/config_files/config.json:ro
211 - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro
212 - /var/log/containers/nova:/var/log/nova
213 - /var/log/containers/httpd/nova-api:/var/log/httpd
215 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
217 nova_api_discover_hosts:
219 image: *nova_api_image
222 volumes: *nova_api_bootstrap_volumes
224 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 discover_hosts --verbose'"
226 get_attr: [NovaApiBase, role_data, metadata_settings]
228 - name: create persistent logs directory
233 - /var/log/containers/nova
234 - /var/log/containers/httpd/nova-api
236 - name: Stop and disable nova_api service
238 service: name=openstack-nova-api state=stopped enabled=no
239 - name: remove old nova cron jobs
241 path: /var/spool/cron/nova