-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.tf
56 lines (49 loc) · 1.44 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
provider "ovirt" {
url = var.ovirt_url
username = var.ovirt_username
password = var.ovirt_password
}
terraform {
backend "local" {
path = "ovirt_terraform.tfstate"
}
}
resource "ovirt_vm" "vm" {
connection {
host = var.vm_nic_ip_address
user = var.ansible_user
}
provisioner "ansible" {
plays {
playbook {
file_path = "${path.module}/ansible-data/playbooks/install-httpd.yaml"
roles_path = [
"${path.module}/ansible-data/roles"
]
}
}
ansible_ssh_settings {
insecure_no_strict_host_key_checking = var.insecure_no_strict_host_key_checking
}
}
name = var.vm_name
cluster_id = var.cluster_id
memory = var.vm_memory
template_id = var.vm_template_id
cores = var.vm_cpu_cores
initialization {
authorized_ssh_key = var.vm_authorized_ssh_key
host_name = var.vm_hostname
timezone = var.vm_timezone
dns_search = var.vm_dns_search
dns_servers = var.vm_dns_servers
nic_configuration {
label = var.vm_nic_device
boot_proto = var.vm_nic_boot_proto
address = var.vm_nic_ip_address
gateway = var.vm_nic_gateway
netmask = var.vm_nic_netmask
on_boot = var.vm_nic_on_boot
}
}
}