Skip to content
This repository was archived by the owner on Jul 23, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/data/baremetal/bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module "bootstrap" {

addresses = ["192.168.0.1"]
base_volume_id = "${libvirt_volume.example.id}"
cluster_name = "my-cluster"
cluster_id = "my-cluster"
ignition = "{\"ignition\": {\"version\": \"2.2.0\"}}",
network_id = "${libvirt_network.example.id}"
}
Expand Down
6 changes: 3 additions & 3 deletions data/data/baremetal/bootstrap/main.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
resource "libvirt_volume" "bootstrap" {
name = "${var.cluster_name}-bootstrap"
name = "${var.cluster_id}-bootstrap"
base_volume_id = "${var.base_volume_id}"
}

resource "libvirt_ignition" "bootstrap" {
name = "${var.cluster_name}-bootstrap.ign"
name = "${var.cluster_id}-bootstrap.ign"
content = "${var.ignition}"
}

resource "libvirt_domain" "bootstrap" {
name = "${var.cluster_name}-bootstrap"
name = "${var.cluster_id}-bootstrap"

memory = "4096"

Expand Down
4 changes: 2 additions & 2 deletions data/data/baremetal/bootstrap/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ variable "base_volume_id" {
description = "The ID of the base volume for the bootstrap node."
}

variable "cluster_name" {
variable "cluster_id" {
type = "string"
description = "The name of the cluster."
description = "The identifier for the cluster."
}

variable "ignition" {
Expand Down
10 changes: 3 additions & 7 deletions data/data/baremetal/main.tf
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
locals {
cluster_domain = "${var.cluster_name}.${var.base_domain}"
}

provider "libvirt" {
uri = "${var.libvirt_uri}"
}

module "volume" {
source = "./volume"

cluster_name = "${var.cluster_name}"
image = "${var.os_image}"
cluster_id = "${var.cluster_id}"
image = "${var.os_image}"
}

module "bootstrap" {
source = "./bootstrap"

base_volume_id = "${module.volume.coreos_base_volume_id}"
cluster_name = "${var.cluster_name}"
cluster_id = "${var.cluster_id}"
ignition = "${var.ignition_bootstrap}"
baremetal_bridge = "${var.baremetal_bridge}"
overcloud_bridge = "${var.overcloud_bridge}"
Expand Down
2 changes: 1 addition & 1 deletion data/data/baremetal/volume/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource "libvirt_volume" "coreos_base" {
name = "${var.cluster_name}-base"
name = "${var.cluster_id}-base"
source = "${var.image}"
}
4 changes: 2 additions & 2 deletions data/data/baremetal/volume/variables.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
variable "cluster_name" {
variable "cluster_id" {
type = "string"
description = "The name of the cluster."
description = "The identifier for the cluster."
}

variable "image" {
Expand Down