Bind mount needed cert for haproxy for HA too
[apex-tripleo-heat-templates.git] / docker / services / zaqar.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Zaqar services
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerZaqarImage:
12     description: image
13     default: 'centos-binary-zaqar:latest'
14     type: string
15   DockerZaqarConfigImage:
16     description: The container image to use for the zaqar config_volume
17     default: 'centos-binary-zaqar:latest'
18     type: string
19   EndpointMap:
20     default: {}
21     description: Mapping of service endpoint -> protocol. Typically set
22                  via parameter_defaults in the resource registry.
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
42 resources:
43
44   ContainersCommon:
45     type: ./containers-common.yaml
46
47   ZaqarBase:
48     type: ../../puppet/services/zaqar.yaml
49     properties:
50       EndpointMap: {get_param: EndpointMap}
51       ServiceNetMap: {get_param: ServiceNetMap}
52       DefaultPasswords: {get_param: DefaultPasswords}
53       RoleName: {get_param: RoleName}
54       RoleParameters: {get_param: RoleParameters}
55
56 outputs:
57   role_data:
58     description: Role data for the Zaqar API role.
59     value:
60       service_name: {get_attr: [ZaqarBase, role_data, service_name]}
61       config_settings: {get_attr: [ZaqarBase, role_data, config_settings]}
62       step_config: &step_config
63        get_attr: [ZaqarBase, role_data, step_config]
64       service_config_settings: {get_attr: [ZaqarBase, role_data, service_config_settings]}
65       # BEGIN DOCKER SETTINGS
66       puppet_config:
67         config_volume: zaqar
68         puppet_tags: zaqar_config
69         step_config: *step_config
70         config_image:
71           list_join:
72             - '/'
73             - [ {get_param: DockerNamespace}, {get_param: DockerZaqarConfigImage} ]
74       kolla_config:
75         /var/lib/kolla/config_files/zaqar.json:
76           command: /usr/sbin/httpd -DFOREGROUND
77         /var/lib/kolla/config_files/zaqar_websocket.json:
78           command: /usr/bin/zaqar-server --config-file /etc/zaqar/zaqar.conf --config-file /etc/zaqar/1.conf
79           permissions:
80             - path: /var/log/zaqar
81               owner: zaqar:zaqar
82               recurse: true
83       docker_config:
84         step_4:
85           zaqar:
86             image: &zaqar_image
87               list_join:
88                 - '/'
89                 - [ {get_param: DockerNamespace}, {get_param: DockerZaqarImage} ]
90             net: host
91             privileged: false
92             restart: always
93             # NOTE(mandre) kolla image changes the user to 'zaqar', we need it
94             # to be root to run httpd
95             user: root
96             volumes:
97               list_concat:
98                 - {get_attr: [ContainersCommon, volumes]}
99                 -
100                   - /var/lib/kolla/config_files/zaqar.json:/var/lib/kolla/config_files/config.json:ro
101                   - /var/lib/config-data/zaqar/etc/zaqar/:/etc/zaqar/:ro
102                   - /var/lib/config-data/zaqar/var/www/:/var/www/:ro
103                   - /var/lib/config-data/zaqar/etc/httpd/conf/:/etc/httpd/conf/:ro
104                   - /var/lib/config-data/zaqar/etc/httpd/conf.d/:/etc/httpd/conf.d/:ro
105                   - /var/lib/config-data/zaqar/etc/httpd/conf.modules.d/:/etc/httpd/conf.modules.d/:ro
106                   - /var/log/containers/zaqar:/var/log/zaqar
107             environment:
108               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
109           zaqar_websocket:
110             image: *zaqar_image
111             net: host
112             privileged: false
113             restart: always
114             volumes:
115               list_concat:
116                 - {get_attr: [ContainersCommon, volumes]}
117                 -
118                   - /var/lib/kolla/config_files/zaqar_websocket.json:/var/lib/kolla/config_files/config.json:ro
119                   - /var/lib/config-data/zaqar/etc/zaqar/:/etc/zaqar/:ro
120                   - /var/lib/config-data/zaqar/var/www/:/var/www/:ro
121                   - /var/lib/config-data/zaqar/etc/httpd/:/etc/httpd/:ro
122                   - /var/log/containers/zaqar:/var/log/zaqar
123             environment:
124               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
125       host_prep_tasks:
126         - name: create persistent logs directory
127           file:
128             path: /var/log/containers/zaqar
129             state: directory
130       upgrade_tasks:
131         - name: Stop and disable zaqar service
132           tags: step2
133           service: name=httpd state=stopped enabled=no