forked from dmacvicar/terraform-provider-libvirt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add terraform travis ci validation check
- Loading branch information
Showing
3 changed files
with
19 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ script: | |
- make gofmtcheck | ||
- make vet | ||
- golint -set_exit_status libvirt/ | ||
- travis/validate_terraform_files.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,43 @@ | ||
provider "libvirt" { | ||
uri = "qemu:///system" | ||
uri = "qemu:///system" | ||
} | ||
|
||
resource "libvirt_volume" "ubuntu-cloud-uefi" { | ||
name = "ubuntu-cloud-uefi" | ||
name = "ubuntu-cloud-uefi" | ||
source = "https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-uefi1.img" | ||
} | ||
|
||
resource "libvirt_volume" "volume" { | ||
name = "vm${count.index}" | ||
name = "vm${count.index}" | ||
base_volume_id = "${libvirt_volume.ubuntu-cloud-uefi.id}" | ||
count = 1 | ||
count = 1 | ||
} | ||
|
||
resource "libvirt_domain" "domain" { | ||
count = 2 | ||
name = "ubuntu-cloud-${count.index}" | ||
count = 2 | ||
name = "ubuntu-cloud-${count.index}" | ||
memory = "512" | ||
vcpu = 1 | ||
vcpu = 1 | ||
|
||
# This file is usually present as part of the ovmf firmware package in many | ||
# Linux distributions. | ||
firmware = "/usr/share/OVMF/OVMF_CODE.fd" | ||
|
||
nvram { | ||
# This is the file which will back the UEFI NVRAM content. | ||
file = "/var/lib/libvirt/qemu/nvram/vm${count.index}_VARS.fd" | ||
|
||
# This file needs to be provided by the user. | ||
template = "/srv/provisioning/terraform/debian-stable-uefi_VARS.fd" | ||
} | ||
|
||
disk { | ||
volume_id = "${element(libvirt_volume.volume.*.id, count.index)}" | ||
} | ||
|
||
graphics { | ||
type = "spice" | ||
type = "spice" | ||
listen_type = "address" | ||
autoport = true | ||
autoport = true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#! /bin/bash | ||
set -x | ||
cd examples | ||
if [ `terraform fmt | wc -c` -ne 0 ]; then echo "terraform files need be formatted! run terraform fmt!"; exit 1; fi |