github.com/openshift/installer@v1.4.17/upi/vsphere/lb/main.tf (about)

     1  terraform {
     2    required_providers {
     3      ignition = {
     4        source  = "community-terraform-providers/ignition"
     5        version = "2.1.2"
     6      }
     7    }
     8  }
     9  
    10  data "ignition_systemd_unit" "haproxy" {
    11    name    = "haproxy.service"
    12    content = file("${path.module}/haproxy.service")
    13  }
    14  
    15  data "ignition_file" "haproxy" {
    16    path       = "/etc/haproxy/haproxy.conf"
    17    mode       = "420" // 0644
    18    content {
    19      content = templatefile("${path.module}/haproxy.tmpl", {
    20        lb_ip_address = var.lb_ip_address,
    21        api           = var.api_backend_addresses,
    22        ingress       = var.ingress_backend_addresses
    23      })
    24    }
    25  }
    26  
    27  data "ignition_user" "core" {
    28    name                = "core"
    29    ssh_authorized_keys = [file("${var.ssh_public_key_path}")]
    30  }
    31  
    32  data "ignition_config" "lb" {
    33    users   = [data.ignition_user.core.rendered]
    34    files   = [data.ignition_file.haproxy.rendered]
    35    systemd = [data.ignition_systemd_unit.haproxy.rendered]
    36  }
    37