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

Publish this module in the Terraform registry #46

Open
2 of 9 tasks
displague opened this issue Jul 31, 2020 · 1 comment
Open
2 of 9 tasks

Publish this module in the Terraform registry #46

displague opened this issue Jul 31, 2020 · 1 comment
Assignees

Comments

@displague
Copy link
Collaborator

displague commented Jul 31, 2020

In order for users to more rapidly take advantage of this Terraform configuration, it should be packaged as a Terraform module (or set of modules).

https://www.terraform.io/docs/modules/publish.html
https://www.terraform.io/docs/registry/modules/publish.html

The modules should fit the best practices: https://www.terraform.io/docs/modules/index.html

https://registry.terraform.io/browse/modules?provider=packet

Modules should be reusable as the base of new projects:
terraform init --from-module=packet/openshift/packet packet-openshift

And modules should allow for reuse as dependencies in more complex projects:

module "openshift" {
  source = "packet/openshift/packet"
  version = "0.1.0"
  packet_token = "..."

  ...
}

provider "kubernetes" {
  config_path = module.openshift.kube_config 
  // this does not exist, but it could be a new output ${abspath(path.root)}/auth/kubeconfig (maybe path.module)
}

Steps to publish:

  1. Adopt file naming conventions (main.tf, outputs.tf, variables.tf)
  2. Ensure paths are module safe (path.module + “/assets/foo.sh“)
  3. Ensure that all variables and outputs have a description
  4. Ensure that the README.md is present and in good shape (mentions module install and use)
  5. All sub-modules must also adhere to the previous four bullets as if they were root modules
  6. Include examples/ showing how to use this project as a module
  7. Rename the project (terraform-packet-openshift) (or terraform-packet-redhat-openshift) (github automatically redirects visitors and git users using the old name)
  8. Tag the project
  9. Publish the project: registry.terraform.io/sign-in
@liveaverage liveaverage self-assigned this Aug 7, 2020
@displague
Copy link
Collaborator Author

I've taken this effort over to equinix/terraform-equinix-metal-openshift-on-baremetal#1

The repo is private until I have merged in the PR that incorporates many of these changes. (I don't want users to stumble upon a Packet provider in the Equinix repo until it is ready to be used on Metal).

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

No branches or pull requests

2 participants