Update the template_version alias for all the templates to pike.
[apex-tripleo-heat-templates.git] / ci / common / net-config-multinode-os-net-config.yaml
1 heat_template_version: pike
2
3 description: >
4   Software Config to drive os-net-config for a simple bridge configured
5   with a static IP address for the ctlplane network.
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   ManagementIpSubnet:
33     default: ''
34     description: IP address/subnet on the management network
35     type: string
36   ControlPlaneSubnetCidr: # Override this via parameter_defaults
37     default: '24'
38     description: The subnet CIDR of the control plane network.
39     type: string
40   OvSBridgeMtu:
41     default: 1300
42     description: The mtu of the OvS bridge
43     type: number
44
45 resources:
46
47   OsNetConfigImpl:
48     type: OS::Heat::SoftwareConfig
49     properties:
50       group: script
51       config:
52         list_join:
53         - ''
54         - - |
55             #!/bin/bash
56             function network_config_hook {
57               primary_private_ip=$(cat /etc/nodepool/primary_node_private)
58               sed -i "s/primary_private_ip/$primary_private_ip/" /etc/os-net-config/config.json
59               subnode_private_ip=$(cat /etc/nodepool/node_private)
60               sed -i "s/subnode_private_ip/$subnode_private_ip/" /etc/os-net-config/config.json
61               # We start with an arbitrarily high vni key so that we don't
62               # overlap with Neutron created values. These will also match the
63               # values that we've been using previously from the devstack-gate
64               # code.
65               vni=1000002
66               subnode_index=$(grep -n $(cat /etc/nodepool/node_private) /etc/nodepool/sub_nodes_private | cut -d: -f1)
67               let vni+=$subnode_index
68               sed -i "s/vni/$vni/" /etc/os-net-config/config.json
69               export interface_name="br-ex_$primary_private_ip"
70               # Until we are fully migrated to os-net-config we need to clean
71               # up the old bridge first created by devstack-gate
72               ovs-vsctl del-br br-ex
73             }
74
75           -
76             str_replace:
77               template:
78                 get_file: ../../network/scripts/run-os-net-config.sh
79               params:
80                 $network_config:
81                   network_config:
82                     - type: ovs_bridge
83                       name: bridge_name
84                       mtu:
85                         get_param: OvSBridgeMtu
86                       use_dhcp: false
87                       addresses:
88                         - ip_netmask:
89                             list_join:
90                               - "/"
91                               - - get_param: ControlPlaneIp
92                                 - get_param: ControlPlaneSubnetCidr
93                       members:
94                         - type: ovs_tunnel
95                           name: interface_name
96                           tunnel_type: vxlan
97                           ovs_options:
98                             - list_join:
99                               - "="
100                               - - key
101                                 - vni
102                             - list_join:
103                               - "="
104                               - - remote_ip
105                                 - primary_private_ip
106                             - list_join:
107                               - "="
108                               - - local_ip
109                                 - subnode_private_ip
110
111 outputs:
112   OS::stack_id:
113     description: The OsNetConfigImpl resource.
114     value: {get_resource: OsNetConfigImpl}