Skip to content

Nodes | Topology Syntax Guide

Michael Albert edited this page Jun 27, 2017 · 4 revisions

NOTE: Advanced node support will be expanded in future releases.

Nodes are representations of a computer on a network. Nodes correspond 1-to-1 with Linux Containers, unless the user has specified a different node implementation.

Flags Supported

  • position[s]: static position or map of "time: x y z" values.
  • iface[s]/interface[s]: list of interface names
  • type: type of the node, used for instantiation via NodeTypeMap
  • template: node to inherit attributes from
  • application[s]: list of applications to install on the node (can also be done at topology level separately)
  • command[s]: list of commands to run on the node (can also be done at topology level separately)
  • User-specified Flags: any flag not listed above is saved and passed to the NodeType to handle (if it so chooses)

If a template is used for a node declaration, other flags specified in the node override the template node's declaration of that flag.

Node Types Supported

There are three officially supported types as of v0.1, they are:

  • ubuntu: Ubuntu 16.04/xenial
  • fedora: Fedora 25
  • archlinux: Current Archlinux

If no type is specified, it defaults to what is set in the Settings file (NODE_TYPE).

Additional Linux distros (like Redhat, Debian, Mint, or CentOs) probably work, but have not been verified. Simply add a mapping in NodeTypeMap.cpp with the appropriate arguments to the LxcContainer class to try out other distros (see the Adding a Node Type Guide).

Examples

A simple node with a single interface named eth0 of default type:

# ...
nodes:
  - MyVerySpecialNode:
      iface: eth0

A node with a position, using a template (inherit attributes from another node), and specifying commands:

# ...
nodes:
  - MyVerySpecialNode:
      template: anOKNode #name of node using as a template
      type: archlinux #replace templated node's type with archlinux type
      position: 0 10 0 #set a constant position
      commands: #commands will be run in sequence specified
        - ls
        - mkdir folder