theforeman/foreman — pull request #107 by pccowboy (2012-07-13 01:22:02+00:00)
Title: Add a user_data provision template type - http://theforeman.org/issues/1561

This request combines the previous fixes for "Figure out how to make the power buttons work properly. Update the IP a.ddress when the power state changes" and the changes for making cloud-config use the user_data for EC2 instances.

The example user_data in this changeset is being used to create developer instances in our organization, and so far seems to work as I wanted. It prevents the amazon AMI from forcing new updates on a reboot of the instance, and allows us to install other repositories and get packages from them as soon as the instance is requested.

The previous pull request had the following comments:

This commit seems a little scattered to me, but I was not sure how to reconcile the compute_resource_vms idea of the power button with the orchestration/compute idea of power on/power off.

Fog does not allow updating of a compute resource that has an identity, so I took those bits out.

I have the IP address updating on power state changes, and it seems mostly solid, although I think it could be done better.

I cannot figure out how to get the "Name" tag to appear in the 'started' and 'stopped' messages, but I figure it is there, somewhere.