Browse Source

terraform fmt

main
Nicolas Massé 5 years ago
parent
commit
a899b31eeb
  1. 2
      centos/centos.tf
  2. 16
      coreos/coreos.tf
  3. 2
      coreos/main.tf
  4. 12
      windows/windows.tf

2
centos/centos.tf

@ -34,7 +34,7 @@ resource "libvirt_domain" "centos_machine" {
network_interface { network_interface {
network_id = libvirt_network.lab_net.id network_id = libvirt_network.lab_net.id
hostname = format(var.centos_hostname_format, count.index + 1) hostname = format(var.centos_hostname_format, count.index + 1)
# When creating the domain resource, wait until the network interface gets # When creating the domain resource, wait until the network interface gets
# a DHCP lease from libvirt, so that the computed IP addresses will be # a DHCP lease from libvirt, so that the computed IP addresses will be

16
coreos/coreos.tf

@ -11,8 +11,8 @@ data "ignition_config" "startup" {
} }
data "ignition_file" "hostname" { data "ignition_file" "hostname" {
path = "/etc/hostname" path = "/etc/hostname"
mode = 420 # decimal 0644 mode = 420 # decimal 0644
content { content {
content = format(var.coreos_hostname_format, count.index + 1) content = format(var.coreos_hostname_format, count.index + 1)
@ -46,12 +46,12 @@ resource "libvirt_ignition" "ignition" {
} }
resource "libvirt_domain" "coreos_machine" { resource "libvirt_domain" "coreos_machine" {
count = var.coreos_machine_count count = var.coreos_machine_count
name = format(var.coreos_hostname_format, count.index + 1) name = format(var.coreos_hostname_format, count.index + 1)
vcpu = "1" vcpu = "1"
memory = "1024" memory = "1024"
coreos_ignition = element(libvirt_ignition.ignition.*.id, count.index) coreos_ignition = element(libvirt_ignition.ignition.*.id, count.index)
autostart = true autostart = true
disk { disk {
volume_id = element(libvirt_volume.coreos_disk.*.id, count.index) volume_id = element(libvirt_volume.coreos_disk.*.id, count.index)
@ -65,7 +65,7 @@ resource "libvirt_domain" "coreos_machine" {
network_interface { network_interface {
network_id = libvirt_network.lab_net.id network_id = libvirt_network.lab_net.id
hostname = format(var.coreos_hostname_format, count.index + 1) hostname = format(var.coreos_hostname_format, count.index + 1)
# When creating the domain resource, wait until the network interface gets # When creating the domain resource, wait until the network interface gets
# a DHCP lease from libvirt, so that the computed IP addresses will be # a DHCP lease from libvirt, so that the computed IP addresses will be

2
coreos/main.tf

@ -14,7 +14,7 @@ terraform {
version = ">=2.2.0" version = ">=2.2.0"
} }
ignition = { ignition = {
source = "community-terraform-providers/ignition" source = "community-terraform-providers/ignition"
version = "2.1.2" version = "2.1.2"
} }
} }

12
windows/windows.tf

@ -7,22 +7,22 @@ resource "libvirt_volume" "win_disk" {
} }
resource "libvirt_domain" "win_machine" { resource "libvirt_domain" "win_machine" {
count = var.windows_machine_count count = var.windows_machine_count
name = format(var.windows_hostname_format, count.index + 1) name = format(var.windows_hostname_format, count.index + 1)
vcpu = "2" vcpu = "2"
memory = "2048" memory = "2048"
cpu = { cpu = {
mode = "host-passthrough" mode = "host-passthrough"
} }
disk { disk {
volume_id = element(libvirt_volume.win_disk.*.id, count.index) volume_id = element(libvirt_volume.win_disk.*.id, count.index)
} }
network_interface { network_interface {
network_id = libvirt_network.lab_net.id network_id = libvirt_network.lab_net.id
hostname = format(var.windows_hostname_format, count.index + 1) hostname = format(var.windows_hostname_format, count.index + 1)
# When creating the domain resource, wait until the network interface gets # When creating the domain resource, wait until the network interface gets
# a DHCP lease from libvirt, so that the computed IP addresses will be # a DHCP lease from libvirt, so that the computed IP addresses will be

Loading…
Cancel
Save