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/database/mysql-client.yaml
49 type: ../../puppet/services/nova-api.yaml
51 EndpointMap: {get_param: EndpointMap}
52 ServiceData: {get_param: ServiceData}
53 ServiceNetMap: {get_param: ServiceNetMap}
54 DefaultPasswords: {get_param: DefaultPasswords}
55 RoleName: {get_param: RoleName}
56 RoleParameters: {get_param: RoleParameters}
60 description: Role data for the Nova API role.
62 service_name: {get_attr: [NovaApiBase, role_data, service_name]}
65 - get_attr: [NovaApiBase, role_data, config_settings]
66 - apache::default_vhost: 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 - {get_attr: [MySQLClient, 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
79 config_image: {get_param: DockerNovaConfigImage}
81 /var/lib/kolla/config_files/nova_api.json:
82 command: /usr/sbin/httpd -DFOREGROUND
84 - source: "/var/lib/kolla/config_files/src/*"
87 preserve_properties: true
92 /var/lib/kolla/config_files/nova_api_cron.json:
93 command: /usr/sbin/crond -n
95 - source: "/var/lib/kolla/config_files/src/*"
98 preserve_properties: true
100 - path: /var/log/nova
104 # db sync runs before permissions set by kolla_config
107 image: &nova_api_image {get_param: DockerNovaApiImage}
111 - /var/log/containers/nova:/var/log/nova
112 command: ['/bin/bash', '-c', 'mkdir -p /var/log/httpd; chown -R nova:nova /var/log/nova']
116 image: *nova_api_image
120 volumes: &nova_api_bootstrap_volumes
122 - {get_attr: [ContainersCommon, volumes]}
124 - /var/lib/config-data/nova/etc/nova/:/etc/nova/:ro
125 - /var/log/containers/nova:/var/log/nova
126 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage api_db sync'"
127 # FIXME: we probably want to wait on the 'cell_v2 update' in order for this
128 # to be capable of upgrading a baremetal setup. This is to ensure the name
129 # of the cell is 'default'
132 image: *nova_api_image
136 volumes: *nova_api_bootstrap_volumes
137 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 map_cell0'"
138 nova_api_create_default_cell:
140 image: *nova_api_image
143 volumes: *nova_api_bootstrap_volumes
144 # NOTE: allowing the exit code 2 is a dirty way of making
145 # this idempotent (if the resource already exists a conflict
149 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 create_cell --name=default'"
152 image: *nova_api_image
155 volumes: *nova_api_bootstrap_volumes
157 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage db sync'"
161 image: *nova_api_image
168 - {get_attr: [ContainersCommon, volumes]}
170 - /var/lib/kolla/config_files/nova_api.json:/var/lib/kolla/config_files/config.json:ro
171 - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro
172 - /var/log/containers/nova:/var/log/nova
174 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
176 image: *nova_api_image
183 - {get_attr: [ContainersCommon, volumes]}
185 - /var/lib/kolla/config_files/nova_api_cron.json:/var/lib/kolla/config_files/config.json:ro
186 - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro
187 - /var/log/containers/nova:/var/log/nova
189 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
191 nova_api_discover_hosts:
193 image: *nova_api_image
196 volumes: *nova_api_bootstrap_volumes
198 command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 discover_hosts'"
200 get_attr: [NovaApiBase, role_data, metadata_settings]
202 - name: create persistent logs directory
204 path: /var/log/containers/nova
207 - name: Stop and disable nova_api service
209 service: name=openstack-nova-api state=stopped enabled=no