675a79ec6b5258a0cad23390635b5e4eccb19f5b
[apex-tripleo-heat-templates.git] / puppet / services / haproxy.yaml
1 heat_template_version: 2016-10-14
2
3 description: >
4   HAproxy service configured with Puppet
5
6 parameters:
7   ServiceNetMap:
8     default: {}
9     description: Mapping of service_name -> network name. Typically set
10                  via parameter_defaults in the resource registry.  This
11                  mapping overrides those in ServiceNetMapDefaults.
12     type: json
13   DefaultPasswords:
14     default: {}
15     type: json
16   EndpointMap:
17     default: {}
18     description: Mapping of service endpoint -> protocol. Typically set
19                  via parameter_defaults in the resource registry.
20     type: json
21   HAProxyStatsPassword:
22     description: Password for HAProxy stats endpoint
23     hidden: true
24     type: string
25   HAProxyStatsUser:
26     description: User for HAProxy stats endpoint
27     default: admin
28     type: string
29   HAProxySyslogAddress:
30     default: /dev/log
31     description: Syslog address where HAproxy will send its log
32     type: string
33   RedisPassword:
34     description: The password for Redis
35     type: string
36     hidden: true
37   MonitoringSubscriptionHaproxy:
38     default: 'overcloud-haproxy'
39     type: string
40
41 resources:
42
43   HAProxyPublicTLS:
44     type: OS::TripleO::Services::HAProxyPublicTLS
45     properties:
46       ServiceNetMap: {get_param: ServiceNetMap}
47       DefaultPasswords: {get_param: DefaultPasswords}
48       EndpointMap: {get_param: EndpointMap}
49
50   HAProxyInternalTLS:
51     type: OS::TripleO::Services::HAProxyInternalTLS
52     properties:
53       ServiceNetMap: {get_param: ServiceNetMap}
54       DefaultPasswords: {get_param: DefaultPasswords}
55       EndpointMap: {get_param: EndpointMap}
56
57 outputs:
58   role_data:
59     description: Role data for the HAproxy role.
60     value:
61       service_name: haproxy
62       monitoring_subscription: {get_param: MonitoringSubscriptionHaproxy}
63       config_settings:
64         map_merge:
65           - get_attr: [HAProxyPublicTLS, role_data, config_settings]
66           - get_attr: [HAProxyInternalTLS, role_data, config_settings]
67           - tripleo.haproxy.firewall_rules:
68               '107 haproxy stats':
69                 dport: 1993
70             tripleo::haproxy::haproxy_log_address: {get_param: HAProxySyslogAddress}
71             tripleo::haproxy::haproxy_stats_user: {get_param: HAProxyStatsUser}
72             tripleo::haproxy::haproxy_stats_password: {get_param: HAProxyStatsPassword}
73             tripleo::haproxy::redis_password: {get_param: RedisPassword}
74             tripleo::profile::base::haproxy::certificates_specs:
75               map_merge:
76                 - get_attr: [HAProxyPublicTLS, role_data, certificates_specs]
77                 - get_attr: [HAProxyInternalTLS, role_data, certificates_specs]
78       step_config: |
79         include ::tripleo::profile::base::haproxy
80       upgrade_tasks:
81         - name: Stop haproxy service
82           tags: step1
83           service: name=haproxy state=stopped
84         - name: Start haproxy service
85           tags: step4 # Needed at step 4 for mysql
86           service: name=haproxy state=started