Merge "Enable DPDK on boot using PreNetworkConfig"
[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   DockerNamespace:
10     description: namespace
11     default: 'tripleoupstream'
12     type: string
13   DockerPankoApiImage:
14     description: image
15     default: 'centos-binary-panko-api:latest'
16     type: string
17   EndpointMap:
18     default: {}
19     description: Mapping of service endpoint -> protocol. Typically set
20                  via parameter_defaults in the resource registry.
21     type: json
22   ServiceNetMap:
23     default: {}
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.
27     type: json
28   DefaultPasswords:
29     default: {}
30     type: json
31   RoleName:
32     default: ''
33     description: Role name on which the service is applied
34     type: string
35   RoleParameters:
36     default: {}
37     description: Parameters specific to the role
38     type: json
39   EnableInternalTLS:
40     type: boolean
41     default: false
42
43 conditions:
44
45   internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
46
47 resources:
48
49   ContainersCommon:
50     type: ./containers-common.yaml
51
52   PankoApiPuppetBase:
53     type: ../../puppet/services/panko-api.yaml
54     properties:
55       EndpointMap: {get_param: EndpointMap}
56       ServiceNetMap: {get_param: ServiceNetMap}
57       DefaultPasswords: {get_param: DefaultPasswords}
58       RoleName: {get_param: RoleName}
59       RoleParameters: {get_param: RoleParameters}
60
61 outputs:
62   role_data:
63     description: Role data for the Panko API role.
64     value:
65       service_name: {get_attr: [PankoApiPuppetBase, role_data, service_name]}
66       config_settings:
67         map_merge:
68           - get_attr: [PankoApiPuppetBase, role_data, config_settings]
69           - apache::default_vhost: false
70       step_config: &step_config
71         get_attr: [PankoApiPuppetBase, role_data, step_config]
72       service_config_settings: {get_attr: [PankoApiPuppetBase, role_data, service_config_settings]}
73       # BEGIN DOCKER SETTINGS #
74       puppet_config:
75         config_volume: panko
76         puppet_tags: panko_api_paste_ini,panko_config
77         step_config: *step_config
78         config_image: &panko_image
79           list_join:
80             - '/'
81             - [ {get_param: DockerNamespace}, {get_param: DockerPankoApiImage} ]
82       kolla_config:
83         /var/lib/kolla/config_files/panko_api.json:
84           command: /usr/sbin/httpd -DFOREGROUND
85           permissions:
86             - path: /var/log/panko
87               owner: panko:panko
88               recurse: true
89       docker_config:
90         step_2:
91           panko_init_log:
92             image: *panko_image
93             user: root
94             volumes:
95               - /var/log/containers/panko:/var/log/panko
96             command: ['/bin/bash', '-c', 'mkdir -p /var/log/httpd; chown -R panko:panko /var/log/panko']
97         step_3:
98           panko_db_sync:
99             image: *panko_image
100             net: host
101             detach: false
102             privileged: false
103             user: root
104             volumes:
105               list_concat:
106                 - {get_attr: [ContainersCommon, volumes]}
107                 -
108                   - /var/lib/config-data/panko/etc/panko:/etc/panko:ro
109                   - /var/log/containers/panko:/var/log/panko
110             command: "/usr/bin/bootstrap_host_exec panko_api su panko -s /bin/bash -c '/usr/bin/panko-dbsync'"
111         step_4:
112           panko_api:
113             start_order: 2
114             image: *panko_image
115             net: host
116             privileged: false
117             restart: always
118             volumes:
119               list_concat:
120                 - {get_attr: [ContainersCommon, volumes]}
121                 -
122                   - /var/lib/kolla/config_files/panko_api.json:/var/lib/kolla/config_files/config.json:ro
123                   - /var/lib/config-data/panko/etc/panko/:/etc/panko/:ro
124                   - /var/lib/config-data/panko/etc/httpd/conf/:/etc/httpd/conf/:ro
125                   - /var/lib/config-data/panko/etc/httpd/conf.d/:/etc/httpd/conf.d/:ro
126                   - /var/lib/config-data/panko/etc/httpd/conf.modules.d/:/etc/httpd/conf.modules.d/:ro
127                   - /var/lib/config-data/panko/var/www/:/var/www/:ro
128                   - /var/log/containers/panko:/var/log/panko
129                   -
130                     if:
131                       - internal_tls_enabled
132                       - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
133                       - ''
134                   -
135                     if:
136                       - internal_tls_enabled
137                       - /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
138                       - ''
139             environment:
140               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
141       host_prep_tasks:
142         - name: create persistent logs directory
143           file:
144             path: /var/log/containers/panko
145             state: directory
146       metadata_settings:
147         get_attr: [PankoApiPuppetBase, role_data, metadata_settings]