Changeset View
Changeset View
Standalone View
Standalone View
proxmox/terraform/modules/node/main.tf
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | resource "proxmox_vm_qemu" "node" { | ||||
# Let puppet do its install | # Let puppet do its install | ||||
provisioner "remote-exec" { | provisioner "remote-exec" { | ||||
inline = concat( | inline = concat( | ||||
var.pre_provision_steps, | var.pre_provision_steps, | ||||
[ | [ | ||||
# First install facts... | # First install facts... | ||||
"mkdir -p /etc/facter/facts.d", | "mkdir -p /etc/facter/facts.d", | ||||
"echo deployment=${var.facter_deployment} > /etc/facter/facts.d/deployment.txt", | "echo deployment=${var.config['facter_deployment']} > /etc/facter/facts.d/deployment.txt", | ||||
"echo subnet=${var.facter_subnet} > /etc/facter/facts.d/subnet.txt", | "echo subnet=${var.config['facter_subnet']} > /etc/facter/facts.d/subnet.txt", | ||||
"sed -i 's/127.0.1.1/${lookup(var.networks[0], "ip")}/g' /etc/hosts", | "sed -i 's/127.0.1.1/${lookup(var.networks[0], "ip")}/g' /etc/hosts", | ||||
# so puppet agent installs the node's role | # so puppet agent installs the node's role | ||||
"puppet agent --server ${var.config["puppet_master"]} --environment=${var.config["puppet_environment"]} --waitforcert 60 --test || echo 'Node provisionned!'", | "puppet agent --server ${var.config["puppet_master"]} --environment=${var.config["puppet_environment"]} --waitforcert 60 --test || echo 'Node provisionned!'", | ||||
]) | ]) | ||||
connection { | connection { | ||||
type = "ssh" | type = "ssh" | ||||
user = "root" | user = "root" | ||||
Show All 14 Lines |