I have installed cloud-init on FreeBSD, from the pkg repository. FreeBSD is running on oVirt, using the config-drive datasource. I use it to set a different hostname of the machine on boot.
My problem is that I don't get it running in the "local" stage. The earlierst stage that works for me is the "init" stage, but in that stage, /etc/rc.conf already set a hostname and got an IP with DHCP, which communicates the hostname to DNS automatically. When cloud-init sets another hostname afterwards, I cannot access the host via that hostname, because DNS knows nothing about it.
There is a cloudinitlocal rc script in /usr/local/etc/rc.d/cloudinitlocal, which might be running in the "local" stage. I tried to achieve that with the following in /usr/local/etc/cloud/cloud.cfg:
datasource:
ConfigDrive:
dsmode: local
But that didn't have the desired effect. I also tried to add the following, for cloud-init to run the local stage:
cloud_local_modules:
- set_hostname
- update_hostname
Which didn't seem to run anything in the "local" stage either.
So my question is: How can I make cloud-init on FreeBSD run something in the "local" stage?