Merge "Fix up pacemaker_status test in yum_update.sh"
[apex-tripleo-heat-templates.git] / docker / services / heat-api-cfn.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Heat API CFN service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerHeatApiCfnImage:
12     description: image
13     default: 'centos-binary-heat-api-cfn:latest'
14     type: string
15   # puppet needs the heat-wsgi-api-cfn binary from centos-binary-heat-api-cfn
16   DockerHeatConfigImage:
17     description: image
18     default: 'centos-binary-heat-api-cfn: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
35
36 resources:
37
38   ContainersCommon:
39     type: ./containers-common.yaml
40
41   HeatBase:
42     type: ../../puppet/services/heat-api-cfn.yaml
43     properties:
44       EndpointMap: {get_param: EndpointMap}
45       ServiceNetMap: {get_param: ServiceNetMap}
46       DefaultPasswords: {get_param: DefaultPasswords}
47
48 outputs:
49   role_data:
50     description: Role data for the Heat API CFN role.
51     value:
52       service_name: {get_attr: [HeatBase, role_data, service_name]}
53       config_settings:
54         map_merge:
55           - get_attr: [HeatBase, role_data, config_settings]
56           - apache::default_vhost: false
57       step_config: &step_config
58         get_attr: [HeatBase, role_data, step_config]
59       service_config_settings: {get_attr: [HeatBase, role_data, service_config_settings]}
60       # BEGIN DOCKER SETTINGS
61       puppet_config:
62         config_volume: heat_api_cfn
63         puppet_tags: heat_config,file,concat,file_line
64         step_config: *step_config
65         config_image:
66           list_join:
67             - '/'
68             - [ {get_param: DockerNamespace}, {get_param: DockerHeatConfigImage} ]
69       kolla_config:
70         /var/lib/kolla/config_files/heat_api_cfn.json:
71           command: /usr/sbin/httpd -DFOREGROUND
72           permissions:
73             - path: /var/log/heat
74               owner: heat:heat
75               recurse: true
76       docker_config:
77         step_4:
78           heat_api_cfn:
79             image:
80               list_join:
81                 - '/'
82                 - [ {get_param: DockerNamespace}, {get_param: DockerHeatApiCfnImage} ]
83             net: host
84             privileged: false
85             restart: always
86             # NOTE(mandre) kolla image changes the user to 'heat', we need it
87             # to be root to run httpd
88             user: root
89             volumes:
90               list_concat:
91                 - {get_attr: [ContainersCommon, volumes]}
92                 -
93                   - /var/lib/kolla/config_files/heat_api_cfn.json:/var/lib/kolla/config_files/config.json:ro
94                   - /var/lib/config-data/heat_api_cfn/etc/heat/:/etc/heat/:ro
95                   - /var/lib/config-data/heat_api_cfn/etc/httpd/:/etc/httpd/:ro
96                   - /var/lib/config-data/heat_api_cfn/var/www/:/var/www/:ro
97                   - /var/log/containers/heat:/var/log/heat
98             environment:
99               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
100       host_prep_tasks:
101         - name: create persistent logs directory
102           file:
103             path: /var/log/containers/heat
104             state: directory
105       upgrade_tasks:
106         - name: Stop and disable heat_api_cfn service
107           tags: step2
108           service: name=httpd state=stopped enabled=no