forked from openstack/heat-templates
/
389_BaseCluster.yaml
114 lines (114 loc) · 3.11 KB
/
389_BaseCluster.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
HeatTemplateFormatVersion: '2012-12-12'
Description: 389 Base Cluster
Parameters:
SubnetId:
Description: Which subnet to use
Type: String
NetworkId:
Description: Which network to use
Type: String
ROLBIpId:
Default: ''
Description: What floating ip id to use for the read only load balancer
Type: String
BaseURL:
Default: 'https://raw.githubusercontent.com/EMSL-MSC/heat-templates/master/cfn/lib'
Description: Base URL where other templates live.
Type: String
AssignFloatingIp:
AllowedValues: ["True", "False"]
Default: "False"
Description: Use True to setup a floating ip
Type: String
Outputs:
LDAPSecurityGroupId:
Description: LDAP Security Group ID
Value: {Ref: LDAPSecurityGroup}
ROServerGroupId:
Description: Read Only Server Group ID
Value: {Ref: ServerGroup}
ROLoadBalancerId:
Description: Read Only Load Balancer ID
Value: {Ref: ROLoadBalancer}
ROLoadBalancerVipAddr:
Description: Read Only Load Balancer Ip Address
Value:
Fn::Select:
- address
- Fn::GetAtt: [ROLoadBalancer, vip]
ROLoadBalancerVipId:
Description: Read Only Load Balancer Vip ID
Value:
Fn::Select:
- id
- Fn::GetAtt: [ROLoadBalancer, vip]
ROLoadBalancerVipPort:
Description: Read Only Load Balancer Vip Port ID
Value:
Fn::Select:
- port_id
- Fn::GetAtt: [ROLoadBalancer, vip]
ROLoadBalancerPort:
Description: Read Only Load Balancer Port
Value: 389
Resources:
LDAPSecurityGroup:
Type: OS::Neutron::SecurityGroup
Properties:
name:
Fn::Join:
- ''
- - {Ref: 'AWS::StackName'}
- '-389'
description: 389 Security Group
rules:
- {remote_ip_prefix: 0.0.0.0/0, port_range_min: 22, protocol: tcp, port_range_max: 22}
- {remote_ip_prefix: 0.0.0.0/0, port_range_min: 389, protocol: tcp, port_range_max: 389}
- {remote_ip_prefix: 0.0.0.0/0, port_range_min: 9830, protocol: tcp, port_range_max: 9830}
ServerGroup:
Properties:
name:
Ref: AWS::StackName
policies:
- anti-affinity
Type: OS::Nova::ServerGroup
ROLoadBalancerMonitor:
Type: OS::Neutron::HealthMonitor
Properties:
delay: 60
max_retries: 5
timeout: 10
type: TCP
ROLoadBalancer:
Type: OS::Neutron::Pool
Properties:
name:
Fn::Join:
- ''
- - {Ref: 'AWS::StackName'}
- -ROLoadBalancer
protocol: TCP
subnet_id: {Ref: SubnetId}
lb_method: LEAST_CONNECTIONS
monitors:
- {Ref: ROLoadBalancerMonitor}
vip:
protocol_port: 389
subnet: {Ref: SubnetId}
ROLoadBalancerFloatingIp:
Properties:
Parameters:
AssignFloatingIp: {Ref: AssignFloatingIp}
Type: "port_id"
FloatingIpId: {Ref: ROLBIpId}
PortId:
Fn::Select:
- port_id
- Fn::GetAtt: [ROLoadBalancer, vip]
BaseURL: {Ref: BaseURL}
TemplateURL:
Fn::Join:
- ''
- - {Ref: BaseURL}
- "/FloatingIp.yaml"
Type: AWS::CloudFormation::Stack