updated templates and scripts for Airship 1.3
[yaml_builds.git] / site_type / sriov-a13 / templates / networks / physical / networks.j2
@@ -58,11 +58,11 @@ metadata:
   storagePolicy: cleartext
 data:
   # NEWSITE-CHANGEME: Update with the site's out-of-band CIDR
-  cidr: 10.23.104.0/24
+  cidr: {{yaml.networks.oob.cidr}}
   routes:
     # NEWSITE-CHANGEME: Update with the site's out-of-band gateway IP
     - subnet: '0.0.0.0/0'
-      gateway: 10.23.104.1
+      gateway: {{yaml.networks.oob.routes.gateway}}
       metric: 100
   # NEWSITE-CHANGEME: Update with the site's out-of-band IP allocation range
   # FIXME: Is this IP range actually used/allocated for anything? The HW already
@@ -70,8 +70,8 @@ data:
   # network either, as they should be routable via the default gw on OAM network
   ranges:
     - type: static
-      start: 10.23.104.11
-      end: 10.23.104.21
+      start: {{yaml.networks.oob.ranges.static.start}}
+      end: {{yaml.networks.oob.ranges.static.end}}
 ...
 ---
 schema: 'drydock/NetworkLink/v1'
@@ -105,11 +105,11 @@ metadata:
 data:
   # NEWSITE-CHANGEME: Update with the site's PXE network CIDR
   # NOTE: The CIDR minimum size = (number of nodes * 2) + 10
-  cidr: 10.23.20.0/24
+  cidr: {{yaml.networks.pxe.cidr}}
   routes:
     - subnet: 0.0.0.0/0
       # NEWSITE-CHANGEME: Set the OAM network gateway IP address
-      gateway: 10.23.20.1
+      gateway: {{yaml.networks.pxe.routes.gateway}}
       metric: 100
   # NOTE: The first 10 IPs in the subnet are reserved for network infrastructure.
   # The remainder of the range is divided between two subnets of equal size:
@@ -122,27 +122,29 @@ data:
   ranges:
     # NEWSITE-CHANGEME: Update to the first 10 IPs in the CIDR
     - type: reserved
-      start: 10.23.20.1
-      end: 10.23.20.10
+      start: {{yaml.networks.pxe.ranges.reserved.start}}
+      end: {{yaml.networks.pxe.ranges.reserved.end}}
     # NEWSITE-CHANGEME: Update to the first half of the remaining range after
     # excluding the 10 reserved IPs.
     - type: static
-      start: 10.23.20.11
-      end: 10.23.20.21
+      start: {{yaml.networks.pxe.ranges.static.start}}
+      end: {{yaml.networks.pxe.ranges.static.end}}
     # NEWSITE-CHANGEME: Update to the second half of the remaining range after
     # excluding the 10 reserved IPs.
     - type: dhcp
-      start: 10.23.20.121
-      end: 10.23.20.131
+      start: {{yaml.networks.pxe.ranges.dhcp.start}}
+      end: {{yaml.networks.pxe.ranges.dhcp.end}}
   dns:
     # NEWSITE-CHANGEME: FQDN for bare metal nodes.
     # Choose FQDN according to the node FQDN naming conventions at the top of
     # this document.
-    domain: airship-seaworthy.atlantafoundry.com
+    domain: {% if 'dns' in yaml.networks.pxe and 'domain' in yaml.networks.pxe.dns %}{{yaml.networks.pxe.dns.domain}}
+            {% else %}{{yaml.dns.domain}}
+            {% endif %}
     # List of upstream DNS forwards. Verify you can reach them from your
     # environment. If so, you should not need to change them.
     # TODO: This should be populated via substitution from common-addresses
-    servers: '8.8.8.8,8.8.4.4,208.67.222.222'
+    servers: '{% if 'dns' in yaml.networks.pxe %}{{yaml.networks.pxe.dns.servers}}{% else %}{{yaml.dns.upstream_servers|join(' ')}}{% endif %}'
 ...
 ---
 schema: 'drydock/NetworkLink/v1'
@@ -155,18 +157,22 @@ metadata:
   storagePolicy: cleartext
 data:
   bonding:
+{% if yaml.networks.bonded %}
     mode: 802.3ad
     hash: layer3+4
     peer_rate: fast
     mon_rate: 100
     up_delay: 1000
     down_delay: 3000
+{% else %}
+    mode: disabled
+{% endif %}
   # NEWSITE-CHANGEME: Ensure the network switches in the environment are
   # configured for this MTU or greater. Even if switches are configured for or
   # can support a slightly higher MTU, there is no need (and negliable benefit)
   # to squeeze every last byte into the MTU (e.g., 9216 vs 9100). Leave MTU at
   # 9100 for maximum compatibility.
-  mtu: 9100
+  mtu: 9000
   linkspeed: auto
   trunking:
     mode: 802.1q
@@ -187,35 +193,37 @@ metadata:
   storagePolicy: cleartext
 data:
   # NEWSITE-CHANGEME: Set the VLAN ID which the OAM network is on
-  vlan: '21'
-  mtu: 9100
+  vlan: '{{yaml.networks.host.vlan}}'
+  mtu: 9000
   # NEWSITE-CHANGEME: Set the CIDR for the OAM network
   # NOTE: The CIDR minimum size = number of nodes + 10
-  cidr: 10.23.21.0/24
+  cidr: {{yaml.networks.host.cidr}}
   routes:
     - subnet: 0.0.0.0/0
       # NEWSITE-CHANGEME: Set the OAM network gateway IP address
