Skip to content
This repository was archived by the owner on Jul 23, 2019. It is now read-only.
Closed
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
11 changes: 11 additions & 0 deletions cmd/kni-install/gather.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ import (
"github.com/openshift-metalkube/kni-installer/pkg/terraform"
gatheraws "github.com/openshift-metalkube/kni-installer/pkg/terraform/gather/aws"
gatherazure "github.com/openshift-metalkube/kni-installer/pkg/terraform/gather/azure"
gatherbaremetal "github.com/openshift-metalkube/kni-installer/pkg/terraform/gather/baremetal"
gatherlibvirt "github.com/openshift-metalkube/kni-installer/pkg/terraform/gather/libvirt"
gatheropenstack "github.com/openshift-metalkube/kni-installer/pkg/terraform/gather/openstack"
"github.com/openshift-metalkube/kni-installer/pkg/types"
awstypes "github.com/openshift-metalkube/kni-installer/pkg/types/aws"
azuretypes "github.com/openshift-metalkube/kni-installer/pkg/types/azure"
baremetaltypes "github.com/openshift-metalkube/kni-installer/pkg/types/baremetal"
libvirttypes "github.com/openshift-metalkube/kni-installer/pkg/types/libvirt"
openstacktypes "github.com/openshift-metalkube/kni-installer/pkg/types/openstack"
)
Expand Down Expand Up @@ -143,6 +145,15 @@ func extractHostAddresses(config *types.InstallConfig, tfstate *terraform.State)
if err != nil {
logrus.Error(err)
}
case baremetaltypes.Name:
bootstrap, err = gatherbaremetal.BootstrapIP(tfstate, config)
if err != nil {
return bootstrap, port, masters, err
}
masters, err = gatherbaremetal.ControlPlaneIPs(tfstate)
if err != nil {
return bootstrap, port, masters, err
}
case libvirttypes.Name:
bootstrap, err = gatherlibvirt.BootstrapIP(tfstate)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions data/data/baremetal/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ provider "libvirt" {

provider "ironic" {
url = var.ironic_uri
inspector = var.inspector_uri
microversion = "1.52"
}

Expand Down
9 changes: 9 additions & 0 deletions data/data/baremetal/masters/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ resource "ironic_node_v1" "openshift-master-host" {
]
}

data "ironic_introspection" "openshift-master-introspection" {
count = var.master_count

uuid = element(
ironic_node_v1.openshift-master-host.*.id,
count.index,
)
}

resource "ironic_allocation_v1" "openshift-master-allocation" {
name = "master-${count.index}"
count = var.master_count
Expand Down
5 changes: 5 additions & 0 deletions data/data/baremetal/variables-baremetal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ variable "ironic_uri" {
description = "ironic connection URI"
}

variable "inspector_uri" {
type = string
description = "ironic inpsector URI"
}

variable "libvirt_uri" {
type = string
description = "libvirt connection URI"
Expand Down
1 change: 1 addition & 0 deletions pkg/asset/cluster/tfvars.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error {
data, err = baremetaltfvars.TFVars(
installConfig.Config.Platform.BareMetal.LibvirtURI,
installConfig.Config.Platform.BareMetal.IronicURI,
installConfig.Config.Platform.BareMetal.InspectorURI,
string(*rhcosImage),
"baremetal",
"provisioning",
Expand Down
18 changes: 8 additions & 10 deletions pkg/terraform/exec/plugins/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/terraform/exec/plugins/Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ ignored = [

[[constraint]]
name = "github.com/openshift-metalkube/terraform-provider-ironic"
version = "v0.1.3"
version = "v0.1.4"

[[constraint]]
name = "github.com/terraform-providers/terraform-provider-null"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading