Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ If we're wrong, PLEASE feel free to reopen it and explain why.
```console
$ openshift-install version
<your output here>
$ ~/.terraform.d/plugins/terraform-provider-libvirt -version # only needed if you're using libvirt
<your output here>
```

# Platform (aws|libvirt|openstack):
Expand Down
5 changes: 2 additions & 3 deletions Gopkg.lock

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

17 changes: 17 additions & 0 deletions cmd/openshift-install/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ package main
import (
"io/ioutil"
"os"
"path/filepath"
"strings"

"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"golang.org/x/crypto/ssh/terminal"

"github.com/openshift/installer/pkg/terraform/exec/plugins"
)

var (
Expand All @@ -18,6 +22,19 @@ var (
)

func main() {
if len(os.Args) > 0 {
base := filepath.Base(os.Args[0])
cname := strings.TrimSuffix(base, filepath.Ext(base))
if pluginRunner, ok := plugins.KnownPlugins[cname]; ok {
pluginRunner()
return
}
}

installerMain()
}

func installerMain() {
rootCmd := newRootCmd()

for _, subCmd := range []*cobra.Command{
Expand Down
3 changes: 1 addition & 2 deletions data/data/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ locals {
}

provider "aws" {
region = "${var.aws_region}"
version = "1.39.0"
region = "${var.aws_region}"
}

module "bootstrap" {
Expand Down
1 change: 0 additions & 1 deletion data/data/openstack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ provider "openstack" {
user_domain_name = "${var.openstack_credentials_user_domain_name}"
user_id = "${var.openstack_credentials_user_id}"
user_name = "${var.openstack_credentials_user_name}"
version = ">=1.6.0"
}

module "lb" {
Expand Down
15 changes: 0 additions & 15 deletions docs/dev/libvirt-howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,21 +198,6 @@ This step allows installer and users to resolve cluster-internal hostnames from
```
3. `systemctl restart NetworkManager`

### Install the Terraform provider

1. Make sure you have the `virsh` binary installed: `sudo dnf install libvirt-client libvirt-devel`
2. Install the libvirt terraform provider:
```sh
GOBIN=~/.terraform.d/plugins go get -u github.com/dmacvicar/terraform-provider-libvirt
```

### Cache Terraform plugins (optional, but makes subsequent runs a bit faster)

```sh
cat <<EOF > $HOME/.terraformrc
plugin_cache_dir = "$HOME/.terraform.d/plugin-cache"
EOF
```

## Build and run the installer

Expand Down
3 changes: 1 addition & 2 deletions pkg/terraform/exec/Gopkg.lock

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

16 changes: 10 additions & 6 deletions pkg/terraform/exec/Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
ignored = [
"github.com/openshift/installer/pkg/terraform/exec/plugins*"
]

[prune]
go-tests = true
unused-packages = true
non-go = true

[[constraint]]
branch = "master"
name = "github.com/hashicorp/go-plugin"
Expand All @@ -8,7 +17,7 @@

[[constraint]]
name = "github.com/hashicorp/terraform"
version = "0.11.10"
revision = "v0.11.10"

[[constraint]]
name = "github.com/mitchellh/cli"
Expand All @@ -29,8 +38,3 @@
[[override]]
revision = "v1.14.31"
name = "github.com/aws/aws-sdk-go"

[prune]
go-tests = true
unused-packages = true
non-go = true
17 changes: 3 additions & 14 deletions pkg/terraform/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package exec

import (
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
Expand All @@ -17,7 +16,6 @@ import (
"github.com/hashicorp/logutils"
"github.com/hashicorp/terraform/command"
"github.com/hashicorp/terraform/helper/logging"
"github.com/hashicorp/terraform/version"
"github.com/mitchellh/cli"
)

Expand Down Expand Up @@ -53,9 +51,11 @@ func runner(cmd string, dir string, args []string, stdout, stderr io.Writer) int
sdCh, cancel := makeShutdownCh()
defer cancel()

pluginDirs := globalPluginDirs(stderr)
pluginDirs = append(pluginDirs, filepath.Join(dir, "plugins"))
meta := command.Meta{
Color: false,
GlobalPluginDirs: globalPluginDirs(stderr),
GlobalPluginDirs: pluginDirs,
Ui: &cli.BasicUi{
Writer: stdout,
ErrorWriter: stderr,
Expand Down Expand Up @@ -103,17 +103,6 @@ func Init(datadir string, args []string, stdout, stderr io.Writer) int {
return runner("init", datadir, args, stdout, stderr)
}

// Version is a wrapper around `terraform version` subcommand.
// Comapared to other wrappers this only supports subset of the `terraform version` options.
func Version() string {
var versionString bytes.Buffer
fmt.Fprintf(&versionString, "Terraform v%s", version.Version)
if version.Prerelease != "" {
fmt.Fprintf(&versionString, "-%s", version.Prerelease)
}
return versionString.String()
}

// makeShutdownCh creates an interrupt listener and returns a channel.
// A message will be sent on the channel for every interrupt received.
func makeShutdownCh() (<-chan struct{}, func()) {
Expand Down
Loading