blob: 93435a341950f91223dd4cf6e91e91da3514385e [file] [log] [blame]
Scott Bakerc41914d2017-06-26 14:00:52 -07001site_id=GetSites()[0]["site_id"]
2nodeinfo = {'hostname': "{{ node_hostname }}", 'dns': "8.8.8.8"}
3n_id = AddNode(site_id, nodeinfo)
4mac = "DE:AD:BE:EF:00:01"
5interfacetemplate = {'mac': mac, 'kind': 'physical', 'method': 'static', 'is_primary': True, 'if_name': 'eth0'}
6i_id = AddInterface(n_id, interfacetemplate)
7ip_addr = "169.254.169.1" # TO DO: get this from Neutron in the future
8netmask = "255.255.255.254" # TO DO: get this from Neutron in the future
9ipinfo = {'ip_addr': ip_addr, 'netmask': netmask, 'type': 'ipv4'}
10ip_id = AddIpAddress(i_id, ipinfo)
11routeinfo = {'interface_id': i_id, 'next_hop': "127.0.0.127", 'subnet': '0.0.0.0', 'metric': 1}
12r_id = AddRoute(n_id, routeinfo)
13hpc_slice_id = GetSlices({"name": "co_coblitz"})[0]["slice_id"]
14AddSliceToNodes(hpc_slice_id, [n_id])
15dnsdemux_slice_id = GetSlices({"name": "co_dnsdemux"})[0]["slice_id"]
16dnsredir_slice_id = GetSlices({"name": "co_dnsredir_coblitz"})[0]["slice_id"]
17AddSliceToNodes(dnsdemux_slice_id, [n_id])
18AddSliceToNodes(dnsredir_slice_id, [n_id])
19takeoverscript=GetBootMedium(n_id, "node-cloudinit", '')
20file("/root/takeover-{{ node_hostname }}","w").write(takeoverscript)