Merge "Support network isolation without external nets"
[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   DnsServers: # Override this via parameter_defaults
61     default: []
62     description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf.
63     type: comma_delimited_list
64   EC2MetadataIp: # Override this via parameter_defaults
65     description: The IP address of the EC2 metadata server.
66     type: string
67
68 resources:
69   OsNetConfigImpl:
70     type: OS::Heat::StructuredConfig
71     properties:
72       group: os-apply-config
73       config:
74         os_net_config:
75           network_config:
76             -
77               type: ovs_bridge
78               name: {get_input: bridge_name}
79               use_dhcp: false
80               dns_servers: {get_param: DnsServers}
81               addresses:
82                 -
83                   ip_netmask:
84                     list_join:
85                       - '/'
86                       - - {get_param: ControlPlaneIp}
87                         - {get_param: ControlPlaneSubnetCidr}
88               routes:
89                 -
90                   ip_netmask: 169.254.169.254/32
91                   next_hop: {get_param: EC2MetadataIp}
92               members:
93                 -
94                   type: interface
95                   name: nic1
96                   # force the MAC address of the bridge to this interface
97                   primary: true
98                 -
99                   type: vlan
100                   vlan_id: {get_param: ExternalNetworkVlanID}
101                   addresses:
102                   -
103                     ip_netmask: {get_param: ExternalIpSubnet}
104                   routes:
105                     -
106                       ip_netmask: 0.0.0.0/0
107                       next_hop: {get_param: ExternalInterfaceDefaultRoute}
108                 -
109                   type: vlan
110                   vlan_id: {get_param: InternalApiNetworkVlanID}
111                   addresses:
112                     -
113                       ip_netmask: {get_param: InternalApiIpSubnet}
114                 -
115                   type: vlan
116                   vlan_id: {get_param: StorageNetworkVlanID}
117                   addresses:
118                     -
119                       ip_netmask: {get_param: StorageIpSubnet}
120                 -
121                   type: vlan
122                   vlan_id: {get_param: StorageMgmtNetworkVlanID}
123                   addresses:
124                     -
125                       ip_netmask: {get_param: StorageMgmtIpSubnet}
126                 -
127                   type: vlan
128                   vlan_id: {get_param: TenantNetworkVlanID}
129                   addresses:
130                     -
131                       ip_netmask: {get_param: TenantIpSubnet}
132
133 outputs:
134   OS::stack_id:
135     description: The OsNetConfigImpl resource.
136     value: {get_resource: OsNetConfigImpl}