nuagenetworks / nuxctl

NuageX CLI tool
https://nuxctl.nuagex.io/
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

add templating capabilities to Lab definition file #9

Open hellt opened 6 years ago

hellt commented 6 years ago

complex lab definitions have a lot of duplication in the references: network names, common net octets in addresses, etc

it would be nice to have a variables section inside that will be read by the parses and template the rest of the file. For instance:

nuxctl_variables:
  pc1_name: pc01
  pc1_ip: 10.0.0.101
  pc2_name: pc02
  pc2_ip: 10.0.0.102

services:
  - name: rdp-{{pc1_name}}
    type: public
    port: 33891
    protocols:
    - tcp
    destination:
      port: 3389
      address: {{pc1_ip}}
  - name: rdp-{{pc2_name}}
    type: public
    port: 33892
    protocols:
    - tcp
    destination:
      port: 3389
      address: {{pc2_ip}}