-      gateway: 10.23.21.1
+      gateway: {{yaml.networks.host.routes.gateway}}
       metric: 100
   ranges:
     # NEWSITE-CHANGEME: Update to the first 10 IPs in the CIDR
     - type: reserved
-      start: 10.23.21.1
-      end: 10.23.21.10
+      start: {{yaml.networks.host.ranges.reserved.start}}
+      end: {{yaml.networks.host.ranges.reserved.end}}
     # NEWSITE-CHANGEME: Update to the remaining range after excluding the 10
     # 10 reserved IPs.
     - type: static
-      start: 10.23.21.11
-      end: 10.23.21.21
+      start: {{yaml.networks.host.ranges.static.start}}
+      end: {{yaml.networks.host.ranges.static.end}}
   dns:
     # NEWSITE-CHANGEME: FQDN for bare metal nodes.
     # Choose FQDN according to the node FQDN naming conventions at the top of
     # this document.
-    domain: airship-seaworthy.atlantafoundry.com
+    domain: {% if 'dns' in yaml.networks.host and 'domain' in yaml.networks.host.dns %}{{yaml.networks.host.dns.domain}}
+            {% else %}{{yaml.dns.domain}}
+            {% endif %}
     # List of upstream DNS forwards. Verify you can reach them from your
     # environment. If so, you should not need to change them.
     # TODO: This should be populated via substitution from common-addresses
-    servers: '8.8.8.8,8.8.4.4,208.67.222.222'
+    servers: '{% if 'dns' in yaml.networks.host %}{{yaml.networks.host.dns.servers}}{% else %}{{yaml.dns.upstream_servers|join(' ')}}{% endif %}'
 ...
 ---
 schema: 'drydock/Network/v1'
@@ -228,21 +236,21 @@ metadata:
   storagePolicy: cleartext
 data:
   # NEWSITE-CHANGEME: Set the VLAN ID which the storage network is on
-  vlan: '23'
-  mtu: 9100
+  vlan: '{{yaml.networks.storage.vlan}}'
+  mtu: 9000
   # NEWSITE-CHANGEME: Set the CIDR for the storage network
   # NOTE: The CIDR minimum size = number of nodes + 10
-  cidr: 10.23.23.0/24
+  cidr: {{yaml.networks.storage.cidr}}
   ranges:
     # NEWSITE-CHANGEME: Update to the first 10 IPs in the CIDR
     - type: reserved
-      start: 10.23.23.1
-      end: 10.23.23.10
+      start: {{yaml.networks.storage.ranges.reserved.start}}
+      end: {{yaml.networks.storage.ranges.reserved.end}}
     # NEWSITE-CHANGEME: Update to the remaining range after excluding the 10
     # 10 reserved IPs.
     - type: static
-      start: 10.23.23.11
-      end: 10.23.23.21
+      start: {{yaml.networks.storage.ranges.static.start}}
+      end: {{yaml.networks.storage.ranges.static.end}}
 ...
 ---
 schema: 'drydock/Network/v1'
@@ -255,21 +263,21 @@ metadata:
   storagePolicy: cleartext
 data:
   # NEWSITE-CHANGEME: Set the VLAN ID which the overlay network is on
-  vlan: '24'
-  mtu: 9100
+  vlan: '{{yaml.networks.neutron.vlan}}'
+  mtu: 9000
   # NEWSITE-CHANGEME: Set the CIDR for the overlay network
   # NOTE: The CIDR minimum size = number of nodes + 10
-  cidr: 10.23.24.0/24
+  cidr: {{yaml.networks.neutron.cidr}}
   ranges:
     # NEWSITE-CHANGEME: Update to the first 10 IPs in the CIDR
     - type: reserved
-      start: 10.23.24.1
-      end: 10.23.24.10
+      start: {{yaml.networks.neutron.ranges.reserved.start}}
+      end: {{yaml.networks.neutron.ranges.reserved.end}}
     # NEWSITE-CHANGEME: Update to the remaining range after excluding the 10
     # 10 reserved IPs.
     - type: static
-      start: 10.23.24.11
-      end: 10.23.24.21
+      start: {{yaml.networks.neutron.ranges.static.start}}
+      end: {{yaml.networks.neutron.ranges.static.end}}
 ...
 ---
 schema: 'drydock/Network/v1'
@@ -282,19 +290,19 @@ metadata:
   storagePolicy: cleartext
 data:
   # NEWSITE-CHANGEME: Set the VLAN ID which the calico network is on
-  vlan: '22'
-  mtu: 9100
+  vlan: '{{yaml.networks.ksn.vlan}}'
+  mtu: 9000
   # NEWSITE-CHANGEME: Set the CIDR for the calico network
   # NOTE: The CIDR minimum size = number of nodes + 10
-  cidr: 10.23.22.0/24
+  cidr: {{yaml.networks.ksn.cidr}}
   ranges:
     # NEWSITE-CHANGEME: Update to the first 10 IPs in the CIDR
     - type: reserved
-      start: 10.23.22.1
-      end: 10.23.22.10
+      start: {{yaml.networks.ksn.ranges.reserved.start}}
+      end: {{yaml.networks.ksn.ranges.reserved.end}}
     # NEWSITE-CHANGEME: Update to the remaining range after excluding the 10
     # 10 reserved IPs.
     - type: static
-      start: 10.23.22.11
-      end: 10.23.22.21
+      start: {{yaml.networks.ksn.ranges.static.start}}
+      end: {{yaml.networks.ksn.ranges.static.end}}
 ...