Merge "Add release note for generated sample environments"
[apex-tripleo-heat-templates.git] / docker / services / heat-api.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Heat API service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerHeatApiImage:
12     description: image
13     default: 'centos-binary-heat-api:latest'
14     type: string
15   # puppet needs the heat-wsgi-api binary from centos-binary-heat-api
16   DockerHeatApiConfigImage:
17     description: The container image to use for the heat_api config_volume
18     default: 'centos-binary-heat-api:latest'
19     type: string
20   EndpointMap:
21     default: {}
22     description: Mapping of service endpoint -> protocol. Typically set
23                  via parameter_defaults in the resource registry.
24     type: json
25   ServiceNetMap:
26     default: {}
27     description: Mapping of service_name -> network name. Typically set
28                  via parameter_defaults in the resource registry.  This
29                  mapping overrides those in ServiceNetMapDefaults.
30     type: json
31   DefaultPasswords:
32     default: {}
33     type: json
34   RoleName:
35     default: ''
36     description: Role name on which the service is applied
37     type: string
38   RoleParameters:
39     default: {}
40     description: Parameters specific to the role
41     type: json
42   EnableInternalTLS:
43     type: boolean
44     default: false
45
46 conditions:
47
48   internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
49
50 resources:
51
52   ContainersCommon:
53     type: ./containers-common.yaml
54
55   HeatBase:
56     type: ../../puppet/services/heat-api.yaml
57     properties:
58       EndpointMap: {get_param: EndpointMap}
59       ServiceNetMap: {get_param: ServiceNetMap}
60       DefaultPasswords: {get_param: DefaultPasswords}
61       RoleName: {get_param: RoleName}
62       RoleParameters: {get_param: RoleParameters}
63
64 outputs:
65   role_data:
66     description: Role data for the Heat API role.
67     value:
68       service_name: {get_attr: [HeatBase, role_data, service_name]}
69       config_settings:
70         map_merge:
71           - get_attr: [HeatBase, role_data, config_settings]
72           - apache::default_vhost: false
73       step_config: &step_config
74         get_attr: [HeatBase, role_data, step_config]
75       service_config_settings: {get_attr: [HeatBase, role_data, service_config_settings]}
76       # BEGIN DOCKER SETTINGS
77       puppet_config:
78         config_volume: heat_api
79         puppet_tags: heat_config,file,concat,file_line
80         step_config: *step_config
81         config_image:
82           list_join:
83             - '/'
84             - [ {get_param: DockerNamespace}, {get_param: DockerHeatApiConfigImage} ]
85       kolla_config:
86         /var/lib/kolla/config_files/heat_api.json:
87           command: /usr/sbin/httpd -DFOREGROUND
88           permissions:
89             - path: /var/log/heat
90               owner: heat:heat
91               recurse: true
92       docker_config:
93         step_4:
94           heat_api:
95             image:
96               list_join:
97                 - '/'
98                 - [ {get_param: DockerNamespace}, {get_param: DockerHeatApiImage} ]
99             net: host
100             privileged: false
101             restart: always
102             # NOTE(mandre) kolla image changes the user to 'heat', we need it
103             # to be root to run httpd
104             user: root
105             volumes:
106               list_concat:
107                 - {get_attr: [ContainersCommon, volumes]}
108                 -
109                   - /var/lib/kolla/config_files/heat_api.json:/var/lib/kolla/config_files/config.json:ro
110                   - /var/lib/config-data/heat_api/etc/heat/:/etc/heat/:ro
111                   - /var/lib/config-data/heat_api/etc/httpd/conf/:/etc/httpd/conf/:ro
112                   - /var/lib/config-data/heat_api/etc/httpd/conf.d/:/etc/httpd/conf.d/:ro
113                   - /var/lib/config-data/heat_api/etc/httpd/conf.modules.d/:/etc/httpd/conf.modules.d/:ro
114                   - /var/lib/config-data/heat_api/var/www/:/var/www/:ro
115                   - /var/log/containers/heat:/var/log/heat
116                   -
117                     if:
118                       - internal_tls_enabled
119                       - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
120                       - ''
121                   -
122                     if:
123                       - internal_tls_enabled
124                       - /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
125                       - ''
126             environment:
127               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
128       host_prep_tasks:
129         - name: create persistent logs directory
130           file:
131             path: /var/log/containers/heat
132             state: directory
133       upgrade_tasks:
134         - name: Stop and disable heat_api service
135           tags: step2
136           service: name=httpd state=stopped enabled=no
137       metadata_settings:
138         get_attr: [HeatBase, role_data, metadata_settings]