diff --git a/README.md b/README.md index 079626ee603626e844061408a7536c1ec7f8ae15..92b2279e3ebec9be2a7e1b554c619003693675fb 100644 --- a/README.md +++ b/README.md @@ -32,19 +32,20 @@ ssh-add ~/path/to/private/key # Variables -| Variable | Type | Required | Default | Description | -| :--- | :--- | :--- | :--- | :--- | -| `user_name` | string | yes | | OpenStack username | -| `user_domain_name` | string | yes | | The login domain to use for the user | -| `appcred_id` | string | yes | | Application credential ID. Get one from the openstack dashboard | -| `appcred_name` | string | yes | | Name of the application credential | -| `appcred_secret` | string | yes | | Application credential secret | -| `ssh_keypair` | string | yes | | ssh keypair name to use for authentication | -| `base_image_name` | string | no | `sles-15-sp2-x86_64` | Base image to use for all instances | -| `osd_node_count` | number | no | 3 | Amount of OSD node(s) to provision | -| `public_network_dns` | list(string) | yes | | DNS to use for hosts | -| `sles_reg_code` | string | yes | | SUSE Enterprise registration code | -| `sles_reg_email` | string | yes | | email for use with SUSE registration | -| `sles_ses_reg` | string | yes | | code to register for the storage package in SUSE | -| `osd_disk_sizes` | list(number) | no | \[8, 8\] | Amount/size of disks to add, in GB | +| Variable | Type | Required | Default | Description | +| :--- | :--- | :--- | :--- | :--- | +| `user_name` | string | yes | | OpenStack username | +| `user_domain_name` | string | yes | | The login domain to use for the user | +| `appcred_id` | string | yes | | Application credential ID. Get one from the openstack dashboard | +| `appcred_name` | string | yes | | Name of the application credential | +| `appcred_secret` | string | yes | | Application credential secret | +| `ssh_keypair` | string | yes | | ssh keypair name to use for authentication | +| `base_image_name` | string | no | `sles-15-sp2-x86_64` | Base image to use for all instances | +| `base_image_visibility` | string | no | `null` | Visibility of image. Must be one of "public", "private", "community", or "shared" | +| `osd_node_count` | number | no | 3 | Amount of OSD node(s) to provision | +| `public_network_dns` | list(string) | yes | | DNS to use for hosts | +| `sles_reg_code` | string | yes | | SUSE Enterprise registration code | +| `sles_reg_email` | string | yes | | email for use with SUSE registration | +| `sles_ses_reg` | string | yes | | code to register for the storage package in SUSE | +| `osd_disk_sizes` | list(number) | no | \[8, 8\] | Amount/size of disks to add, in GB | diff --git a/compute.tf b/compute.tf index d12737e357683ff9249deea2ef3e4ccc2cb3dc42..9477ff680b6cfbedbd3f7849299fa32d20a2ba52 100644 --- a/compute.tf +++ b/compute.tf @@ -1,7 +1,12 @@ +locals { + local_base_image_visibility = var.base_image_visibility == "null" ? null : var.base_image_visibility +} + # data for reference image data "openstack_images_image_v2" "base_image" { - name = var.base_image_name + name = var.base_image_name + visibility = local.local_base_image_visibility } # data for different instance sizes diff --git a/terraform.tfvars.example b/terraform.tfvars.example index e518494509298e23b5b0deb9f2c598e6d8e8378b..fca2711f7c460f7a9b09fbef79fe18a4cea0c00f 100644 --- a/terraform.tfvars.example +++ b/terraform.tfvars.example @@ -18,6 +18,8 @@ ssh_keypair = "ssh_keypair_name" # base image name; right now only suse is supported #base_image_name = "sles-15-sp2-x86_64" +# image visibility; must be one of "public", "private", "community", or "shared" +#base_image_visibility = "community" # the number of OSD instance(s) to deploy #osd_node_count = 1 # an array of IPs to use for dns in the instance diff --git a/variables.tf b/variables.tf index 5333ee6eb007403ffd5af2ed9d133d5927de8640..ed696becdde912ce1635aac726ede71ddc2a2f81 100644 --- a/variables.tf +++ b/variables.tf @@ -34,6 +34,16 @@ variable "base_image_name" { description = "base image to use for the cluster" } +variable "base_image_visibility" { + type = string + default = "null" + description = "visibility of base image" + validation { + condition = can(regex("^(public|private|community|shared|null)$", var.base_image_visibility)) + error_message = "Must be one of \"public\", \"private\", \"community\", or \"shared\"." + } +} + variable "osd_node_count" { type = number default = 3