mirror of
https://github.com/openshift/installer.git
synced 2026-02-07 12:47:07 +01:00
This will make it easier to move into the existing infra step. The module source syntax used in the README is documented in [1,2,3], and means "the modules/libvirt/bootstrap subdirectory of the github.com/openshift/installer repository cloned over HTTPS". [1]: https://www.terraform.io/docs/configuration/modules.html#source [2]: https://www.terraform.io/docs/modules/sources.html#github [3]: https://www.terraform.io/docs/modules/sources.html#modules-in-package-sub-directories
Bootstrap Module
This Terraform module manages libvirt resources only needed during cluster bootstrapping. It uses implicit provider inheritance to access the libvirt provider.
Example
Set up a main.tf with:
provider "libvirt" {
uri = "qemu:///system"
}
resource "libvirt_network" "example" {
name = "example"
mode = "none"
domain = "example.com"
addresses = ["192.168.0.0/24"]
}
resource "libvirt_volume" "example" {
name = "example"
source = "file:///path/to/example.qcow2"
}
module "bootstrap" {
source = "github.com/openshift/installer//modules/libvirt/bootstrap"
addresses = ["192.168.0.1"]
base_volume_id = "${libvirt_volume.example.id}"
cluster_name = "my-cluster"
ignition = "{\"ignition\": {\"version\": \"2.2.0\"}}",
network_id = "${libvirt_network.example.id}"
}
Then run:
$ terraform init
$ terraform plan