1 heat_template_version: pike
4 OpenStack containerized Barbican API service
7 DockerBarbicanApiImage:
10 DockerBarbicanConfigImage:
11 description: The container image to use for the barbican 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
42 UpgradeRemoveUnusedPackages:
44 description: Remove package if the service is being disabled during upgrade
49 internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
54 type: ./containers-common.yaml
57 type: ../../puppet/services/database/mysql-client.yaml
60 type: ../../puppet/services/barbican-api.yaml
62 EndpointMap: {get_param: EndpointMap}
63 ServiceData: {get_param: ServiceData}
64 ServiceNetMap: {get_param: ServiceNetMap}
65 DefaultPasswords: {get_param: DefaultPasswords}
66 RoleName: {get_param: RoleName}
67 RoleParameters: {get_param: RoleParameters}
71 description: Role data for the Barbican API role.
73 service_name: {get_attr: [BarbicanApiBase, role_data, service_name]}
76 - get_attr: [BarbicanApiBase, role_data, config_settings]
77 - apache::default_vhost: false
78 logging_source: {get_attr: [BarbicanApiBase, role_data, logging_source]}
79 logging_groups: {get_attr: [BarbicanApiBase, role_data, logging_groups]}
80 step_config: &step_config
83 - - {get_attr: [BarbicanApiBase, role_data, step_config]}
84 - {get_attr: [MySQLClient, role_data, step_config]}
85 service_config_settings: {get_attr: [BarbicanApiBase, role_data, service_config_settings]}
86 # BEGIN DOCKER SETTINGS
88 config_volume: barbican
89 puppet_tags: barbican_api_paste_ini,barbican_config
90 step_config: *step_config
91 config_image: {get_param: DockerBarbicanConfigImage}
93 /var/lib/kolla/config_files/barbican_api.json:
94 command: /usr/sbin/httpd -DFOREGROUND
96 - source: "/var/lib/kolla/config_files/src/*"
99 preserve_properties: true
101 # db sync runs before permissions set by kolla_config
104 image: &barbican_api_image {get_param: DockerBarbicanApiImage}
108 - /var/log/containers/barbican:/var/log/barbican
109 command: ['/bin/bash', '-c', 'chown -R barbican:barbican /var/log/barbican']
111 barbican_api_db_sync:
113 image: *barbican_api_image
117 volumes: &barbican_api_volumes
119 - {get_attr: [ContainersCommon, volumes]}
121 - /var/lib/config-data/barbican/etc/barbican/:/etc/barbican/:ro
122 - /var/log/containers/barbican:/var/log/barbican
123 command: "/usr/bin/bootstrap_host_exec barbican_api su barbican -s /bin/bash -c '/usr/bin/barbican-manage db upgrade'"
126 image: *barbican_api_image
133 - {get_attr: [ContainersCommon, volumes]}
135 - /var/lib/kolla/config_files/barbican_api.json:/var/lib/kolla/config_files/config.json:ro
136 - /var/log/containers/barbican:/var/log/barbican
137 - /var/lib/config-data/puppet-generated/barbican/:/var/lib/kolla/config_files/src:ro
140 - internal_tls_enabled
141 - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
145 - internal_tls_enabled
146 - /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
149 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
151 - name: create persistent logs directory
153 path: /var/log/containers/barbican
156 - name: Stop and disable barbican_api service
158 service: name=openstack-barbican-api state=stopped enabled=no
159 - name: Remove openstack-barbican-api package if operator requests it
160 yum: name=openstack-barbican-api state=removed
163 when: {get_param: UpgradeRemoveUnusedPackages}
165 get_attr: [BarbicanApiBase, role_data, metadata_settings]