netplan

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2020 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package netplan implements support for reading Netplan.io compatible yaml formatted config files. Missing parts are:

  • This package does not care about or respect the hierarchical configuration files that netplan.io supports. netwrangler is designed to run as part of initial system configuration (either initial OS install or image deployment) with the network layout for the system being fed to it from an external source (dr-provision or some other provisioning engine).
  • There is no support for nic renaming or MAC address reassignment. Support for these features may be added in a future release.
  • There is no support for wifi or for separate backend renderers on a per-interface basis. The former may be added in a future release, the latter is never likely to be added.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bond added in v0.7.0

type Bond struct {
	Common
	Interfaces []string               `json:"interfaces,omitempty"`
	Parameters map[string]interface{} `json:"parameters,omitempty"`
}

type Bridge added in v0.7.0

type Bridge struct {
	Common
	Interfaces []string               `json:"interfaces,omitempty"`
	Parameters map[string]interface{} `json:"parameters,omitempty"`
}

type Common added in v0.7.0

type Common struct {
	*util.Network
	MacAddress gnet.HardwareAddr `json:"macaddress,omitempty"`
	Renderer   string            `json:"renderer,omitempty"`
	Optional   bool              `json:"optional,omitempty"`
}

type Ether added in v0.7.0

type Ether struct {
	Common
	Match     map[string]string `json:"match,omitempty"`
	WakeOnLan bool              `json:"wakeonlan,omitempty"`
}

type Netplan

type Netplan struct {
	Network struct {
		Version   int                    `json:"version"`
		Renderer  string                 `json:"renderer,omitempty"`
		Ethernets map[string]interface{} `json:"ethernets,omitempty"`
		Bridges   map[string]interface{} `json:"bridges,omitempty"`
		Bonds     map[string]interface{} `json:"bonds,omitempty"`
		Vlans     map[string]interface{} `json:"vlans,omitempty"`
		Wifis     map[string]interface{} `json:"wifis,omitempty"`
	} `json:"network"`
	// contains filtered or unexported fields
}

Netplan is the basic struct for netplan.io style network configs.

func New added in v0.7.0

func New(l *util.Layout) *Netplan

New creates a new Netplan that will render using networkd.

func (*Netplan) BindMacs added in v0.7.0

func (n *Netplan) BindMacs()

func (*Netplan) Compile added in v0.7.0

func (n *Netplan) Compile(phys []util.Phy) (*util.Layout, error)

func (*Netplan) Read

func (n *Netplan) Read(src string, phys []util.Phy) (*util.Layout, error)

Read satisfies the Reader interface so that Netplan can be used as a input format.

func (*Netplan) Write added in v0.7.0

func (n *Netplan) Write(dest string) error

type Vlan added in v0.7.0

type Vlan struct {
	Common
	ID   int    `json:"id"`
	Link string `json:"link"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL