Render isolated network templates using jinja2
authorDan Sneddon <dsneddon@redhat.com>
Mon, 19 Jun 2017 18:34:05 +0000 (11:34 -0700)
committerDan Sneddon <dsneddon@redhat.com>
Wed, 26 Jul 2017 18:43:12 +0000 (11:43 -0700)
commit6d68ce08e193043e144533b1e38b66457af1e4db
treefd5bcbcd959c85bed0915e686441a1961f2d9b44
parentdad8c01aaa56bdaad182f65fd6c652844ab73c3e
Render isolated network templates using jinja2

This change adds templates that are used to create network and
port definition templates for each network that is defined in
network_data.yaml. In order to render the templates, additional
fields have been added to the network_data.yaml file. If this
optional data is present, it will be used to populate the default
parameter values in the network template.

The only required parameters in the network_data.yaml file is
the network name. If the network will have IPv6 addresses, then
ipv6: true must be set on the network.

The existing networks have been modeled in the network_data.yaml,
but until these templates are removed from the j2_excludes.yaml
file they will not be generated on the fly. Any additional
networks will have templates generated.

This change also removes an unnecessary conditional from the
networks.j2.yaml file, since InternalApiNetwork doesn't need
to be reformatted as InternalNetwork (it's only used in this
one file).

A follow-up patch will remove the existing network definitions
so all networks are created dynamically.

Change-Id: If074f87494a46305c990a0ea332c7b576d3c6ed8
Depends-On: Iab8aca2f1fcaba0c8f109717a4b3068f629c9aab
Partially-Implements: blueprint composable-networks
j2_excludes.yaml
network/network.network.j2.yaml [new file with mode: 0644]
network/networks.j2.yaml
network/ports/port.network.j2.yaml [new file with mode: 0644]
network/ports/port_from_pool.network.j2.yaml [new file with mode: 0644]
network_data.yaml
tools/process-templates.py