Bootstrapping using terraform in openstack - personality issues

Announcements

Changes to the LIVEcommunity experience are coming soon... Here's what you need to know.

Reply
ec2624
L1 Bithead

Bootstrapping using terraform in openstack - personality issues

 I am trying to automate a vm inside openstack in our Ocata environment using terraform.  But I am having issues using the personality when i am building the instance.   Using heat template the snippet of the code is as follows.

 

### Heat   ####

user_data_format: RAW
config_drive: true
personality:
/config/init-cfg.txt: {get_file: "/root/bootstrap/config/init-cfg.txt"}
/config/bootstrap.xml: {get_file: "/root/bootstrap/config/bootstrap.xml"}

 

But in terraform, i cannot find a similar way of setting the personality function.   So this is what I tried to use:

 

resource "openstack_compute_instance_v2" "pan81" {
# count = "${var.count}"
name = "pan01"
image_name = "PAN81"
flavor_name = "p1.large"
key_pair = "${var.openstack_keypair}"
security_groups = ["default"]
config_drive = "true"

metadata {
instance_test = "pan image"
}
network {
name = "terra-mgmt"
}

network {
name = "terra-north"
}
network {
port = "${openstack_networking_port_v2.terra-south-port.id}"
}
personality {
file = "init-cfg.txt"
contents = "/config/init-cfg.txt"
}


Terraform Error:


* openstack_compute_instance_v2.cirros: "personality.0.content": required field is not set
* openstack_compute_instance_v2.cirros: personality.0: invalid or unknown key: contents

Does anyone know how to properly configure the personality block inside the resource "openstack_compute_instance_v2"?

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!