cd1961ad353e0918ece9ea347a9c355c95398281
[apex-tripleo-heat-templates.git] / network / config / bond-with-vlans / controller.yaml
1 heat_template_version: 2015-04-30
2
3 description: >
4   Software Config to drive os-net-config with 2 bonded nics on a bridge
5   with VLANs attached for the controller role.
6
7 parameters:
8   ControlPlaneIp:
9     default: ''
10     description: IP address/subnet on the ctlplane network
11     type: string
12   ExternalIpSubnet:
13     default: ''
14     description: IP address/subnet on the external network
15     type: string
16   InternalApiIpSubnet:
17     default: ''
18     description: IP address/subnet on the internal API network
19     type: string
20   StorageIpSubnet:
21     default: ''
22     description: IP address/subnet on the storage network
23     type: string
24   StorageMgmtIpSubnet:
25     default: ''
26     description: IP address/subnet on the storage mgmt network
27     type: string
28   TenantIpSubnet:
29     default: ''
30     description: IP address/subnet on the tenant network
31     type: string
32   BondInterfaceOvsOptions:
33     default: 'bond_mode=balance-tcp lacp=active other-config:lacp-fallback-ab=true'
34     description: The ovs_options string for the bond interface. Set things like
35                  lacp=active and/or bond_mode=balance-slb using this option.
36                  Default wil attempt LACP, but will fall back to active-backup.
37     type: string
38   ExternalNetworkVlanID:
39     default: 10
40     description: Vlan ID for the external network traffic.
41     type: number
42   InternalApiNetworkVlanID:
43     default: 20
44     description: Vlan ID for the internal_api network traffic.
45     type: number
46   StorageNetworkVlanID:
47     default: 30
48     description: Vlan ID for the storage network traffic.
49     type: number
50   StorageMgmtNetworkVlanID:
51     default: 40
52     description: Vlan ID for the storage mgmt network traffic.
53     type: number
54   TenantNetworkVlanID:
55     default: 50
56     description: Vlan ID for the tenant network traffic.
57     type: number
58   ExternalInterfaceDefaultRoute:
59     default: '10.0.0.1'
60     description: default route for the external network
61     type: string
62   ControlPlaneSubnetCidr: # Override this via parameter_defaults
63     default: '24'
64     description: The subnet CIDR of the control plane network.
65     type: string
66   EC2MetadataIp: # Override this via parameter_defaults
67     description: The IP address of the EC2 metadata server.
68     type: string
69
70 resources:
71   OsNetConfigImpl:
72     type: OS::Heat::StructuredConfig
73     properties:
74       group: os-apply-config
75       config:
76         os_net_config:
77           network_config:
78             -
79               type: interface
80               name: nic1
81               use_dhcp: false
82               addresses:
83                 -
84                   ip_netmask:
85                     list_join:
86                       - '/'
87                       - - {get_param: ControlPlaneIp}
88                         - {get_param: ControlPlaneSubnetCidr}
89               routes:
90                 -
91                   ip_netmask: 169.254.169.254/32
92                   next_hop: {get_param: EC2MetadataIp}
93             -
94               type: ovs_bridge
95               name: {get_input: bridge_name}
96               members:
97                 -
98                   type: ovs_bond
99                   name: bond1
100                   ovs_options: {get_param: BondInterfaceOvsOptions}
101                   members:
102                     -
103                       type: interface
104                       name: nic2
105                       primary: true
106                     -
107                       type: interface
108                       name: nic3
109                 -
110                   type: vlan
111                   device: bond1
112                   vlan_id: {get_param: ExternalNetworkVlanID}
113                   addresses:
114                     -
115                       ip_netmask: {get_param: ExternalIpSubnet}
116                   routes:
117                     -
118                       ip_netmask: 0.0.0.0/0
119                       next_hop: {get_param: ExternalInterfaceDefaultRoute}
120                 -
121                   type: vlan
122                   device: bond1
123                   vlan_id: {get_param: InternalApiNetworkVlanID}
124                   addresses:
125                     -
126                       ip_netmask: {get_param: InternalApiIpSubnet}
127                 -
128                   type: vlan
129                   device: bond1
130                   vlan_id: {get_param: StorageNetworkVlanID}
131                   addresses:
132                     -
133                       ip_netmask: {get_param: StorageIpSubnet}
134                 -
135                   type: vlan
136                   device: bond1
137                   vlan_id: {get_param: StorageMgmtNetworkVlanID}
138                   addresses:
139                     -
140                       ip_netmask: {get_param: StorageMgmtIpSubnet}
141                 -
142                   type: vlan
143                   device: bond1
144                   vlan_id: {get_param: TenantNetworkVlanID}
145                   addresses:
146                     -
147                       ip_netmask: {get_param: TenantIpSubnet}
148
149 outputs:
150   OS::stack_id:
151     description: The OsNetConfigImpl resource.
152     value: {get_resource: OsNetConfigImpl}