Skip to main content

Update

Replace an existing Netplan interface configuration on a target host. Fails if no OSAPI-managed configuration exists for that interface -- use create first. Returns changed: false if the content has not changed:

$ osapi client node network interface update \
--target web-01 --name eth0 \
--address 192.168.1.200/24 \
--gateway4 192.168.1.1 \
--mtu 9000

Job ID: 550e8400-e29b-41d4-a716-446655440000

NAME CHANGED
eth0 true

When the configuration is unchanged, changed is false:

$ osapi client node network interface update \
--target web-01 --name eth0 \
--address 192.168.1.200/24 \
--gateway4 192.168.1.1 \
--mtu 9000

Job ID: 550e8400-e29b-41d4-a716-446655440000

NAME CHANGED
eth0 false

Broadcast an update to all hosts:

$ osapi client node network interface update \
--target _all --name eth0 --dhcp4

Job ID: 550e8400-e29b-41d4-a716-446655440000

HOSTNAME NAME CHANGED
web-01 eth0 true
web-02 eth0 true

JSON Output

Use --json to get the full API response:

$ osapi client node network interface update \
--target web-01 --name eth0 \
--address 192.168.1.200/24 --json
{"results":[{"hostname":"web-01","name":"eth0",
"changed":true,"status":"ok"}],"job_id":"..."}

Flags

FlagDescriptionDefault
--nameInterface namerequired
--dhcp4Enable DHCPv4
--dhcp6Enable DHCPv6
--addressIP address in CIDR notation (repeatable)
--gateway4IPv4 gateway address
--gateway6IPv6 gateway address
--mtuMaximum transmission unit
--mac-addressHardware MAC address
--wakeonlanEnable Wake-on-LAN
-T, --targetTarget: _any, _all, hostname, or label (group:web)_any
-j, --jsonOutput raw JSON response