1 heat_template_version: pike
4 OpenStack Glance service configured with Puppet
10 DockerGlanceApiConfigImage:
11 description: The container image to use for the glance_api 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
44 description: The short name of the Glance backend to use. Should be one
45 of swift, rbd, cinder, or file
48 - allowed_values: ['swift', 'file', 'rbd', 'cinder']
52 When using GlanceBackend 'file', mount NFS share for image storage.
54 UpgradeRemoveUnusedPackages:
56 description: Remove package if the service is being disabled during upgrade
61 internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
62 nfs_backend_enabled: {equals: [{get_param: GlanceNfsEnabled}, true]}
63 cinder_backend_enabled: {equals: [{get_param: GlanceBackend}, cinder]}
69 type: ./containers-common.yaml
72 type: ../../puppet/services/database/mysql-client.yaml
75 type: ../../puppet/services/glance-api.yaml
77 EndpointMap: {get_param: EndpointMap}
78 ServiceData: {get_param: ServiceData}
79 ServiceNetMap: {get_param: ServiceNetMap}
80 DefaultPasswords: {get_param: DefaultPasswords}
81 RoleName: {get_param: RoleName}
82 RoleParameters: {get_param: RoleParameters}
86 description: Role data for the Glance API role.
88 service_name: {get_attr: [GlanceApiPuppetBase, role_data, service_name]}
91 - get_attr: [GlanceApiPuppetBase, role_data, config_settings]
92 - glance::api::sync_db: false
93 logging_source: {get_attr: [GlanceApiPuppetBase, role_data, logging_source]}
94 logging_groups: {get_attr: [GlanceApiPuppetBase, role_data, logging_groups]}
95 step_config: &step_config
98 - - {get_attr: [GlanceApiPuppetBase, role_data, step_config]}
99 - {get_attr: [MySQLClient, role_data, step_config]}
100 service_config_settings: {get_attr: [GlanceApiPuppetBase, role_data, service_config_settings]}
101 # BEGIN DOCKER SETTINGS #
103 config_volume: glance_api
104 puppet_tags: glance_api_config,glance_api_paste_ini,glance_swift_config,glance_cache_config
105 step_config: *step_config
106 config_image: {get_param: DockerGlanceApiConfigImage}
108 /var/lib/kolla/config_files/glance_api.json:
109 command: /usr/bin/glance-api --config-file /usr/share/glance/glance-api-dist.conf --config-file /etc/glance/glance-api.conf
111 - source: "/var/lib/kolla/config_files/src/*"
114 preserve_properties: true
115 - source: "/var/lib/kolla/config_files/src-ceph/"
118 preserve_properties: true
119 /var/lib/kolla/config_files/glance_api_tls_proxy.json:
120 command: /usr/sbin/httpd -DFOREGROUND
122 - source: "/var/lib/kolla/config_files/src/*"
125 preserve_properties: true
127 # Kolla_bootstrap/db_sync runs before permissions set by kolla_config
130 image: &glance_api_image {get_param: DockerGlanceApiImage}
134 - /var/log/containers/glance:/var/log/glance
135 - /var/log/containers/httpd/glance-api:/var/log/httpd
136 command: ['/bin/bash', '-c', 'chown -R glance:glance /var/log/glance']
139 image: *glance_api_image
144 volumes: &glance_volumes
146 - {get_attr: [ContainersCommon, volumes]}
148 - /var/lib/kolla/config_files/glance_api.json:/var/lib/kolla/config_files/config.json
149 - /var/lib/config-data/puppet-generated/glance_api/:/var/lib/kolla/config_files/src:ro
150 - /var/log/containers/glance:/var/log/glance
151 - /var/log/containers/httpd/glance-api:/var/log/httpd
152 - /etc/ceph:/var/lib/kolla/config_files/src-ceph:ro
155 - nfs_backend_enabled
156 - /var/lib/glance:/var/lib/glance
160 - cinder_backend_enabled
162 - /etc/iscsi:/etc/iscsi
165 - KOLLA_BOOTSTRAP=True
166 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
167 command: "/usr/bin/bootstrap_host_exec glance_api su glance -s /bin/bash -c '/usr/local/bin/kolla_start'"
172 image: *glance_api_image
174 privileged: {if: [cinder_backend_enabled, true, false]}
176 volumes: *glance_volumes
178 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
180 - internal_tls_enabled
181 - glance_api_tls_proxy:
183 image: *glance_api_image
189 - {get_attr: [ContainersCommon, volumes]}
191 - /var/lib/kolla/config_files/glance_api_tls_proxy.json:/var/lib/kolla/config_files/config.json:ro
192 - /var/lib/config-data/puppet-generated/glance_api/:/var/lib/kolla/config_files/src:ro
193 - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
194 - /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
196 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
199 - name: create persistent logs directory
204 - /var/log/containers/glance
205 - /var/log/containers/httpd/glance-api
206 - name: ensure ceph configurations exist
211 - name: Stop and disable glance_api service
213 service: name=openstack-glance-api state=stopped enabled=no
214 - name: Remove openstack-glance package if operator requests it
215 yum: name=openstack-glance state=removed
218 when: {get_param: UpgradeRemoveUnusedPackages}
220 get_attr: [GlanceApiPuppetBase, role_data, metadata_settings]