Use cases

Dynamic inventory

A common use case involves managing environments where the operator lacks root access on the iocage host. Unprivileged access on the host is sufficient to execute iocage list commands and generate the dynamic inventory, allowing the user to manage individual jail guests without escalated root privileges (see 010 Clone basejails and create inventory).

However, if your setup relies on dynamically assigned DHCP addresses, root access on the host is required to inspect and discover those IPs. For these scenarios, configure the sudo and sudo_preserve_env options within the iocage inventory plugin to handle host privilege escalation securely.

If the root is not granted, configure hooks and use the hooks_results option.