-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.tf
41 lines (36 loc) · 883 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
variable "ovirt_pass" {}
provider "ovirt" {
username = "kschmidt@PNL.GOV"
url = "https://ovirt.emsl.pnl.gov/ovirt-engine/api"
password = "${var.ovirt_pass}"
}
resource "ovirt_vm" "my_vm" {
name = "my_first_vm"
cluster = "Default"
authorized_ssh_key = "${file(pathexpand("~/.ssh/id_rsa.pub"))}"
network_interface {
label = "eth0"
boot_proto = "static"
ip_address = "130.20.232.184"
gateway = "130.20.232.1"
subnet_mask = "255.255.255.0"
}
attached_disks = [{
disk_id = "${ovirt_disk.my_disk.id}"
bootable = "false"
interface = "virtio"
}]
template = "centos-7.4.1707-cloudinit-mgmt"
provisioner "remote-exec" {
inline = [
"uptime"
]
}
}
resource "ovirt_disk" "my_disk" {
name = "my_first_disk"
size = 1024
format = "cow"
storage_domain_id = "dfe8e7be-e495-49a7-be2d-71aba891ceb4"
sparse = true
}