mitchellh / vagrant-rackspace

Use Vagrant to manage Rackspace Cloud instances.
MIT License
236 stars 155 forks source link

Add tags to servers #133

Open domcleal opened 9 years ago

domcleal commented 9 years ago

Servers can have tags associated with them, which helps to track roles and ownership. It would be great to be able to specify rs.tags = ['web'] or similar in the Vagrantfile.

maxlinc commented 9 years ago

Hi @domcleal,

It sounds pretty reasonable, but unfortunately servers cannot be tagged via the Rackspace or OpenStack API right now. The feature to associate tags with servers only exists in the Cloud Control Panel right now, but there is already feedback under review to expose Cloud Server tags through the API. If you were hoping for integration with the tags in the Cloud Control Panel it will need to wait until that is resolved.

You may be in luck if you want something similar to tags and don't care about Cloud Control Panel integration. There is already support for metadata so you can associate key/value pairs with servers. You could track "tags" via metadata using either:

A "tags" key with a comma-separated list of tags:

  rs.metadata = { "tags" => %w(web website_team).join(',') }

Or you can use different keys for different types of tags:

  rs.metadata = {
    "role"  => "web",
    "owner" => "website_team"
  }