Commit 2012e944 authored by Chris King's avatar Chris King
Browse files

Add variable for image visibility

* Add variable and docs in variables, tfvars example, and README
* Add locals (for null interpretation) to compute.tf
parent 1343c393
......@@ -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 |
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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment