How can I use cloud-init NoCloud with OPNsense 21?
1
vote
1
answer
1424
views
I'm new to OPNSense (also to FreeBSD in general) and I'm interested to use cloud-init to configure at least LAN (vtnet0) with static ip address, root password and eventually running custom scripts (or shell commands) in a OPNsense VM created with Qemu to apply a custom configuration.
I saw that opnsense github repo has cloud-init port , so I installed it with:
pkg install net/cloud-init
Then I added cidata.iso image to Qemu as required by cloud-init NoCloud with user-data and meta-data.
I already tested those files on ubuntu server 21 and kali linux. They are correct at least on those OSs ;)
I found the cdrom as /dev/cd0 and mounted with
mkdir -p /media/cdrom
mount -t cd9660 /dev/cd0 /media/cdrom
I also edited /etc/fstab appending this line:
/dev/cd0 /media/cdrom cd9660 ro 0 0
to auto mount the cdrom at boot.
Finally, I created (because unexisting) /etc/rc.conf with this content:
cloudinit_enable="YES"
and restarted my OPNsense VM.
What I expect now is that cloud-init will start automatically at boot.
However this doesn't happen, probably because I have to configure something.
If I run
cloud-init init
via terminal it throws error:
stages.py[WARNING]: Failed to rename devices: Unexpected error while running command.
Command [ip
, -6
, addr
,show
, permanent
, scope
,global
]
Exit code: -
Reason: [Errno 2] No such file or directory: bip
Stdout: -
Stderr: -
No init
modules to run under section cloud_init_modules
On both Kali Linux and Ubuntu Server it works easely.
I have some questions about this:
1) Is it possible to use cloud-init port with NoCloud and a cdrom (cidata) with configuration files or it supports only Cloud services with OpenStack and so on?
2) Is my configuration above correct or am I missing something?
3) Why does it appear the error above? How can I fix it?
I already posted this question here , but I didn't receive answers.
Asked by Stefano Cappa
(151 rep)
Oct 7, 2021, 02:38 PM
Last activity: Jul 10, 2023, 10:46 PM
Last activity: Jul 10, 2023, 10:46 PM