Merge "Remove empty metadata_settings from iscsid and multipathd templates"
[apex-tripleo-heat-templates.git] / docker / services / panko-api.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Panko service configured with docker.
5   Note, this service is deprecated in Pike release and
6   will be disabled in future releases.
7
8 parameters:
9   DockerPankoApiImage:
10     description: image
11     type: string
12   DockerPankoConfigImage:
13     description: The container image to use for the panko config_volume
14     type: string
15   EndpointMap:
16     default: {}
17     description: Mapping of service endpoint -> protocol. Typically set
18                  via parameter_defaults in the resource registry.
19     type: json
20   ServiceData:
21     default: {}
22     description: Dictionary packing service data
23     type: json
24   ServiceNetMap:
25     default: {}
26     description: Mapping of service_name -> network name. Typically set
27                  via parameter_defaults in the resource registry.  This
28                  mapping overrides those in ServiceNetMapDefaults.
29     type: json
30   DefaultPasswords:
31     default: {}
32     type: json
33   RoleName:
34     default: ''
35     description: Role name on which the service is applied
36     type: string
37   RoleParameters:
38     default: {}
39     description: Parameters specific to the role
40     type: json
41   EnableInternalTLS:
42     type: boolean
43     default: false
44
45 conditions:
46
47   internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
48
49 resources:
50
51   ContainersCommon:
52     type: ./containers-common.yaml
53
54   MySQLClient:
55     type: ../../puppet/services/database/mysql-client.yaml
56
57   PankoApiPuppetBase:
58     type: ../../puppet/services/panko-api.yaml
59     properties:
60       EndpointMap: {get_param: EndpointMap}
61       ServiceData: {get_param: ServiceData}
62       ServiceNetMap: {get_param: ServiceNetMap}
63       DefaultPasswords: {get_param: DefaultPasswords}
64       RoleName: {get_param: RoleName}
65       RoleParameters: {get_param: RoleParameters}
66
67 outputs:
68   role_data:
69     description: Role data for the Panko API role.
70     value:
71       service_name: {get_attr: [PankoApiPuppetBase, role_data, service_name]}
72       config_settings:
73         map_merge:
74           - get_attr: [PankoApiPuppetBase, role_data, config_settings]
75           - apache::default_vhost: false
76       step_config: &step_config
77         list_join:
78           - "\n"
79           - - {get_attr: [PankoApiPuppetBase, role_data, step_config]}
80             - {get_attr: [MySQLClient, role_data, step_config]}
81       service_config_settings: {get_attr: [PankoApiPuppetBase, role_data, service_config_settings]}
82       # BEGIN DOCKER SETTINGS #
83       puppet_config:
84         config_volume: panko
85         puppet_tags: panko_api_paste_ini,panko_config
86         step_config: *step_config
87         config_image: {get_param: DockerPankoConfigImage}
88       kolla_config:
89         /var/lib/kolla/config_files/panko_api.json:
90           command: /usr/sbin/httpd -DFOREGROUND
91           config_files:
92             - source: "/var/lib/kolla/config_files/src/*"
93               dest: "/"
94               merge: true
95               preserve_properties: true
96           permissions:
97             - path: /var/log/panko
98               owner: panko:panko
99               recurse: true
100       docker_config:
101         step_2:
102           panko_init_log:
103             image: &panko_api_image {get_param: DockerPankoApiImage}
104             user: root
105             volumes:
106               - /var/log/containers/panko:/var/log/panko
107             command: ['/bin/bash', '-c', 'mkdir -p /var/log/httpd; chown -R panko:panko /var/log/panko']
108         step_3:
109           panko_db_sync:
110             image: *panko_api_image
111             net: host
112             detach: false
113             privileged: false
114             user: root
115             volumes:
116               list_concat:
117                 - {get_attr: [ContainersCommon, volumes]}
118                 -
119                   - /var/lib/config-data/panko/etc/panko:/etc/panko:ro
120                   - /var/log/containers/panko:/var/log/panko
121             command: "/usr/bin/bootstrap_host_exec panko_api su panko -s /bin/bash -c '/usr/bin/panko-dbsync'"
122         step_4:
123           panko_api:
124             start_order: 2
125             image: *panko_api_image
126             net: host
127             privileged: false
128             restart: always
129             volumes:
130               list_concat:
131                 - {get_attr: [ContainersCommon, volumes]}
132                 -
133                   - /var/lib/kolla/config_files/panko_api.json:/var/lib/kolla/config_files/config.json:ro
134                   - /var/lib/config-data/puppet-generated/panko/:/var/lib/kolla/config_files/src:ro
135                   - /var/log/containers/panko:/var/log/panko
136                   -
137                     if:
138                       - internal_tls_enabled
139                       - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
140                       - ''
141                   -
142                     if:
143                       - internal_tls_enabled
144                       - /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
145                       - ''
146             environment:
147               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
148       host_prep_tasks:
149         - name: create persistent logs directory
150           file:
151             path: /var/log/containers/panko
152             state: directory
153       metadata_settings:
154         get_attr: [PankoApiPuppetBase, role_data, metadata_settings]