Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Terraform execution should fail if the user doesn't have access to docker on at least one target nodes. #99

Closed
ravi-mrk opened this issue Sep 18, 2019 · 1 comment

Comments

@ravi-mrk
Copy link

Terraform should be failing to execute on the "terraform apply" step, if the "user" in the main.tf file is not having necessary permissions to access docker on target nodes.

Terraform Version

Terraform v0.12.9

  • provider.local v1.3.0
  • provider.rke v0.13.0

Affected Resource(s)

Please list the resources as a list, for example:

  • rke_cluster

Terraform Configuration Files

resource "rke_cluster" "cluster" {
  nodes {
    address = "node1.test.domain.com"
    user    = "rke"
    role    = ["controlplane", "etcd", "worker"]
    ssh_key = "${file("~/.ssh/id_rsa")}"
  }
  nodes {
    address = "node2.test.domain.com"
    user    = "rke"
    role    = ["worker"]
    ssh_key = "${file("~/.ssh/id_rsa")}"
  }
  nodes {
    address = "node3.test.domain.com"
    user    = "rke"
    role    = ["controlplane", "etcd", "worker"]
    ssh_key = "${file("~/.ssh/id_rsa")}"
  }
  nodes {
    address = "node4.test.domain.com"
    user    = "rke"
    role    = ["controlplane", "etcd", "worker"]
    ssh_key = "${file("~/.ssh/id_rsa")}"
  }

  addons_include = [
    "https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml",
    "https://gist.githubusercontent.com/superseb/499f2caa2637c404af41cfb7e5f4a938/raw/930841ac00653fdff8beca61dab9a20bb8983782/k8s-dashboard-user.yml",
  ]
}

resource "local_file" "kube_cluster_yaml" {
  filename = "${path.root}/kube_config_cluster.yml"
  sensitive_content  = "${rke_cluster.cluster.kube_config_yaml}"
}

Debug Output

https://gist.github.com/ravi-mrk/5cf7d0d2c69f178ecf5e39c39ba7686b

Expected Behavior

Terraform should be failing to execute on the "terraform apply" step, if the "user" in the main.tf file is not having necessary permissions to access docker on ANY OF the target nodes defined.

Actual Behavior

Terraform continues execution on all nodes where the "user" defined in the main.tf file is having access to docker & is NOT failing on the nodes where the "user" doesn't have access to docker service.

Steps to Reproduce

Define few nodes in the main.tf file. the "user" should be having access to docker on few nodes and doesnt have access to docker service on at least one of the nodes defined in main.tf.

Run terraform apply

@mcanevet
Copy link
Contributor

Well, this provider is about Rancher1 (up to v1.6.x). You should open an issue on Rancher2's provider repository : https://github.com/rancher/terraform-provider-rancher2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants