From 39376527f28332c1f7bd87b8baef49e61e4c60de Mon Sep 17 00:00:00 2001 From: Justin Barksdale Date: Sun, 28 Nov 2021 19:36:15 -0800 Subject: [PATCH] Added description option to modules. --- modules/infra_provider/variables.tf | 22 ---------------------- modules/ip_pool/README.md | 1 + modules/ip_pool/main.tf | 3 ++- modules/ip_pool/variables.tf | 5 +++++ modules/k8s_network/README.md | 1 + modules/k8s_network/main.tf | 1 + modules/k8s_network/variables.tf | 5 +++++ modules/k8s_sysconfig/README.md | 1 + modules/k8s_sysconfig/main.tf | 1 + modules/k8s_sysconfig/variables.tf | 5 +++++ modules/trusted_registry/README.md | 1 + modules/trusted_registry/main.tf | 1 + modules/trusted_registry/variables.tf | 6 +++++- modules/version/README.md | 1 + modules/version/main.tf | 3 ++- modules/version/variables.tf | 6 +++++- modules/worker_profile/README.md | 1 + modules/worker_profile/main.tf | 9 +++++---- modules/worker_profile/variables.tf | 6 +++++- 19 files changed, 48 insertions(+), 31 deletions(-) diff --git a/modules/infra_provider/variables.tf b/modules/infra_provider/variables.tf index e820596..adcdd23 100644 --- a/modules/infra_provider/variables.tf +++ b/modules/infra_provider/variables.tf @@ -7,28 +7,6 @@ variable "description" { default = "" description = "Description to be used to describe the infrastructure provider policy" } -# variable "vc_cluster" { -# type = string -# description = "Name of the cluster you wish to make part of this provider within vCenter." -# } -# variable "vc_portgroup" { -# type = list(string) -# description = "Name of the portgroup(s) to be used in this provider" -# } -# variable "vc_datastore" { -# type = string -# description = "Name of the datastore to be used with this provider." -# } -# variable "vc_password" { -# sensitive = true -# type = string -# description = "Password of the account to be used with vCenter. This should be the password for the account used to register vCenter with Intersight." -# } -# variable "vc_resource_pool" { -# type = string -# description = "Name of the resource pool to be used with this provider." -# default = "" -# } variable "instance_type_moid" { type = string description = "MOID of the Instance type mapped to this provider" diff --git a/modules/ip_pool/README.md b/modules/ip_pool/README.md index 1c8cb33..26038fc 100644 --- a/modules/ip_pool/README.md +++ b/modules/ip_pool/README.md @@ -47,6 +47,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| +| [description](#input\_description) | Description to be used to describe the IP Pool Policy. | `string` | `""` | no | | [gateway](#input\_gateway) | Default gateway for this pool. | `string` | n/a | yes | | [name](#input\_name) | Name of the IP Pool to be created. | `string` | n/a | yes | | [netmask](#input\_netmask) | Subnet Mask for this pool. | `string` | n/a | yes | diff --git a/modules/ip_pool/main.tf b/modules/ip_pool/main.tf index c236815..bc418a6 100644 --- a/modules/ip_pool/main.tf +++ b/modules/ip_pool/main.tf @@ -5,7 +5,8 @@ data "intersight_organization_organization" "this" { # Supports IPV4 today. resource "intersight_ippool_pool" "this" { - name = var.name + name = var.name + description = var.description ip_v4_blocks { from = var.starting_address size = var.pool_size diff --git a/modules/ip_pool/variables.tf b/modules/ip_pool/variables.tf index bb0063c..d88e540 100644 --- a/modules/ip_pool/variables.tf +++ b/modules/ip_pool/variables.tf @@ -2,6 +2,11 @@ variable "org_name" { type = string description = "Intersight Organization name" } +variable "description" { + type = string + default = "" + description = "Description to be used to describe the IP Pool Policy." +} variable "name" { type = string description = "Name of the IP Pool to be created." diff --git a/modules/k8s_network/README.md b/modules/k8s_network/README.md index a38a126..262b797 100644 --- a/modules/k8s_network/README.md +++ b/modules/k8s_network/README.md @@ -51,6 +51,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [cni](#input\_cni) | Supported CNI type. Currently we only support Calico.* Calico - Calico CNI plugin as described in https://github.com/projectcalico/cni-plugin. | `string` | `"Calico"` | no | +| [description](#input\_description) | Description to be used to describe the k8s network profile. | `string` | `""` | no | | [org\_name](#input\_org\_name) | Intersight Organization name | `string` | n/a | yes | | [pod\_cidr](#input\_pod\_cidr) | Pod CIDR Block to be used to assign POD IP Addresses. | `string` | `"100.65.0.0/16"` | no | | [policy\_name](#input\_policy\_name) | Name of the policy. `_Network` and `_pod` will be added to the end of the name for the respective policies to be built. | `string` | n/a | yes | diff --git a/modules/k8s_network/main.tf b/modules/k8s_network/main.tf index 45e9332..a11d083 100644 --- a/modules/k8s_network/main.tf +++ b/modules/k8s_network/main.tf @@ -6,6 +6,7 @@ resource "intersight_kubernetes_network_policy" "this" { name = var.policy_name + description = var.description pod_network_cidr = var.pod_cidr service_cidr = var.service_cidr cni_type = var.cni diff --git a/modules/k8s_network/variables.tf b/modules/k8s_network/variables.tf index 9bf5c72..a611e79 100644 --- a/modules/k8s_network/variables.tf +++ b/modules/k8s_network/variables.tf @@ -2,6 +2,11 @@ variable "org_name" { type = string description = "Intersight Organization name" } +variable "description" { + type = string + default = "" + description = "Description to be used to describe the k8s network profile." +} variable "policy_name" { type = string description = "Name of the policy. `_Network` and `_pod` will be added to the end of the name for the respective policies to be built." diff --git a/modules/k8s_sysconfig/README.md b/modules/k8s_sysconfig/README.md index c0baf92..917f13b 100644 --- a/modules/k8s_sysconfig/README.md +++ b/modules/k8s_sysconfig/README.md @@ -49,6 +49,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| +| [description](#input\_description) | Description to be used to describe the K8s sysconfig profile. | `string` | `""` | no | | [dns\_servers](#input\_dns\_servers) | DNS Servers to be included in the Network Policy. | `list(string)` | n/a | yes | | [domain\_name](#input\_domain\_name) | Domain Name information for DNS search. | `string` | n/a | yes | | [ntp\_servers](#input\_ntp\_servers) | NTP Servers to be included in the Network Policy. | `list(string)` | n/a | yes | diff --git a/modules/k8s_sysconfig/main.tf b/modules/k8s_sysconfig/main.tf index 348bf1e..7d56665 100644 --- a/modules/k8s_sysconfig/main.tf +++ b/modules/k8s_sysconfig/main.tf @@ -5,6 +5,7 @@ data "intersight_organization_organization" "this" { resource "intersight_kubernetes_sys_config_policy" "this" { name = var.policy_name + description = var.description dns_servers = var.dns_servers ntp_servers = var.ntp_servers timezone = var.timezone diff --git a/modules/k8s_sysconfig/variables.tf b/modules/k8s_sysconfig/variables.tf index 11cc425..73f40e2 100644 --- a/modules/k8s_sysconfig/variables.tf +++ b/modules/k8s_sysconfig/variables.tf @@ -2,6 +2,11 @@ variable "org_name" { type = string description = "Intersight Organization name" } +variable "description" { + type = string + default = "" + description = "Description to be used to describe the K8s sysconfig profile." +} variable "policy_name" { type = string description = "Name of the policy. `_Network` and `_pod` will be added to the end of the name for the respective policies to be built." diff --git a/modules/trusted_registry/README.md b/modules/trusted_registry/README.md index afe55b9..d9b4395 100644 --- a/modules/trusted_registry/README.md +++ b/modules/trusted_registry/README.md @@ -49,6 +49,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| +| [description](#input\_description) | Description to be used to describe the trusted registry profile. | `string` | `""` | no | | [org\_name](#input\_org\_name) | Intersight Organization name | `string` | n/a | yes | | [policy\_name](#input\_policy\_name) | Name of the policy. `_Network` and `_pod` will be added to the end of the name for the respective policies to be built. | `string` | n/a | yes | | [root\_ca\_registries](#input\_root\_ca\_registries) | List of root CA certificates. | `list(string)` | `[]` | no | diff --git a/modules/trusted_registry/main.tf b/modules/trusted_registry/main.tf index 9259c14..af2d4b4 100644 --- a/modules/trusted_registry/main.tf +++ b/modules/trusted_registry/main.tf @@ -6,6 +6,7 @@ resource "intersight_kubernetes_trusted_registries_policy" "this" { name = var.policy_name + description = var.description root_ca_registries = var.root_ca_registries unsigned_registries = var.unsigned_registries organization { diff --git a/modules/trusted_registry/variables.tf b/modules/trusted_registry/variables.tf index bb6ebf2..25e9d83 100644 --- a/modules/trusted_registry/variables.tf +++ b/modules/trusted_registry/variables.tf @@ -2,7 +2,11 @@ variable "org_name" { type = string description = "Intersight Organization name" } - +variable "description" { + type = string + default = "" + description = "Description to be used to describe the trusted registry profile." +} variable "policy_name" { type = string diff --git a/modules/version/README.md b/modules/version/README.md index 6168210..2af0255 100644 --- a/modules/version/README.md +++ b/modules/version/README.md @@ -55,6 +55,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| +| [description](#input\_description) | Description to be used to describe the k8s version profile. | `string` | `""` | no | | [k8s\_version](#input\_k8s\_version) | Version of the Kubernetes cluster | `string` | n/a | yes | | [k8s\_version\_name](#input\_k8s\_version\_name) | Name of the policy to be created | `string` | n/a | yes | | [org\_name](#input\_org\_name) | Intersight Organization name | `string` | n/a | yes | diff --git a/modules/version/main.tf b/modules/version/main.tf index d45ca18..3ea268c 100644 --- a/modules/version/main.tf +++ b/modules/version/main.tf @@ -9,7 +9,8 @@ data "intersight_kubernetes_version" "this" { } resource "intersight_kubernetes_version_policy" "this" { - name = var.k8s_version_name + name = var.k8s_version_name + description = var.description nr_version { object_type = "kubernetes.Version" diff --git a/modules/version/variables.tf b/modules/version/variables.tf index f007654..250f1ae 100644 --- a/modules/version/variables.tf +++ b/modules/version/variables.tf @@ -10,7 +10,11 @@ variable "k8s_version_name" { type = string description = "Name of the policy to be created" } - +variable "description" { + type = string + default = "" + description = "Description to be used to describe the k8s version profile." +} variable "tags" { type = list(map(string)) default = [] diff --git a/modules/worker_profile/README.md b/modules/worker_profile/README.md index e18d798..df7f62b 100644 --- a/modules/worker_profile/README.md +++ b/modules/worker_profile/README.md @@ -49,6 +49,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [cpu](#input\_cpu) | Number of CPU allocated to the virtual machine. | `number` | `4` | no | +| [description](#input\_description) | Description to be used to describe the worker profile. | `string` | `""` | no | | [disk\_size](#input\_disk\_size) | Amount of disk to be assigned to the virtual machine in GiB. | `number` | `40` | no | | [memory](#input\_memory) | Amount of memory assigned to the virtual machine in MiB. | `number` | `16384` | no | | [name](#input\_name) | Name of the Worker Profile to be created. i.e small | `string` | n/a | yes | diff --git a/modules/worker_profile/main.tf b/modules/worker_profile/main.tf index 16a267d..377789d 100644 --- a/modules/worker_profile/main.tf +++ b/modules/worker_profile/main.tf @@ -3,10 +3,11 @@ data "intersight_organization_organization" "this" { } resource "intersight_kubernetes_virtual_machine_instance_type" "this" { - name = var.name - cpu = var.cpu - disk_size = var.disk_size - memory = var.memory + name = var.name + description = var.description + cpu = var.cpu + disk_size = var.disk_size + memory = var.memory organization { object_type = "organization.Organization" moid = data.intersight_organization_organization.this.results.0.moid diff --git a/modules/worker_profile/variables.tf b/modules/worker_profile/variables.tf index 942e50d..ee61a4b 100644 --- a/modules/worker_profile/variables.tf +++ b/modules/worker_profile/variables.tf @@ -22,7 +22,11 @@ variable "disk_size" { description = "Amount of disk to be assigned to the virtual machine in GiB." default = 40 } - +variable "description" { + type = string + default = "" + description = "Description to be used to describe the worker profile." +} variable "tags" { type = list(map(string)) default = []