bsdci / ioc

libioc command line tool for BSD jail management
Other
16 stars 1 forks source link

add a crude CLI tool to unset jail properties #14

Closed igalic closed 5 years ago

igalic commented 5 years ago

so far it's a copy of get with some fixups

igalic commented 5 years ago

hrm… not yet…

root@container-host1 /u/l/s/ioc# ioc unset basejail_type webirc
Deleting property 'basejail_type'
Unknown property 'basejail_type'
root@container-host1 /u/l/s/ioc# cat /iocage/jails/webirc/config.json
{
    "basejail": "yes",
    "basejail_type": "nullfs",
    "depends": "dhcp",
    "id": "webirc",
    "release": "12.0-RELEASE",
    "user.facts.role": "webirc",
    "user.pkglist": "puppet6,git-lite,node8,npm-node8,python27"
}
gronke commented 5 years ago

Jail config properties can already be unset by leaving them empty. There is no need to add an additional command.

Set a Jail config value to None

Both commands achieve the same goal, setting ip4_addr to None:

ioc set ip4_addr= <MYJAIL>
ioc set ip4_addr=- <MYJAIL>

Delete a Jail config property

Whatever value was set, the property is removed from the config(file) entirely. When modifying defaults, ioc will fall back to the hardcoded global defaults again:

ioc set ip4_addr <MYJAIL>
igalic commented 5 years ago

so i guess my issue was that i was trying to unset a virtual property