supernode 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. local_node: "{{supernodes[0]}}"
  2. supernode_mesh_mac: "{{local_node.mesh_mac}}"
  3. supernode_mesh_ipv4: "{{local_node.mesh_ip_v4}}"
  4. supernode_bat_macaddress: "{{local_node.bat_mac}}"
  5. supernode_mesh_ipv6: "{{local_node.mesh_ip_v6}}"
  6. supernode_local_ip: "{{local_node.public_ip|default(ansible_default_ipv4.address)}}"
  7. supernode_public_interface: "{{local_node.public_interface|default(ansible_default_ipv4.interface)}}"
  8. supernode_dhcp_range_start: "{{local_node.dhcp_range_start}}"
  9. supernode_dhcp_range_end: "{{local_node.dhcp_range_end}}"
  10. supernode_mesh_backbones:
  11. - name: "{{supernodes[1].name}}"
  12. remote_ip: "{{supernodes[1].public_ip|ipaddr('address')}}"
  13. mesh_ip: "{{supernodes[1].mesh_ip_v4|ipaddr('address')}}"
  14. address_v6: "{{supernodes[1].mesh_ip_v6|ipaddr('address')}}"
  15. local_ip: "{{supernode_local_ip|ipaddr('address')}}"
  16. interface: "{{supernode_public_interface}}"
  17. - name: "{{supernodes[2].name}}"
  18. remote_ip: "{{supernodes[2].public_ip|ipaddr('address')}}"
  19. mesh_ip: "{{supernodes[2].mesh_ip_v4|ipaddr('address')}}"
  20. address_v6: "{{supernodes[2].mesh_ip_v6|ipaddr('address')}}"
  21. local_ip: "{{supernode_local_ip|ipaddr('address')}}"
  22. interface: "{{supernode_public_interface}}"
  23. supernode_other_nameserver: "{{supernode_mesh_backbones|map(attribute='mesh_ip')|map('ipaddr','address')|join(', ')}}"
  24. supernode_other_ntp_server: "{{supernode_mesh_backbones|map(attribute='mesh_ip')|map('ipaddr','address')|join(', ')}}"
  25. supernode_uplinks:
  26. - name: "{{uplinks[0].name}}"
  27. comment: "{{uplinks[0].tunnel[0].comment|default('No comment')}}"
  28. address: "{{local_node.uplink_tunnel_ip|ipaddr('address')}}"
  29. dstaddr: "{{uplinks[0].tunnel[0].tunnel_ip|ipaddr('address')}}"
  30. netmask: "{{uplinks[0].tunnel[0].tunnel_ip|ipaddr('netmask')}}"
  31. endpoint: "{{uplinks[0].public_ip|ipaddr('address')}}"
  32. address_v6: "{{local_node.uplink_tunnel_ip_v6}}"
  33. as: "{{uplinks[0].as}}"
  34. supernode_interfaces:
  35. - name: eth0
  36. auto: true
  37. proto: inet
  38. type: dhcp
  39. - name: eth1
  40. auto: true
  41. proto: inet
  42. type: static
  43. config:
  44. - key: address
  45. value: "{{supernode_local_ip|ipaddr('address')}}"
  46. - key: netmask
  47. value: "{{supernode_local_ip|ipaddr('netmask')}}"
  48. - key: broadcast
  49. value: "{{supernode_local_ip|ipaddr('broadcast')}}"