Skip to content

Commit

Permalink
feat: add tf module for slurmrestd
Browse files Browse the repository at this point in the history
Signed-off-by: Jason C. Nucciarone <[email protected]>
  • Loading branch information
NucciTheBoss committed Sep 12, 2024
1 parent 7e1355b commit 246f1da
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 0 deletions.
26 changes: 26 additions & 0 deletions charms/slurmrestd/terraform/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2024 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" "slurmrestd" {
name = var.app_name
model = var.model_name

charm {
name = "slurmrestd"
channel = var.channel
}

config = var.config
units = var.units
}
23 changes: 23 additions & 0 deletions charms/slurmrestd/terraform/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 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.slurmrestd.name
}

output "provides" {
value = {
slurmctld = "slurmctld"
}
}
47 changes: 47 additions & 0 deletions charms/slurmrestd/terraform/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2024 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 of the slurmrestd application within the Juju model"
type = string
}

variable "channel" {
description = "Channel to deploy the slurmrestd charm from."
type = string
default = "latest/stable"
}

variable "config" {
description = "Initial configuration for deployed slurmrestd charm."
type = map(string)
default = {}
}

variable "model_name" {
description = "Name of model to deploy slurmrestd charm to."
type = string
}

variable "revision" {
description = "Revision of the slurmrestd charm to deploy."
type = number
default = null
}

variable "units" {
description = "Number of slurmrestd units to deploy."
type = number
default = 1
}
22 changes: 22 additions & 0 deletions charms/slurmrestd/terraform/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2024 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.13.0"
}
}
}

0 comments on commit 246f1da

Please sign in to comment.