Skip to content

Commit

Permalink
Add first batch of review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
phvalguima committed Nov 21, 2024
1 parent 7237e03 commit dd67416
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The module offers the following configurable inputs:
| `revision`| number | Revision number of the charm name | False |
| `units`| number | Number of units to be deployed | False |
| `constraints`| string | Machine constraints for the charm | False |
| `storage`| map(string) | Storage description, must follow the juju provider schema | False |


### Outputs
Expand Down
4 changes: 2 additions & 2 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ resource "juju_application" "opensearch" {

lifecycle {
precondition {
condition = length(var.machines) == 0 || (length(var.machines) > 0 && length(var.machines) == var.units)
condition = length(var.machines) == 0 || length(var.machines) == var.units
error_message = "Machine count does not match unit count"
}
precondition {
condition = length(var.storage) == 0 || (length(var.storage) > 0 && (lookup(var.storage, "count", 0) <= 1) && (lookup(var.storage, "count", 0) > 0))
condition = length(var.storage) == 0 || lookup(var.storage, "count", 0) <= 1
error_message = "Only one storage is supported"
}
}
Expand Down
2 changes: 1 addition & 1 deletion terraform/tests/preamble.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ resource "juju_application" "self-signed-certificates" {
}
model = var.model_name
depends_on = [null_resource.preamble]
}
}
2 changes: 1 addition & 1 deletion terraform/tests/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ terraform {
version = "~> 2.3.4"
}
}
}
}
6 changes: 3 additions & 3 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ variable "app_name" {
variable "channel" {
description = "Charm channel"
type = string
default = null
default = "2/stable"
}

variable "base" {
Expand Down Expand Up @@ -39,7 +39,7 @@ variable "revision" {
variable "units" {
description = "Charm units"
type = number
default = 1
default = 3
}

variable "constraints" {
Expand All @@ -64,4 +64,4 @@ variable "endpoint_bindings" {
description = "Map of endpoint bindings"
type = map(string)
default = {}
}
}
2 changes: 1 addition & 1 deletion terraform/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ terraform {
version = "~> 0.14.0"
}
}
}
}

0 comments on commit dd67416

Please sign in to comment.