junos_interface
Experimental. The settings Conn3x owns on one interface of a Juniper Junos device: description, enabled, MTU, and on an ELS switch port the interface-mode and VLAN members. Each one left unset is left alone, and so is every other statement under the interface.
Experimental. Network devices are new, and this module may change between releases. It’s tested against vJunos-switch 26.2R1.7 on a lab VM, not yet in CI.
Use junos_interface to own a few settings on one interface of a Juniper Junos device: its description, whether it’s enabled, its MTU, and on an ELS switch port, whether it’s an access port or a trunk and which VLANs it carries. Every setting you leave unset is left alone, and so is everything else under the interface, its addresses included. The change goes in like every Junos step does, once per device per circuit; see junos_config.
enabled = false is refused on a management interface (fxp0, em0, me0, vme), and on the interface whose address Conn3x connects to, since that would cut Conn3x off. commit confirmed would undo it, but only after five minutes.
Example usage
Section titled “Example usage”An access port:
step "desk" { junos_interface { name = "ge-0/0/5" description = "desk 12" mode = "access" access_vlan = "users" }}A trunk to the next switch. VLANs not listed are taken off it:
step "uplink" { junos_interface { name = "ae0" description = "to core" mode = "trunk" allowed_vlans = ["users", "voice", "100-110"] mtu = 9216 }}Arguments
Section titled “Arguments”| Name | Type | Required | Description |
|---|---|---|---|
access_vlan |
string | No | The VLAN of an access port, by name or ID, as vlan members. |
allowed_vlans |
list of string | No | The VLANs a trunk carries, by name, ID or range such as 20-22. Members not listed are deleted. |
description |
string | No | Its description. No double quotes or backslashes. |
enabled |
bool | No | false disables it, true deletes the disable. Disabling a management interface (fxp0, em0, me0, vme), or the one whose address Conn3x connects to, is refused. |
mode |
string | No | “access” or “trunk”: unit 0 family ethernet-switching interface-mode. Switch ports and ae interfaces only. |
mtu |
number | No | MTU, 256 to 9216. |
name |
string | Yes | The interface, such as ge-0/0/1, xe-0/0/48, ae0, irb or lo0. |
on_remove |
string | No | What happens when this resource is removed: “forget” (default) leaves the interface as it is, “delete” deletes the statements it owns. The interface itself stays. |
Read-only attributes
Section titled “Read-only attributes”Conn3x sets these; reference them as conn3x_junos_interface.<circuit>__<step>["<host>"].<name>.
| Name | Type | Description |
|---|---|---|
in_sync |
bool | Whether the interface had these settings at the last refresh. |
revision |
string | Changes each time Conn3x changes this on the host. Handlers watch it. |
A step lowers to the conn3x_junos_interface resource, one instance per host, and connects with its circuit’s ssh block.