All Projects → runtastic → terraform-provider-opennebula

runtastic / terraform-provider-opennebula

Licence: MIT license
Terraform OpenNebula Provider

Programming Languages

go
31211 projects - #10 most used programming language

terraform-provider-opennebula

OpenNebula provider for Terraform.

The provider tries to impose a lightweight level of abstraction on OpenNebula's resources. This means that only the most fundamental attributes are directly accessible (i.e. names, IDs, permissions and user/group identities). For maximum flexibility and portability, the remaining attributes can be specified using any of the formats natively accepted by OpenNebula (XML and String).

EXAMPLE

Create a file called demo_template.txt.

Notice how we need to escape native variables $$USER[SSH_PUBLIC_KEY] with two dollar signs, as terraform will try to replace all variables with a single dollar sign)

CUSTOM_ATTRIBUTE = "${CUSTOM_ATTRIBUTE_VALUE}"
CONTEXT = [
  DNS_HOSTNAME = "yes",
  NETWORK = "YES",
  SSH_PUBLIC_KEY = "$$USER[SSH_PUBLIC_KEY]",
  USERNAME = "root" ]
CPU = "0.5"
VCPU = "4"
MEMORY = "3000"
GRAPHICS = [
  KEYMAP = "en",
  LISTEN = "0.0.0.0",
  TYPE = "VNC" ]

And the following terraform.tf file:

provider "opennebula" {
  endpoint = "api's endpoint"
  username = "user's name"
  password = "user's password"
}

data "template_file" "demo" {
  template = "${file("demo_template.txt")}"
  vars = {
    CUSTOM_ATTRIBUTE_VALUE = "demo-me"
  }
}

resource "opennebula_template" "demo" {
  name = "terraform-demo"
  description = "${data.template_file.demo.rendered}"
  permissions = "600"
}

output "demo_template_id" {
  value = "${opennebula_template.demo.id}"
}

output "demo_template_uname" {
  value = "${opennebula_template.demo.uname}"
}

ROADMAP

The following list represent's all of OpenNebula's resources reachable through their API. The checked items are the ones that are fully functional and tested:

Collaborators

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/runtastic/terraform-provider-opennebula. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Check out our career page if you'd like to work with us.

License

The gem is available as open source under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].