haklop/terraform — pull request #2 by hartzell (2014-11-04 23:14:04+00:00)
Title: Add support for user_data to openstack provider

Add support for user_data to openstack provider, based on the
implementation in the AWS provider.

Computes a hash of the user_data for maintaining state.

Base64 encodes the user_data before handing it off to rackspace's
gophercloud and thence to racker's perigee.

Touched up resource_openstack_compute_test.go but am not able to run the
original version successfully, so this isn't very satisfactory.

Adding something like this (pay attention to escaped quotation marks)
will read the contents of a file.

user_data = "${file(\"cloud-config.yaml\")}"

Heredocs also work, e.g.

user_data = << HERE
something goes here
HERE

I've successfully used this to configure coreos systems via their
cloud-config system.