-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add Terraform module for lustre-server #52
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
Merged
NucciTheBoss
merged 1 commit into
canonical:main
from
jedel1043:terraform-lustre-server
Aug 13, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # Terraform module for lustre-server | ||
|
|
||
| This is a Terraform module facilitating the deployment of the lustre-server charm using | ||
| the [Juju Terraform provider](https://github.com/juju/terraform-provider-juju). | ||
| For more information, refer to the | ||
| [documentation](https://registry.terraform.io/providers/juju/juju/latest/docs) | ||
| for the Juju Terraform provider. | ||
|
|
||
| ## Requirements | ||
|
|
||
| - Terraform >= 1.0 | ||
| - Juju Terraform provider >= 1.0.0, < 2.0.0 | ||
| - An existing Juju model | ||
|
|
||
| ## API | ||
|
|
||
| ### Inputs | ||
|
|
||
| | Name | Type | Description | Default | Required | | ||
| |---------------|-------------|--------------------------------------------------------------------|-------------------|:--------:| | ||
| | `app_name` | string | Name for the deployed application | `"lustre-server"` | | | ||
| | `base` | string | Operating system base for the charm (e.g. ubuntu@26.04) | `null` | | | ||
| | `channel` | string | Charm channel to deploy from | `"latest/edge"` | | | ||
| | `config` | map(string) | Map of charm configuration options | `{}` | | | ||
| | `constraints` | string | Constraints string for the charm deployment | `null` | | | ||
| | `machines` | set(string) | List of machine resources to deploy the charm on | `[]` | | | ||
| | `model_uuid` | string | UUID of the Juju model to deploy the charm into | | Y | | ||
| | `revision` | number | Charm revision to deploy. Null deploys the latest on given channel | `null` | | | ||
| | `units` | number | Number of application units to deploy | `1` | | | ||
|
|
||
| ### Outputs | ||
|
|
||
| | Name | Description | | ||
| |---------------|------------------------------------------| | ||
| | `application` | The deployed `juju_application` resource | | ||
| | `provides` | Map of `provides` endpoint names | | ||
|
|
||
| The `provides` output exposes the following endpoint names: | ||
|
|
||
| | Key | Endpoint name | | ||
| |--------------|---------------| | ||
| | `filesystem` | `filesystem` | | ||
|
|
||
| ## Usage | ||
|
|
||
| Ensure that Terraform is aware of the Juju model dependency of the charm module. | ||
|
|
||
| ```hcl | ||
| module "lustre-server" { | ||
| source = "git::https://github.com/canonical/filesystem-charms//charms/lustre-server/terraform" | ||
| model_uuid = juju_model.my_model.uuid | ||
| } | ||
| ``` | ||
|
|
||
| To deploy this module with its required dependency, you can run the following | ||
| command: | ||
|
|
||
| ```shell | ||
| terraform apply -var="model_uuid=<MODEL_UUID>" -auto-approve | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Copyright 2026 Canonical Ltd. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| resource "juju_application" "lustre-server" { | ||
| name = var.app_name | ||
| model_uuid = var.model_uuid | ||
|
|
||
| charm { | ||
| name = "lustre-server" | ||
| base = var.base | ||
| channel = var.channel | ||
| revision = var.revision | ||
| } | ||
|
|
||
| config = var.config | ||
| constraints = var.constraints | ||
| machines = var.machines | ||
| units = var.units | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Copyright 2026 Canonical Ltd. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| output "application" { | ||
| value = juju_application.lustre-server | ||
| } | ||
|
|
||
| output "provides" { | ||
| value = { | ||
| filesystem = "filesystem" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Copyright 2026 Canonical Ltd. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| provider "juju" {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Copyright 2026 Canonical Ltd. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| terraform { | ||
| required_version = ">= 1.0" | ||
|
|
||
| required_providers { | ||
| juju = { | ||
| source = "juju/juju" | ||
| version = "~> 1.0" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Copyright 2026 Canonical Ltd. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| variable "app_name" { | ||
| description = "Name for the deployed application" | ||
| type = string | ||
| default = "lustre-server" | ||
| } | ||
|
|
||
| variable "base" { | ||
| description = "Operating system base for the charm (for example, ubuntu@26.04)" | ||
| type = string | ||
| default = null | ||
| } | ||
|
|
||
| variable "channel" { | ||
| description = "Charm channel to deploy from" | ||
| type = string | ||
| default = "latest/edge" | ||
| } | ||
|
|
||
| variable "config" { | ||
| description = "Map of charm configuration options" | ||
| type = map(string) | ||
| default = {} | ||
| } | ||
|
|
||
| variable "constraints" { | ||
| description = "Constraints string for the charm deployment" | ||
| type = string | ||
| default = null | ||
| } | ||
|
|
||
| variable "machines" { | ||
| description = "List of machine resources to deploy the charm on" | ||
| type = set(string) | ||
| default = [] | ||
| } | ||
|
|
||
| variable "model_uuid" { | ||
| description = "UUID of the Juju model to deploy the charm into" | ||
| type = string | ||
| nullable = false | ||
| } | ||
|
|
||
| variable "revision" { | ||
| description = "Charm revision to deploy. Null deploys the latest on the given channel" | ||
| type = number | ||
| nullable = true | ||
| default = null | ||
| } | ||
|
|
||
| variable "units" { | ||
| description = "Number of application units to deploy" | ||
| type = number | ||
| default = 1 | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[foresight]: eventually we'll want to switch this over to the stable channel for Lustre. I'm expecting the channel name to be something like
2/stableto represent the latest major version of Lustre.