9151538552d1c27fbffc28478bbc9a14121ab5a4
[apex-tripleo-heat-templates.git] / network / config / bond-with-vlans / controller.yaml
1 heat_template_version: ocata
2 description: >
3   Software Config to drive os-net-config with 2 bonded nics on a bridge with VLANs attached for the controller role.
4 parameters:
5   ControlPlaneIp:
6     default: ''
7     description: IP address/subnet on the ctlplane network
8     type: string
9   ExternalIpSubnet:
10     default: ''
11     description: IP address/subnet on the external network
12     type: string
13   InternalApiIpSubnet:
14     default: ''
15     description: IP address/subnet on the internal API network
16     type: string
17   StorageIpSubnet:
18     default: ''
19     description: IP address/subnet on the storage network
20     type: string
21   StorageMgmtIpSubnet:
22     default: ''
23     description: IP address/subnet on the storage mgmt network
24     type: string
25   TenantIpSubnet:
26     default: ''
27     description: IP address/subnet on the tenant network
28     type: string
29   ManagementIpSubnet: # Only populated when including environments/network-management.yaml
30     default: ''
31     description: IP address/subnet on the management network
32     type: string
33   BondInterfaceOvsOptions:
34     default: bond_mode=active-backup
35     description: The ovs_options string for the bond interface. Set things like lacp=active and/or bond_mode=balance-slb using
36       this option.
37     type: string
38     constraints:
39     - allowed_pattern: ^((?!balance.tcp).)*$
40       description: 'The balance-tcp bond mode is known to cause packet loss and
41
42         should not be used in BondInterfaceOvsOptions.
43
44         '
45   ExternalNetworkVlanID:
46     default: 10
47     description: Vlan ID for the external network traffic.
48     type: number
49   InternalApiNetworkVlanID:
50     default: 20
51     description: Vlan ID for the internal_api network traffic.
52     type: number
53   StorageNetworkVlanID:
54     default: 30
55     description: Vlan ID for the storage network traffic.
56     type: number
57   StorageMgmtNetworkVlanID:
58     default: 40
59     description: Vlan ID for the storage mgmt network traffic.
60     type: number
61   TenantNetworkVlanID:
62     default: 50
63     description: Vlan ID for the tenant network traffic.
64     type: number
65   ManagementNetworkVlanID:
66     default: 60
67     description: Vlan ID for the management network traffic.
68     type: number
69   ControlPlaneDefaultRoute: # Override this via parameter_defaults
70     description: The default route of the control plane network.
71     type: string
72   ExternalInterfaceDefaultRoute:
73     default: 10.0.0.1
74     description: default route for the external network
75     type: string
76   ManagementInterfaceDefaultRoute: # Commented out by default in this template
77     default: unset
78     description: The default route of the management network.
79     type: string
80   ControlPlaneSubnetCidr: # Override this via parameter_defaults
81     default: '24'
82     description: The subnet CIDR of the control plane network.
83     type: string
84   DnsServers: # Override this via parameter_defaults
85     default: []
86     description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf.
87     type: comma_delimited_list
88   EC2MetadataIp: # Override this via parameter_defaults
89     description: The IP address of the EC2 metadata server.
90     type: string
91 resources:
92   OsNetConfigImpl:
93     type: OS::Heat::SoftwareConfig
94     properties:
95       group: script
96       config:
97         str_replace:
98           template:
99             get_file: ../../scripts/run-os-net-config.sh
100           params:
101             $network_config:
102               network_config:
103               - type: interface
104                 name: nic1
105                 use_dhcp: false
106                 addresses:
107                 - ip_netmask:
108                     list_join:
109                     - /
110                     - - get_param: ControlPlaneIp
111                       - get_param: ControlPlaneSubnetCidr
112                 routes:
113                 - ip_netmask: 169.254.169.254/32
114                   next_hop:
115                     get_param: EC2MetadataIp
116               - type: ovs_bridge
117                 name: bridge_name
118                 dns_servers:
119                   get_param: DnsServers
120                 members:
121                 - type: ovs_bond
122                   name: bond1
123                   ovs_options:
124                     get_param: BondInterfaceOvsOptions
125                   members:
126                   - type: interface
127                     name: nic2
128                     primary: true
129                   - type: interface
130                     name: nic3
131                 - type: vlan
132                   device: bond1
133                   vlan_id:
134                     get_param: ExternalNetworkVlanID
135                   addresses:
136                   - ip_netmask:
137                       get_param: ExternalIpSubnet
138                   routes:
139                   - default: true
140                     next_hop:
141                       get_param: ExternalInterfaceDefaultRoute
142                 - type: vlan
143                   device: bond1
144                   vlan_id:
145                     get_param: InternalApiNetworkVlanID
146                   addresses:
147                   - ip_netmask:
148                       get_param: InternalApiIpSubnet
149                 - type: vlan
150                   device: bond1
151                   vlan_id:
152                     get_param: StorageNetworkVlanID
153                   addresses:
154                   - ip_netmask:
155                       get_param: StorageIpSubnet
156                 - type: vlan
157                   device: bond1
158                   vlan_id:
159                     get_param: StorageMgmtNetworkVlanID
160                   addresses:
161                   - ip_netmask:
162                       get_param: StorageMgmtIpSubnet
163                 - type: vlan
164                   device: bond1
165                   vlan_id:
166                     get_param: TenantNetworkVlanID
167                   addresses:
168                   - ip_netmask:
169                       get_param: TenantIpSubnet
170                 # Uncomment when including environments/network-management.yaml
171                 # If setting default route on the Management interface, comment
172                 # out the default route on the External interface. This will
173                 # make the External API unreachable from remote subnets.
174                 #-
175                 #  type: vlan
176                 #  device: bond1
177                 #  vlan_id: {get_param: ManagementNetworkVlanID}
178                 #  addresses:
179                 #    -
180                 #      ip_netmask: {get_param: ManagementIpSubnet}
181                 #  routes:
182                 #    -
183                 #      default: true
184                 #      next_hop: {get_param: ManagementInterfaceDefaultRoute}
185 outputs:
186   OS::stack_id:
187     description: The OsNetConfigImpl resource.
188     value:
189       get_resource: OsNetConfigImpl
190