A second design
Put a site and its /16 supernet in a country from your first design, and meet variables.
The second design creates a site in one of the countries from your first design, and a /16 supernet for the site's subnets. Unlike the first, it asks you for values when you plan it.
Read the design
name: Site Foundation
netbox_versions: ["4.6.*", "4.7.*"]
description: A site in a country, with a /16 supernet for its subnets.
variables:
site_name: $USER
site_slug: $USER
region: $USER
supernet: $USER
status: active
infra:
- infra_type: Site
name: '{{ variables.site_name }}'
slug: '{{ variables.site_slug }}'
status: '{{ variables.status }}'
region: '{{ variables.region }}'
- infra_type: Prefix
prefix: '{{ variables.supernet }}'
status: container
site: '{{ variables.site_slug }}'
description: 'Site supernet for {{ variables.site_name }}'variablesdeclares the design's inputs.$USERmeans you must give a value when you plan.status: activeis a default, so the deploy page doesn't ask for it.{{ variables.site_name }}is replaced with the value you give. Expressions like this can appear anywhere a value can.region: '{{ variables.region }}'names a region your first design created. A reference written as text finds its object by the object's name or slug, soLatviaandlatviaboth work.site: '{{ variables.site_slug }}'places the prefix in the site the same design creates.
Variables covers them in more depth.
Add it and plan it
-
Add the design to the catalogue as
tutorial/site_foundation, as you did the first. -
Open it and select Deploy, then choose your NetBox.
-
Leave New deployment selected, with the name
site_foundation. -
Under Variables, fill in the four the design asks for:
Variable Value site_nameRiga DCsite_slugriga-dcregionLatviasupernet10.10.0.0/16 -
Select Plan.
The plan has 2 creates: the site and the prefix. A region that names none in NetBox, or in the design, refuses the plan instead, saying which.
Apply it and look
Apply the plan. In NetBox, the site Riga DC is in the region Latvia, and the prefix 10.10.0.0/16 is a container scoped to it.
Plan the deployment again from Deployments, as before: there's nothing to do.
Next, the compute rack puts a rack in this site, built from other designs.