-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add terraform modules for all charms
- Loading branch information
1 parent
5622152
commit 8a50471
Showing
21 changed files
with
740 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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,50 @@ | ||
# Terraform module for cephfs-server-proxy | ||
|
||
This is a Terraform module facilitating the deployment of the cephfs-server-proxy 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 | ||
|
||
This module requires a Juju model to be available. Refer to the [usage](#usage) | ||
section for more details. | ||
|
||
## API | ||
|
||
### Inputs | ||
|
||
This module offers the following configurable units: | ||
|
||
| Name | Type | Description | Default | Required | | ||
|---------------|-------------|----------------------------------------------------------|---------------------|:--------:| | ||
| `app_name` | string | Application name | cephfs-server-proxy | | | ||
| `base` | string | Base version to use for deployed machine | [email protected] | | | ||
| `channel` | string | Channel that charm is deployed from | latest/edge | | | ||
| `config` | map(string) | Map of charm configuration options to pass at deployment | {} | | | ||
| `constraints` | string | Constraints for the charm deployment | "arch=amd64" | | | ||
| `model_name` | string | Name of the model to deploy the charm to | | Y | | ||
| `revision` | number | Revision number of charm to deploy | null | | | ||
| `units` | number | Number of units to deploy | 1 | | | ||
|
||
### Outputs | ||
|
||
After applying, the module exports the following outputs: | ||
|
||
| Name | Description | | ||
|------------|-----------------------------| | ||
| `app_name` | Application name | | ||
| `provides` | Map of `provides` endpoints | | ||
|
||
## Usage | ||
|
||
Users should ensure that Terraform is aware of the Juju model dependency of the | ||
charm module. | ||
|
||
To deploy this module with its required dependency, you can run | ||
the following command: | ||
|
||
```shell | ||
terraform apply -var="model_name=<MODEL_NAME>" -auto-approve | ||
``` |
This file contains 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,29 @@ | ||
# Copyright 2025 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" "cephfs-server-proxy" { | ||
name = var.app_name | ||
model = var.model_name | ||
|
||
charm { | ||
name = "cephfs-server-proxy" | ||
base = var.base | ||
channel = var.channel | ||
revision = var.revision | ||
} | ||
|
||
config = var.config | ||
constraints = var.constraints | ||
units = var.units | ||
} |
This file contains 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 2025 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 "app_name" { | ||
value = juju_application.cephfs-server-proxy.name | ||
} | ||
|
||
output "provides" { | ||
value = { | ||
filesystem = "filesystem" | ||
} | ||
} |
This file contains 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,61 @@ | ||
# Copyright 2025 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 = "Application name" | ||
type = string | ||
default = "cephfs-server-proxy" | ||
} | ||
|
||
variable "base" { | ||
description = "Charm base" | ||
type = string | ||
default = "[email protected]" | ||
} | ||
|
||
variable "channel" { | ||
description = "Charm channel" | ||
type = string | ||
default = "latest/edge" | ||
} | ||
|
||
variable "config" { | ||
description = "Charm configuration" | ||
type = map(string) | ||
default = {} | ||
} | ||
|
||
variable "constraints" { | ||
description = "Deployment constraints" | ||
type = string | ||
default = "arch=amd64" | ||
} | ||
|
||
variable "model_name" { | ||
description = "Model name" | ||
type = string | ||
} | ||
|
||
variable "revision" { | ||
description = "Charm revision" | ||
type = number | ||
nullable = true | ||
default = null | ||
} | ||
|
||
variable "units" { | ||
description = "Number of units" | ||
type = number | ||
default = 1 | ||
} |
This file contains 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,22 @@ | ||
# Copyright 2025 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_providers { | ||
juju = { | ||
source = "juju/juju" | ||
version = ">= 0.14.0" | ||
} | ||
} | ||
} |
This file contains 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,49 @@ | ||
# Terraform module for filesystem-client | ||
|
||
This is a Terraform module facilitating the deployment of the filesystem-client 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 | ||
|
||
This module requires a Juju model to be available. Refer to the [usage](#usage) | ||
section for more details. | ||
|
||
## API | ||
|
||
### Inputs | ||
|
||
This module offers the following configurable units: | ||
|
||
| Name | Type | Description | Default | Required | | ||
|---------------|-------------|----------------------------------------------------------|-------------------|:--------:| | ||
| `app_name` | string | Application name | filesystem-client | | | ||
| `base` | string | Base version to use for deployed machine | [email protected] | | | ||
| `channel` | string | Channel that charm is deployed from | latest/edge | | | ||
| `config` | map(string) | Map of charm configuration options to pass at deployment | {} | | | ||
| `constraints` | string | Constraints for the charm deployment | "arch=amd64" | | | ||
| `model_name` | string | Name of the model to deploy the charm to | | Y | | ||
| `revision` | number | Revision number of charm to deploy | null | | | ||
|
||
### Outputs | ||
|
||
After applying, the module exports the following outputs: | ||
|
||
| Name | Description | | ||
|------------|-----------------------------| | ||
| `app_name` | Application name | | ||
| `requires` | Map of `requires` endpoints | | ||
|
||
## Usage | ||
|
||
Users should ensure that Terraform is aware of the Juju model dependency of the | ||
charm module. | ||
|
||
To deploy this module with its required dependency, you can run | ||
the following command: | ||
|
||
```shell | ||
terraform apply -var="model_name=<MODEL_NAME>" -auto-approve | ||
``` |
This file contains 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,29 @@ | ||
# Copyright 2025 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" "filesystem-client" { | ||
name = var.app_name | ||
model = var.model_name | ||
|
||
charm { | ||
name = "filesystem-client" | ||
base = var.base | ||
channel = var.channel | ||
revision = var.revision | ||
} | ||
|
||
config = var.config | ||
constraints = var.constraints | ||
units = 0 | ||
} |
This file contains 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 2025 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 "app_name" { | ||
value = juju_application.filesystem-client.name | ||
} | ||
|
||
output "requires" { | ||
value = { | ||
filesystem = "filesystem" | ||
juju-info = "juju-info" | ||
} | ||
} |
This file contains 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,55 @@ | ||
# Copyright 2025 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 = "Application name" | ||
type = string | ||
default = "filesystem-client" | ||
} | ||
|
||
variable "base" { | ||
description = "Charm base" | ||
type = string | ||
default = "[email protected]" | ||
} | ||
|
||
variable "channel" { | ||
description = "Charm channel" | ||
type = string | ||
default = "latest/edge" | ||
} | ||
|
||
variable "config" { | ||
description = "Charm configuration" | ||
type = map(string) | ||
default = {} | ||
} | ||
|
||
variable "constraints" { | ||
description = "Deployment constraints" | ||
type = string | ||
default = "arch=amd64" | ||
} | ||
|
||
variable "model_name" { | ||
description = "Model name" | ||
type = string | ||
} | ||
|
||
variable "revision" { | ||
description = "Charm revision" | ||
type = number | ||
nullable = true | ||
default = null | ||
} |
This file contains 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,22 @@ | ||
# Copyright 2025 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_providers { | ||
juju = { | ||
source = "juju/juju" | ||
version = ">= 0.14.0" | ||
} | ||
} | ||
} |
Oops, something went wrong.