Skip to main content

DNS

The behaviors that dns calls, and each call that its examples make. osapi behavior chain get --name dns shows the same.

Chain​

Behaviordns
Chaindns → netplan → managedfile
Callsnetplan
Used bynone

Set the servers of an interface (update)​

CALLSENDSGETS
dns updateinterface_name=eth0 servers=[9.9.9.9]changed=true interface_name=eth0
└─ netplan getname=eth0id=eth0 matches=[eth0] name=eth0 section=ethernets type=ethernet
└─ netplan updatecontent=<9 lines> metadata={"domain":"dns","interface":"eth0"} path=/…changed=true path=/etc/netplan/osapi-dns-eth0.yaml
· └─ managedfile updatecontent=<9 lines> metadata={"domain":"dns","interface":"eth0"} mode=0…changed=true path=/etc/netplan/osapi-dns-eth0.yaml

Set the search domains, and keep the servers (update)​

CALLSENDSGETS
dns updateinterface_name=eth0 override_dhcp=true search_domains=[corp.example]changed=true interface_name=eth0
└─ netplan getname=eth0id=eth0 matches=[eth0] name=eth0 section=ethernets type=ethernet
└─ netplan updatecontent=<14 lines> metadata={"domain":"dns","interface":"eth0"} path=…changed=true path=/etc/netplan/osapi-dns-eth0.yaml
· └─ managedfile updatecontent=<14 lines> metadata={"domain":"dns","interface":"eth0"} mode=…changed=true path=/etc/netplan/osapi-dns-eth0.yaml

An interface with no resolvers yet (update)​

CALLSENDSGETS
dns updateinterface_name=eth0 servers=[9.9.9.9]changed=true interface_name=eth0
└─ netplan getname=eth0id=eth0 matches=[eth0] name=eth0 section=ethernets type=ethernet
└─ netplan updatecontent=<7 lines> metadata={"domain":"dns","interface":"eth0"} path=/…changed=true path=/etc/netplan/osapi-dns-eth0.yaml
· └─ managedfile updatecontent=<7 lines> metadata={"domain":"dns","interface":"eth0"} mode=0…changed=true path=/etc/netplan/osapi-dns-eth0.yaml

An interface osapi set (delete)​

CALLSENDSGETS
dns deleteinterface_name=eth0changed=true interface_name=eth0
└─ netplan deletepath=/etc/netplan/osapi-dns-eth0.yamlchanged=true path=/etc/netplan/osapi-dns-eth0.yaml
· └─ managedfile deletepath=/etc/netplan/osapi-dns-eth0.yamlchanged=true path=/etc/netplan/osapi-dns-eth0.yaml

An interface osapi set nothing on (delete)​

CALLSENDSGETS
dns deleteinterface_name=eth0changed=false interface_name=eth0
└─ netplan deletepath=/etc/netplan/osapi-dns-eth0.yamlchanged=false path=/etc/netplan/osapi-dns-eth0.yaml
· └─ managedfile deletepath=/etc/netplan/osapi-dns-eth0.yamlchanged=false path=/etc/netplan/osapi-dns-eth0.yaml