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
45 When using GlanceBackend 'file', mount NFS share for image storage.
47 UpgradeRemoveUnusedPackages:
49 description: Remove package if the service is being disabled during upgrade
54 NFS share to mount for image storage (when GlanceNfsEnabled is true)
57 default: 'intr,context=system_u:object_r:glance_var_lib_t:s0'
59 NFS mount options for image storage (when GlanceNfsEnabled is true)
64 internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
65 nfs_backend_enabled: {equals: [{get_param: GlanceNfsEnabled}, true]}
71 type: ./containers-common.yaml
74 type: ../../puppet/services/database/mysql-client.yaml
77 type: ../../puppet/services/glance-api.yaml
79 EndpointMap: {get_param: EndpointMap}
80 ServiceData: {get_param: ServiceData}
81 ServiceNetMap: {get_param: ServiceNetMap}
82 DefaultPasswords: {get_param: DefaultPasswords}
83 RoleName: {get_param: RoleName}
84 RoleParameters: {get_param: RoleParameters}
88 description: Role data for the Glance API role.
90 service_name: {get_attr: [GlanceApiPuppetBase, role_data, service_name]}
93 - get_attr: [GlanceApiPuppetBase, role_data, config_settings]
94 - glance::api::sync_db: false
95 logging_source: {get_attr: [GlanceApiPuppetBase, role_data, logging_source]}
96 logging_groups: {get_attr: [GlanceApiPuppetBase, role_data, logging_groups]}
97 step_config: &step_config
100 - - {get_attr: [GlanceApiPuppetBase, role_data, step_config]}
101 - {get_attr: [MySQLClient, role_data, step_config]}
102 service_config_settings: {get_attr: [GlanceApiPuppetBase, role_data, service_config_settings]}
103 # BEGIN DOCKER SETTINGS #
105 config_volume: glance_api
106 puppet_tags: glance_api_config,glance_api_paste_ini,glance_swift_config,glance_cache_config
107 step_config: *step_config
108 config_image: {get_param: DockerGlanceApiConfigImage}
110 /var/lib/kolla/config_files/glance_api.json:
111 command: /usr/bin/glance-api --config-file /usr/share/glance/glance-api-dist.conf --config-file /etc/glance/glance-api.conf
113 - source: "/var/lib/kolla/config_files/src/*"
116 preserve_properties: true
117 - source: "/var/lib/kolla/config_files/src-ceph/"
120 preserve_properties: true
122 - path: /var/lib/glance
125 /var/lib/kolla/config_files/glance_api_tls_proxy.json:
126 command: /usr/sbin/httpd -DFOREGROUND
128 - source: "/var/lib/kolla/config_files/src/*"
131 preserve_properties: true
133 # Kolla_bootstrap/db_sync runs before permissions set by kolla_config
136 image: &glance_api_image {get_param: DockerGlanceApiImage}
140 - /var/log/containers/glance:/var/log/glance
141 - /var/log/containers/httpd/glance-api:/var/log/httpd
142 command: ['/bin/bash', '-c', 'chown -R glance:glance /var/log/glance']
145 image: *glance_api_image
150 volumes: &glance_volumes
152 - {get_attr: [ContainersCommon, volumes]}
154 - /var/lib/kolla/config_files/glance_api.json:/var/lib/kolla/config_files/config.json
155 - /var/lib/config-data/puppet-generated/glance_api/:/var/lib/kolla/config_files/src:ro
156 - /var/log/containers/glance:/var/log/glance
157 - /var/log/containers/httpd/glance-api:/var/log/httpd
158 - /etc/ceph:/var/lib/kolla/config_files/src-ceph:ro
161 - nfs_backend_enabled
162 - /var/lib/glance:/var/lib/glance
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
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: Mount NFS on host
201 nfs_backend_enable: {get_param: GlanceNfsEnabled}
202 mount: name=/var/lib/glance src="{{item.NFS_SHARE}}" fstype=nfs4 opts="{{item.NFS_OPTIONS}}" state=mounted
204 - NFS_SHARE: {get_param: GlanceNfsShare}
205 NFS_OPTIONS: {get_param: GlanceNfsOptions}
208 - name: create persistent logs directory
213 - /var/log/containers/glance
214 - /var/log/containers/httpd/glance-api
215 - name: ensure ceph configurations exist
220 - name: Stop and disable glance_api service
222 service: name=openstack-glance-api state=stopped enabled=no
223 - name: Remove openstack-glance package if operator requests it
224 yum: name=openstack-glance state=removed
227 when: {get_param: UpgradeRemoveUnusedPackages}
229 get_attr: [GlanceApiPuppetBase, role_data, metadata_settings]