1 heat_template_version: pike
4 OpenStack containerized Nova API service
9 default: 'tripleoupstream'
13 default: 'centos-binary-nova-api:latest'
15 DockerNovaConfigImage:
16 description: The container image to use for the nova config_volume
17 default: 'centos-binary-nova-base:latest'
21 description: Mapping of service endpoint -> protocol. Typically set
22 via parameter_defaults in the resource registry.
26 description: Mapping of service_name -> network name. Typically set
27 via parameter_defaults in the resource registry. This
28 mapping overrides those in ServiceNetMapDefaults.
35 description: Role name on which the service is applied
39 description: Parameters specific to the role
45 type: ./containers-common.yaml
48 type: ../../puppet/services/nova-api.yaml
50 EndpointMap: {get_param: EndpointMap}
51 ServiceNetMap: {get_param: ServiceNetMap}
52 DefaultPasswords: {get_param: DefaultPasswords}
53 RoleName: {get_param: RoleName}
54 RoleParameters: {get_param: RoleParameters}
58 description: Role data for the Nova API role.
60 service_name: {get_attr: [NovaApiBase, role_data, service_name]}
63 - get_attr: [NovaApiBase, role_data, config_settings]
64 - apache::default_vhost: false
65 nova_wsgi_enabled: false
66 nova::api::service_name: '%{::nova::params::api_service_name}'
67 nova::wsgi::apache_api::ssl: false
68 step_config: &step_config
71 - - "['Nova_cell_v2'].each |String $val| { noop_resource($val) }"
72 - {get_attr: [NovaApiBase, role_data, step_config]}
73 service_config_settings: {get_attr: [NovaApiBase, role_data, service_config_settings]}
74 # BEGIN DOCKER SETTINGS
77 puppet_tags: nova_config
78 step_config: *step_config
82 - [ {get_param: DockerNamespace}, {get_param: DockerNovaConfigImage} ]
84 /var/lib/kolla/config_files/nova_api.json:
85 command: /usr/bin/nova-api
87 - source: "/var/lib/kolla/config_files/src/*"
90 preserve_properties: true
96 # db sync runs before permissions set by kolla_config
99 image: &nova_api_image
102 - [ {get_param: DockerNamespace}, {get_param: DockerNovaApiImage} ]
106 - /var/log/containers/nova:/var/log/nova
107 command: ['/bin/bash', '-c', 'chown -R nova:nova /var/log/nova']
111 image: *nova_api_image
115 volumes: &nova_api_bootstrap_volumes
117 - {get_attr: [ContainersCommon, volumes]}
119 - /var/lib/config-data/nova/etc/nova/:/etc/nova/:ro
120 - /var/log/containers/nova:/var/log/nova
121 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage api_db sync'"
122 # FIXME: we probably want to wait on the 'cell_v2 update' in order for this
123 # to be capable of upgrading a baremetal setup. This is to ensure the name
124 # of the cell is 'default'
127 image: *nova_api_image
131 volumes: *nova_api_bootstrap_volumes
132 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 map_cell0'"
133 nova_api_create_default_cell:
135 image: *nova_api_image
138 volumes: *nova_api_bootstrap_volumes
139 # NOTE: allowing the exit code 2 is a dirty way of making
140 # this idempotent (if the resource already exists a conflict
144 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 create_cell --name=default'"
147 image: *nova_api_image
150 volumes: *nova_api_bootstrap_volumes
152 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage db sync'"
156 image: *nova_api_image
161 volumes: &nova_api_volumes
163 - {get_attr: [ContainersCommon, volumes]}
165 - /var/lib/kolla/config_files/nova_api.json:/var/lib/kolla/config_files/config.json:ro
166 - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro
167 - /var/log/containers/nova:/var/log/nova
169 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
171 image: *nova_api_image
176 volumes: *nova_api_volumes
178 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
179 command: "/usr/sbin/crond -n"
181 nova_api_discover_hosts:
183 image: *nova_api_image
186 volumes: *nova_api_bootstrap_volumes
188 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 discover_hosts'"
190 - name: create persistent logs directory
192 path: /var/log/containers/nova
195 - name: Stop and disable nova_api service
197 service: name=openstack-nova-api state=stopped enabled=no