Merge "Enables support for configuring Cinder with Pure Storage FlashArray storage...
[apex-tripleo-heat-templates.git] / docker / services / gnocchi-api.yaml
1 heat_template_version: ocata
2
3 description: >
4   OpenStack containerized gnocchi service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerGnocchiApiImage:
12     description: image
13     default: 'centos-binary-gnocchi-api:latest'
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   ServiceNetMap:
21     default: {}
22     description: Mapping of service_name -> network name. Typically set
23                  via parameter_defaults in the resource registry.  This
24                  mapping overrides those in ServiceNetMapDefaults.
25     type: json
26   DefaultPasswords:
27     default: {}
28     type: json
29   EnableInternalTLS:
30     type: boolean
31     default: false
32
33 conditions:
34
35   internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
36
37 resources:
38
39   ContainersCommon:
40     type: ./containers-common.yaml
41
42   GnocchiApiPuppetBase:
43       type: ../../puppet/services/gnocchi-api.yaml
44       properties:
45         EndpointMap: {get_param: EndpointMap}
46         ServiceNetMap: {get_param: ServiceNetMap}
47         DefaultPasswords: {get_param: DefaultPasswords}
48
49 outputs:
50   role_data:
51     description: Role data for the gnocchi API role.
52     value:
53       service_name: {get_attr: [GnocchiApiPuppetBase, role_data, service_name]}
54       config_settings:
55         map_merge:
56           - get_attr: [GnocchiApiPuppetBase, role_data, config_settings]
57           - apache::default_vhost: false
58       step_config: &step_config
59         get_attr: [GnocchiApiPuppetBase, role_data, step_config]
60       service_config_settings: {get_attr: [GnocchiApiPuppetBase, role_data, service_config_settings]}
61       # BEGIN DOCKER SETTINGS
62       puppet_config:
63         config_volume: gnocchi
64         puppet_tags: gnocchi_api_paste_ini,gnocchi_config
65         step_config: *step_config
66         config_image: &gnocchi_image
67           list_join:
68             - '/'
69             - [ {get_param: DockerNamespace}, {get_param: DockerGnocchiApiImage} ]
70       kolla_config:
71         /var/lib/kolla/config_files/gnocchi-api.json:
72           command: /usr/sbin/httpd -DFOREGROUND
73       docker_config:
74         step_3:
75           gnocchi_init_log:
76             start_order: 0
77             image: *gnocchi_image
78             user: root
79             command: ['/bin/bash', '-c', 'mkdir -p /var/log/httpd && mkdir -p /var/log/gnocchi && chown gnocchi:gnocchi /var/log/gnocchi']
80             volumes:
81               - logs:/var/log
82           gnocchi_db_sync:
83             start_order: 1
84             image: *gnocchi_image
85             net: host
86             detach: false
87             privileged: false
88             volumes:
89               yaql:
90                 expression: $.data.common.concat($.data.service)
91                 data:
92                   common: {get_attr: [ContainersCommon, volumes]}
93                   service:
94                     - /var/lib/config-data/gnocchi/etc/gnocchi/:/etc/gnocchi/:ro
95                     - logs:/var/log
96             command: ["/usr/bin/gnocchi-upgrade", "--skip-storage"]
97         step_4:
98           gnocchi_api:
99             image: *gnocchi_image
100             net: host
101             privileged: false
102             restart: always
103             volumes:
104               yaql:
105                 expression: $.data.common.concat($.data.service)
106                 data:
107                   common: {get_attr: [ContainersCommon, volumes]}
108                   service:
109                     - /var/lib/kolla/config_files/gnocchi-api.json:/var/lib/kolla/config_files/config.json:ro
110                     - /var/lib/config-data/gnocchi/etc/gnocchi/:/etc/gnocchi/:ro
111                     - /var/lib/config-data/gnocchi/etc/httpd/:/etc/httpd/:ro
112                     - /var/lib/config-data/gnocchi/var/www/:/var/www/:ro
113                     -
114                       if:
115                         - internal_tls_enabled
116                         - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
117                         - ''
118                     -
119                       if:
120                         - internal_tls_enabled
121                         - /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
122                         - ''
123             environment:
124               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
125       upgrade_tasks:
126         - name: Stop and disable httpd service
127           tags: step2
128           service: name=httpd state=stopped enabled=no
129       metadata_settings:
130         get_attr: [GnocchiApiPuppetBase, role_data, metadata_settings]