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
92 # db sync runs before permissions set by kolla_config
95 image: &nova_api_image {get_param: DockerNovaApiImage}
99 - /var/log/containers/nova:/var/log/nova
100 command: ['/bin/bash', '-c', 'chown -R nova:nova /var/log/nova']
104 image: *nova_api_image
108 volumes: &nova_api_bootstrap_volumes
110 - {get_attr: [ContainersCommon, volumes]}
112 - /var/lib/config-data/nova/etc/nova/:/etc/nova/:ro
113 - /var/log/containers/nova:/var/log/nova
114 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage api_db sync'"
115 # FIXME: we probably want to wait on the 'cell_v2 update' in order for this
116 # to be capable of upgrading a baremetal setup. This is to ensure the name
117 # of the cell is 'default'
120 image: *nova_api_image
124 volumes: *nova_api_bootstrap_volumes
125 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 map_cell0'"
126 nova_api_create_default_cell:
128 image: *nova_api_image
131 volumes: *nova_api_bootstrap_volumes
132 # NOTE: allowing the exit code 2 is a dirty way of making
133 # this idempotent (if the resource already exists a conflict
137 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 create_cell --name=default'"
140 image: *nova_api_image
143 volumes: *nova_api_bootstrap_volumes
145 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage db sync'"
149 image: *nova_api_image
154 volumes: &nova_api_volumes
156 - {get_attr: [ContainersCommon, volumes]}
158 - /var/lib/kolla/config_files/nova_api.json:/var/lib/kolla/config_files/config.json:ro
159 - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro
160 - /var/log/containers/nova:/var/log/nova
162 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
164 image: *nova_api_image
169 volumes: *nova_api_volumes
171 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
172 command: "/usr/sbin/crond -n"
174 nova_api_discover_hosts:
176 image: *nova_api_image
179 volumes: *nova_api_bootstrap_volumes
181 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 discover_hosts'"
183 - name: create persistent logs directory
185 path: /var/log/containers/nova
188 - name: Stop and disable nova_api service
190 service: name=openstack-nova-api state=stopped enabled=no