Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This graph is rendered kinda funky #141

Closed
BrianHicks opened this issue Aug 4, 2016 · 2 comments
Closed

This graph is rendered kinda funky #141

BrianHicks opened this issue Aug 4, 2016 · 2 comments
Labels

Comments

@BrianHicks
Copy link
Contributor

BrianHicks commented Aug 4, 2016

x

IMO the in root should be encapsulated in their own subgraph. For what it's worth, this happens if you merge duplicates:

x

main.hcl is:

# create certificates for a Kubernetes cluster
param "master_ip" {}

task "directory" {
  check = "test -d ssl"
  apply = "mkdir ssl"
}

task "ca.key" {
  check = "test -f ssl/ca.key"
  apply = "cd ssl; openssl genrsa -out ca.key 2048"

  depends = ["task.directory"]
}

task "ca.crt" {
  check = "test -f ssl/ca.crt"
  apply = "cd ssl; openssl req -x509 -new -nodes -key ca.key -subj \"/CN={{param `master_ip`}}\" -days 10000 -out ca.crt"

  depends = ["task.ca.key"]
}

module "cert.hcl" "server" {
  params {
    cn   = "{{param `master_ip`}}"
    name = "server"
  }

  depends = ["task.ca.key", "task.ca.crt"]
}

module "cert.hcl" "kubelet" {
  params {
    cn   = "{{param `master_ip`}}"
    name = "kubelet"
  }

  depends = ["task.ca.key", "task.ca.crt"]
}

cert.hcl is:

# cert
param "cn" {}

param "name" {}

param "ca_crt" {
  default = "ca.crt"
}

param "ca_key" {
  default = "ca.key"
}

task "directory" {
  check = "test -d ssl"
  apply = "mkdir ssl"
}

task "key" {
  check = "test -f ssl/{{param `name`}}.key"
  apply = "cd ssl; openssl genrsa -out {{param `name`}}.key 2048"

  depends = ["task.directory"]
}

task "csr" {
  check = "test -f ssl/{{param `name`}}.csr"
  apply = "cd ssl; openssl req -new -key {{param `name`}}.key --subj \"/CN={{param `cn`}}\" -out {{param `name`}}.csr"

  depends = ["task.key"]
}

task "crt" {
  check = "test -f ssl/{{param `name`}}.crt"
  apply = "cd ssl; openssl x509 -req -in {{param `name`}}.csr -CA {{param `ca_crt`}} -CAkey {{param `ca_key`}} -CAcreateserial -out {{param `name`}}.crt -days 10000"

  depends = ["task.csr"]
}
@rebeccaskinner
Copy link
Contributor

I spent a while trying to clean it up and made forward progress in a few dimensions and backward progress in a few others. I think I have a clear way forward but suggest we keep it on the back burner until we have some other higher priority stuff working.

@BrianHicks
Copy link
Contributor Author

This is kinda closed since the duplicates are merged by default now. I'm going to close it since it's getting out of date. If we get complaints about this kind of thing in the future they should go in their own issues anyway.

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

No branches or pull requests

2 participants