-
|
for a small team, who just want to test their scripts will mostly work, without spinning hundreds of vms on their cloud provider. what is the most convenient way to test cloud-init files? my current setup is to
this is enough to give me a OK if there are any obvious errors, but i'd like to take to the next step and actually execute the file. I'm aware of having to deal with side effects and that's ok, but I wish i could use the convenience of disposable docker instances and being already logged in the machine before execution so i can inspect it more easily. (something like i'd like to avoid having to deal with meta-data/vendor files, temporary webservers, local dns hacks, qemu, etc. Is this possible? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
for the record, this is what we use today, and the experience is awful. default: clean build
.PHONY: clean
clean:
-rm root.qcow2
debian-original.qcow2:
curl -o $@ -L https://cloud.debian.org/images/cloud/trixie/latest/debian-13-genericcloud-amd64.qcow2
root.qcow2: debian-original.qcow2
cp $< $@
seed-www.iso: src/www.yaml meta-data
touch network-config
touch meta-data
cp src/www.yaml user-data
genisoimage -output $@ -volid cidata -rational-rock -joliet user-data meta-data network-config
.PHONY: build
build: seed-www.iso root.qcow2
qemu-system-x86_64 -m 1024 -net nic -net user \
-netdev user,id=net0,hostfwd=tcp::2222-:22 \
-device virtio-net-pci,netdev=net0 \
-hda root.qcow2 \
-cdrom seed-www.iso &then if at least the minimal user/keys/ssh/etc steps worked, we can ssh to the qemu vm and inspect |
Beta Was this translation helpful? Give feedback.
-
I would use LXD. This allows using different distros, running an lxc container locally, login during early boot, and no need to run any commands manually. Just pass the user-data, vendor-data, and meta-data as arguments on launch then execute |
Beta Was this translation helpful? Give feedback.
I would use LXD. This allows using different distros, running an lxc container locally, login during early boot, and no need to run any commands manually. Just pass the user-data, vendor-data, and meta-data as arguments on l…