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
43 type: ./containers-common.yaml
46 type: ../../puppet/services/nova-api.yaml
48 EndpointMap: {get_param: EndpointMap}
49 ServiceData: {get_param: ServiceData}
50 ServiceNetMap: {get_param: ServiceNetMap}
51 DefaultPasswords: {get_param: DefaultPasswords}
52 RoleName: {get_param: RoleName}
53 RoleParameters: {get_param: RoleParameters}
57 description: Role data for the Nova API role.
59 service_name: {get_attr: [NovaApiBase, role_data, service_name]}
62 - get_attr: [NovaApiBase, role_data, config_settings]
63 - apache::default_vhost: false
64 nova_wsgi_enabled: false
65 nova::api::service_name: '%{::nova::params::api_service_name}'
66 nova::wsgi::apache_api::ssl: false
67 step_config: &step_config
70 - - "['Nova_cell_v2'].each |String $val| { noop_resource($val) }"
71 - {get_attr: [NovaApiBase, role_data, step_config]}
72 service_config_settings: {get_attr: [NovaApiBase, role_data, service_config_settings]}
73 # BEGIN DOCKER SETTINGS
76 puppet_tags: nova_config
77 step_config: *step_config
78 config_image: {get_param: DockerNovaConfigImage}
80 /var/lib/kolla/config_files/nova_api.json:
81 command: /usr/bin/nova-api
83 - source: "/var/lib/kolla/config_files/src/*"
86 preserve_properties: true
91 /var/lib/kolla/config_files/nova_api_cron.json:
92 command: /usr/sbin/crond -n
94 - source: "/var/lib/kolla/config_files/src/*"
97 preserve_properties: true
103 # db sync runs before permissions set by kolla_config
106 image: &nova_api_image {get_param: DockerNovaApiImage}
110 - /var/log/containers/nova:/var/log/nova
111 command: ['/bin/bash', '-c', 'chown -R nova:nova /var/log/nova']
115 image: *nova_api_image
119 volumes: &nova_api_bootstrap_volumes
121 - {get_attr: [ContainersCommon, volumes]}
123 - /var/lib/config-data/nova/etc/nova/:/etc/nova/:ro
124 - /var/log/containers/nova:/var/log/nova
125 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage api_db sync'"
126 # FIXME: we probably want to wait on the 'cell_v2 update' in order for this
127 # to be capable of upgrading a baremetal setup. This is to ensure the name
128 # of the cell is 'default'
131 image: *nova_api_image
135 volumes: *nova_api_bootstrap_volumes
136 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 map_cell0'"
137 nova_api_create_default_cell:
139 image: *nova_api_image
142 volumes: *nova_api_bootstrap_volumes
143 # NOTE: allowing the exit code 2 is a dirty way of making
144 # this idempotent (if the resource already exists a conflict
148 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 create_cell --name=default'"
151 image: *nova_api_image
154 volumes: *nova_api_bootstrap_volumes
156 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage db sync'"
160 image: *nova_api_image
167 - {get_attr: [ContainersCommon, volumes]}
169 - /var/lib/kolla/config_files/nova_api.json:/var/lib/kolla/config_files/config.json:ro
170 - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro
171 - /var/log/containers/nova:/var/log/nova
173 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
175 image: *nova_api_image
182 - {get_attr: [ContainersCommon, volumes]}
184 - /var/lib/kolla/config_files/nova_api_cron.json:/var/lib/kolla/config_files/config.json:ro
185 - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro
186 - /var/log/containers/nova:/var/log/nova
188 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
190 nova_api_discover_hosts:
192 image: *nova_api_image
195 volumes: *nova_api_bootstrap_volumes
197 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 discover_hosts'"
199 - name: create persistent logs directory
201 path: /var/log/containers/nova
204 - name: Stop and disable nova_api service
206 service: name=openstack-nova-api state=stopped enabled=no