Closed TheBeems closed 3 years ago
I have been playing around with the terraform provider for xenorchestra and wanted to use cloud-init to setup my vm's.
I found that the example given in the documentation does not work:
resource "xenorchestra_cloud_config" "demo" { name = "cloud config name" template = <<EOF #cloud-init runcmd: - [ ls, -l, / ] - [ sh, -xc, "echo $(date) ': hello world!'" ] - [ sh, -c, echo "=========hello world'=========" ] - ls -l /root EOF } resource "xenorchestra_vm" "bar" { // ... cloud_config = xenorchestra_cloud_config.demo.template // ... }
The culprit is the commentline #cloud-init
#cloud-init
After changing this to #cloud-config, all worked fine. Took me a full hour to figure this out why the cloud-init wasn't working. I suggest to change the documentation into the following:
#cloud-config
resource "xenorchestra_cloud_config" "demo" { name = "cloud config name" template = <<EOF #cloud-config runcmd: - [ ls, -l, / ] - [ sh, -xc, "echo $(date) ': hello world!'" ] - [ sh, -c, echo "=========hello world'=========" ] - ls -l /root EOF } resource "xenorchestra_vm" "bar" { // ... cloud_config = xenorchestra_cloud_config.demo.template // ... }
Thanks for spotting this @TheBeems. I opened up a PR to fix this discrepancy.
I have been playing around with the terraform provider for xenorchestra and wanted to use cloud-init to setup my vm's.
I found that the example given in the documentation does not work:
The culprit is the commentline
#cloud-init
After changing this to
#cloud-config
, all worked fine. Took me a full hour to figure this out why the cloud-init wasn't working. I suggest to change the documentation into the following: