Merge "Adds service for OVS and enables ODL DPDK deployments"
[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   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   RoleName:
30     default: ''
31     description: Role name on which the service is applied
32     type: string
33   RoleParameters:
34     default: {}
35     description: Parameters specific to the role
36     type: json
37
38 resources:
39
40   ContainersCommon:
41     type: ./containers-common.yaml
42
43   ZaqarBase:
44     type: ../../puppet/services/zaqar.yaml
45     properties:
46       EndpointMap: {get_param: EndpointMap}
47       ServiceNetMap: {get_param: ServiceNetMap}
48       DefaultPasswords: {get_param: DefaultPasswords}
49       RoleName: {get_param: RoleName}
50       RoleParameters: {get_param: RoleParameters}
51
52 outputs:
53   role_data:
54     description: Role data for the Zaqar API role.
55     value:
56       service_name: {get_attr: [ZaqarBase, role_data, service_name]}
57       config_settings: {get_attr: [ZaqarBase, role_data, config_settings]}
58       step_config: &step_config
59        get_attr: [ZaqarBase, role_data, step_config]
60       service_config_settings: {get_attr: [ZaqarBase, role_data, service_config_settings]}
61       # BEGIN DOCKER SETTINGS
62       puppet_config:
63         config_volume: zaqar
64         puppet_tags: zaqar_config
65         step_config: *step_config
66         config_image: &zaqar_image
67           list_join:
68             - '/'
69             - [ {get_param: DockerNamespace}, {get_param: DockerZaqarImage} ]
70       kolla_config:
71         /var/lib/kolla/config_files/zaqar.json:
72           command: /usr/sbin/httpd -DFOREGROUND
73         /var/lib/kolla/config_files/zaqar_websocket.json:
74           command: /usr/bin/zaqar-server --config-file /etc/zaqar/zaqar.conf --config-file /etc/zaqar/1.conf
75           permissions:
76             - path: /var/log/zaqar
77               owner: zaqar:zaqar
78               recurse: true
79       docker_config:
80         step_4:
81           zaqar:
82             image: *zaqar_image
83             net: host
84             privileged: false
85             restart: always
86             # NOTE(mandre) kolla image changes the user to 'zaqar', 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/zaqar.json:/var/lib/kolla/config_files/config.json:ro
94                   - /var/lib/config-data/zaqar/etc/zaqar/:/etc/zaqar/:ro
95                   - /var/lib/config-data/zaqar/var/www/:/var/www/:ro
96                   - /var/lib/config-data/zaqar/etc/httpd/conf/:/etc/httpd/conf/:ro
97                   - /var/lib/config-data/zaqar/etc/httpd/conf.d/:/etc/httpd/conf.d/:ro
98                   - /var/lib/config-data/zaqar/etc/httpd/conf.modules.d/:/etc/httpd/conf.modules.d/:ro
99                   - /var/log/containers/zaqar:/var/log/zaqar
100             environment:
101               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
102           zaqar_websocket:
103             image: *zaqar_image
104             net: host
105             privileged: false
106             restart: always
107             volumes:
108               list_concat:
109                 - {get_attr: [ContainersCommon, volumes]}
110                 -
111                   - /var/lib/kolla/config_files/zaqar_websocket.json:/var/lib/kolla/config_files/config.json:ro
112                   - /var/lib/config-data/zaqar/etc/zaqar/:/etc/zaqar/:ro
113                   - /var/lib/config-data/zaqar/var/www/:/var/www/:ro
114                   - /var/lib/config-data/zaqar/etc/httpd/:/etc/httpd/:ro
115                   - /var/log/containers/zaqar:/var/log/zaqar
116             environment:
117               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
118       host_prep_tasks:
119         - name: create persistent logs directory
120           file:
121             path: /var/log/containers/zaqar
122             state: directory
123       upgrade_tasks:
124         - name: Stop and disable zaqar service
125           tags: step2
126           service: name=httpd state=stopped enabled=no