junos_interface
Manages interface configuration on Juniper Junos devices over SSH. Uses Junos set-style configuration commands with commit semantics.
SSH connection parameters are auto-injected by the gateway proxy.
Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
interface |
Yes | -- | Interface name (e.g., ge-0/0/0) |
description |
No | -- | Interface description |
ip_address |
No | -- | IP address with prefix length (e.g., 10.0.1.1/24) |
unit |
No | 0 |
Logical unit number |
state |
No | present |
present to apply the interface configuration, absent to remove it |
family |
No | inet |
Address family (inet, inet6) |
host |
Auto | -- | Target IP/hostname (auto-injected) |
port |
Auto | 22 |
SSH port (auto-injected) |
username |
Auto | -- | SSH user (auto-injected) |
credential |
Auto | -- | Password or SSH key (auto-injected) |
Idempotency
- Runs
show configuration interfaces {interface}on the device - Compares each specified parameter against current config
- Only pushes changes for parameters that differ
- Uses
committo apply (Junos commit is atomic)
Examples
Configure an interface
resources:
- name: uplink-interface
type: junos_interface
interface: ge-0/0/0
description: "WAN Uplink"
ip_address: "10.0.1.1/24"
unit: "0"
family: inet
Configure a loopback
resources:
- name: loopback
type: junos_interface
interface: lo0
ip_address: "10.255.0.1/32"
unit: "0"