Skip to content

Latest commit

 

History

History
47 lines (38 loc) · 1.54 KB

File metadata and controls

47 lines (38 loc) · 1.54 KB

Introduction

Nmpolicy is an expressions driven declarative API for dynamic network configuration.

Nmpolicy contains two sections:

  • capture: Rule to filter desire state
  • desired or desiredState: Use capture data to generate new state.

Using nmpolicy allows user to generate desired state base on current network state.

Example YAML for changing gateway interface MTU to 1280.

capture:
  gw: routes.running.destination=="0.0.0.0/0"
  gw-iface: interfaces.name==capture.gw.routes.running.0.next-hop-interface
desired:
  interfaces:
  - name: "{{ capture.gw-iface.interfaces.0.name}}"
    type: ethernet
    state: up
    mtu: 1280

You may applying this YAML directly through nmstatectl apply or use nmstatectl policy to generate desired state without apply.

Documentation