Merge "Configure ctlplane network with a static IP"
[apex-tripleo-heat-templates.git] / network / config / single-nic-vlans / controller.yaml
1 heat_template_version: 2015-04-30
2
3 description: >
4   Software Config to drive os-net-config to configure VLANs for the
5   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   ExternalNetworkVlanID:
33     default: 10
34     description: Vlan ID for the external network traffic.
35     type: number
36   InternalApiNetworkVlanID:
37     default: 20
38     description: Vlan ID for the internal_api network traffic.
39     type: number
40   StorageNetworkVlanID:
41     default: 30
42     description: Vlan ID for the storage network traffic.
43     type: number
44   StorageMgmtNetworkVlanID:
45     default: 40
46     description: Vlan ID for the storage mgmt network traffic.
47     type: number
48   TenantNetworkVlanID:
49     default: 50
50     description: Vlan ID for the tenant network traffic.
51     type: number
52   ExternalInterfaceDefaultRoute:
53     default: '10.0.0.1'
54     description: default route for the external network
55     type: string
56   ControlPlaneSubnetCidr: # Override this via parameter_defaults
57     default: '24'
58     description: The subnet CIDR of the control plane network.
59     type: string
60   EC2MetadataIp: # Override this via parameter_defaults
61     description: The IP address of the EC2 metadata server.
62     type: string
63
64 resources:
65   OsNetConfigImpl:
66     type: OS::Heat::StructuredConfig
67     properties:
68       group: os-apply-config
69       config:
70         os_net_config:
71           network_config:
72             -
73               type: ovs_bridge
74               name: {get_input: bridge_name}
75               use_dhcp: false
76               addresses:
77                 -
78                   ip_netmask:
79                     list_join:
80                       - '/'
81                       - - {get_param: ControlPlaneIp}
82                         - {get_param: ControlPlaneSubnetCidr}
83               routes:
84                 -
85                   ip_netmask: 169.254.169.254/32
86                   next_hop: {get_param: EC2MetadataIp}
87               members:
88                 -
89                   type: interface
90                   name: nic1
91                   # force the MAC address of the bridge to this interface
92                   primary: true
93                 -
94                   type: vlan
95                   vlan_id: {get_param: ExternalNetworkVlanID}
96                   addresses:
97                   -
98                     ip_netmask: {get_param: ExternalIpSubnet}
99                   routes:
100                     -
101                       ip_netmask: 0.0.0.0/0
102                       next_hop: {get_param: ExternalInterfaceDefaultRoute}
103                 -
104                   type: vlan
105                   vlan_id: {get_param: InternalApiNetworkVlanID}
106                   addresses:
107                     -
108                       ip_netmask: {get_param: InternalApiIpSubnet}
109                 -
110                   type: vlan
111                   vlan_id: {get_param: StorageNetworkVlanID}
112                   addresses:
113                     -
114                       ip_netmask: {get_param: StorageIpSubnet}
115                 -
116                   type: vlan
117                   vlan_id: {get_param: StorageMgmtNetworkVlanID}
118                   addresses:
119                     -
120                       ip_netmask: {get_param: StorageMgmtIpSubnet}
121                 -
122                   type: vlan
123                   vlan_id: {get_param: TenantNetworkVlanID}
124                   addresses:
125                     -
126                       ip_netmask: {get_param: TenantIpSubnet}
127
128 outputs:
129   OS::stack_id:
130     description: The OsNetConfigImpl resource.
131     value: {get_resource: OsNetConfigImpl}