Skip to content

akurz/terraform-provider-opennebula

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

CONTRIBUTIONS

Contributions are of course open and welcome.

About

Terraform OpenNebula Provider

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%