Giter Club home page Giter Club logo

terraform-provider-libvirt's Introduction

Terraform provider for libvirt

alpha Build Status Coverage Status


This is a terraform provider that lets you provision servers on a libvirt host via Terraform.

Table of Content

Installing

Requirements
  • libvirt 1.2.14 or newer on the hypervisor
  • latest golang version

Copied from the Terraform documentation:

To install a plugin, put the binary somewhere on your filesystem, then configure Terraform to be able to find it. The configuration where plugins are defined is ~/.terraformrc for Unix-like systems and %APPDATA%/terraform.rc for Windows.

If you are using opensuse/SUSE distro, add the repo and download the package (check the repo according your distro)

DISTRO=openSUSE_Leap_42.3
zypper addrepo http://download.opensuse.org/repositories/Virtualization:containers/$DISTRO/Virtualization:containers.repo
zypper refresh
zypper install terraform-provider-libvirt

On debian systems you can use alien for converting the rpms

Building from source

This project uses glide to vendor all its dependencies.

You do not have to interact with glide since the vendored packages are already included in the repo.

Ensure you have the latest version of Go installed on your system, terraform usually takes advantage of features available only inside of the latest stable release.

You need also need libvirt-dev(el) package installed.

Run go install to build the binary. You will now find the binary at $GOPATH/bin/terraform-provider-libvirt.

Using the provider

Here is an example that will setup the following:

  • A virtual server resource

(create this as libvirt.tf and run terraform commands from this directory):

provider "libvirt" {
    uri = "qemu:///system"
}

You can also set the URI in the LIBVIRT_DEFAULT_URI environment variable.

Now, define a libvirt domain:

resource "libvirt_domain" "terraform_test" {
  name = "terraform_test"
}

Now you can see the plan, apply it, and then destroy the infrastructure:

$ terraform init
$ terraform plan
$ terraform apply
$ terraform destroy

Look at more advanced examples here

Troubleshooting (aka you have a problem)

Have a look at TROUBLESHOOTING, and feel free to add a PR if you find out something is missing.

Authors

See also the list of contributors who participated in this project.

The structure and boilerplate is inspired from the Softlayer and Google Terraform provider sources.

License

  • Apache 2.0, See LICENSE file

terraform-provider-libvirt's People

Contributors

deasmi avatar dmacvicar avatar eamonnotoole avatar electrofelix avatar ereslibre avatar flavio avatar grahamhayes avatar hexfusion avatar inercia avatar jdnieto avatar jeduardo avatar localghost avatar mallozup avatar moio avatar monstermunchkin avatar rsjethani avatar simonswine avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.