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