Merge "cisco nexus: keep OVS on the Compute"
[apex-tripleo-heat-templates.git] / docker / services / haproxy.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized HAproxy service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerHAProxyImage:
12     description: image
13     default: 'centos-binary-haproxy:latest'
14     type: string
15   DockerHAProxyConfigImage:
16     description: The container image to use for the haproxy config_volume
17     default: 'centos-binary-haproxy:latest'
18     type: string
19   ServiceNetMap:
20     default: {}
21     description: Mapping of service_name -> network name. Typically set
22                  via parameter_defaults in the resource registry.  This
23                  mapping overrides those in ServiceNetMapDefaults.
24     type: json
25   DefaultPasswords:
26     default: {}
27     type: json
28   EndpointMap:
29     default: {}
30     description: Mapping of service endpoint -> protocol. Typically set
31                  via parameter_defaults in the resource registry.
32     type: json
33   HAProxyStatsPassword:
34     description: Password for HAProxy stats endpoint
35     hidden: true
36     type: string
37   HAProxyStatsUser:
38     description: User for HAProxy stats endpoint
39     default: admin
40     type: string
41   HAProxySyslogAddress:
42     default: /dev/log
43     description: Syslog address where HAproxy will send its log
44     type: string
45   RedisPassword:
46     description: The password for Redis
47     type: string
48     hidden: true
49   MonitoringSubscriptionHaproxy:
50     default: 'overcloud-haproxy'
51     type: string
52   RoleName:
53     default: ''
54     description: Role name on which the service is applied
55     type: string
56   RoleParameters:
57     default: {}
58     description: Parameters specific to the role
59     type: json
60
61 resources:
62
63   ContainersCommon:
64     type: ./containers-common.yaml
65
66   HAProxyBase:
67     type: ../../puppet/services/haproxy.yaml
68     properties:
69       EndpointMap: {get_param: EndpointMap}
70       ServiceNetMap: {get_param: ServiceNetMap}
71       DefaultPasswords: {get_param: DefaultPasswords}
72       RoleName: {get_param: RoleName}
73       RoleParameters: {get_param: RoleParameters}
74
75 outputs:
76   role_data:
77     description: Role data for the HAproxy role.
78     value:
79       service_name: {get_attr: [HAProxyBase, role_data, service_name]}
80       config_settings:
81         map_merge:
82           - get_attr: [HAProxyBase, role_data, config_settings]
83           - tripleo::haproxy::haproxy_daemon: false
84       step_config: &step_config
85         get_attr: [HAProxyBase, role_data, step_config]
86       service_config_settings: {get_attr: [HAProxyBase, role_data, service_config_settings]}
87       # BEGIN DOCKER SETTINGS
88       puppet_config:
89         config_volume: haproxy
90         puppet_tags: haproxy_config
91         step_config: *step_config
92         config_image:
93           list_join:
94             - '/'
95             - [ {get_param: DockerNamespace}, {get_param: DockerHAProxyConfigImage} ]
96       kolla_config:
97         /var/lib/kolla/config_files/haproxy.json:
98           command: haproxy -f /etc/haproxy/haproxy.cfg
99       docker_config:
100         step_1:
101           haproxy:
102             image:
103               list_join:
104                 - '/'
105                 - [ {get_param: DockerNamespace}, {get_param: DockerHAProxyImage} ]
106             net: host
107             privileged: false
108             restart: always
109             volumes:
110               list_concat:
111                 - {get_attr: [ContainersCommon, volumes]}
112                 -
113                   - /var/lib/kolla/config_files/haproxy.json:/var/lib/kolla/config_files/config.json:ro
114                   - /var/lib/config-data/haproxy/etc/:/etc/:ro
115             environment:
116               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
117       metadata_settings:
118         get_attr: [HAProxyBase, role_data, metadata_settings]