-
Notifications
You must be signed in to change notification settings - Fork 4
/
hosts
executable file
·86 lines (68 loc) · 2.65 KB
/
hosts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#! /usr/bin/env python3
from sys import path
path.append("lib")
import hosts
import json
inv = hosts.Inventory('site/site.conf',
ipv6_global_network = "2a06:8782:ffbb:1337::/64",
ipv6_uplink_network = "2a06:8782:ffbb::/64",
)
inv_v15 = hosts.Inventory('site/site.conf',
ipv6_global_network = "2a06:8782:ffbb:42::/64",
ipv6_uplink_network = "2a06:8782:ffbb::/64",
)
grp = inv.group("vpnservers_legacy",
dhcp=True,
batman_gateway=True,
firewall_enabled=True,
is_legacy=True,
)
grp.host(1, "vpn01.bremen.freifunk.net", exit_ipv4="default", exit_ipv4_interface="eth0", exit_ipv6_interface="eth0", max_mtu=1462)
grp = inv_v15.group("vpnservers",
dhcp=True,
batman_gateway=True,
firewall_enabled=True,
)
grp.host(7, "vpn07.bremen.freifunk.net", exit_ipv4="default", exit_ipv4_interface="ens16", exit_ipv6_interface="ens16", max_mtu=1438)
grp.host(8, "vpn08.bremen.freifunk.net", exit_ipv4="default", exit_ipv4_interface="ens16", exit_ipv6_interface="ens16", max_mtu=1438)
grp.host(9, "vpn09.bremen.freifunk.net", exit_ipv4="default", exit_ipv4_interface="ens16", exit_ipv6_interface="ens16", max_mtu=1438)
grp.host(10, "vpn10.bremen.freifunk.net", exit_ipv4="default", exit_ipv4_interface="ens16", exit_ipv6_interface="ens16", max_mtu=1438)
grp = inv.group("eventsserver")
grp.host(0, "mgmt.bremen.freifunk.net")
grp = inv.group("webserver")
grp.host(0, "webserver.bremen.freifunk.net")
grp = inv_v15.group("downlinks", batman_gateway=True, firewall_enabled=True)
grp.host(13, "ipv6-downlink.bremen.freifunk.net", exit_ipv6_interface="ens16", max_mtu=1462)
grp = inv.group("dnsserver");
grp.host(0, "dns.bremen.freifunk.net");
grp = inv.group("vmhosts")
grp.host(0, "bre-2.bremen.freifunk.net")
grp.host(0, "bre-3.bremen.freifunk.net")
grp = inv.group("ffmapserver")
grp.host(0, "ffmap.bremen.freifunk.net")
grp = inv.group("monitoring")
grp.host(0, "monitoring.bremen.freifunk.net")
# vpnservers und downlinks zu backbone zusammenfassen
grp = inv.group("backbone_legacy", is_legacy=True)
grp.child("vpnservers_legacy")
grp.child("downlinks_legacy")
# non legacy backbone
grp = inv_v15.group("backbone")
grp.child("vpnservers")
grp.child("downlinks")
# alle Root-Server mit Standard-Config
grp = inv.group("standardserver")
grp.host(0, "mail.bremen.freifunk.net")
grp.host(0, "jenkins.bremen.freifunk.net")
grp.host(0, "code.bremen.freifunk.net")
grp.host(0, "babel-gw-lwlcom.bremen.freifunk.net")
grp.host(0, "monitoring.bremen.freifunk.net")
grp.child("vmhosts")
grp.child("backbone")
grp.child("backbone_legacy")
grp.child("webserver")
grp.child("dnsserver")
grp.child("ffmapserver")
inv_dict = inv.data()
inv_dict.update(inv_v15.data())
print(json.dumps(inv_dict,indent=4))