ome_static_group (Resource)

This terraform resource is used to manage Static Device Group entity on OME.We can Create, Update and Delete OME Static Device Group using this resource. We can also do an ‘Import’ an existing ‘Static Device Group’ from OME .

~> Note: Exactly one of ref_template_name and ref_template_id and exactly one of device_ids and device_servicetags are required.

~> Note: When schedule is true, following parameters are considered: notify_on_schedule, cron, email_addresses, output_format.

~> Note: Updates are supported for all the parameters.

Example Usage

# /*
# Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved.
# Licensed under the Mozilla Public 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://mozilla.org/MPL/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.
# */

# get all devices in the CIDR "10.10.10.10/26" with model PowerEdge MX840c
data "ome_device" "devs" {
  filters = {
    ip_expressions    = ["10.10.10.10/26"]
    filter_expression = "Model eq 'PowerEdge MX840c'"
  }
}

# get the root group of all static groups in OME
# we are mainly concerned with the ID of this group which we shall use to create a child group
data "ome_groupdevices_info" "ome_root" {
  device_group_names = ["Static Groups"]
}

# Create a group of all the devices fetched by the device datasource
# Its parent group will be "Static Groups"
resource "ome_static_group" "pE-slash-26" {
  name        = "Group46"
  description = "Group of all devices in the CIDR '10.10.10.10/26' with model PowerEdge MX840c"
  parent_id   = data.ome_groupdevices_info.ome_root.device_groups["Static Groups"].id
  device_ids  = data.ome_device.devs.devices[*].id
}

After the execution of above resource block, static group would have been created on the OME. For more information, Please check the terraform state file.

Schema

Required

  • name (String) Name of the static group.
  • parent_id (Number) ID of the parent group of the static group. If the value of parent_id changes, Terraform will destroy and recreate the resource.

Optional

  • description (String) Description of the static group.
  • device_ids (Set of Number) List of IDs of child devices of the group.

Read-Only

  • id (Number) ID of the static group.
  • membership_type_id (Number) Membership type of the static group.

Import

Import is supported using the following syntax:

# /*
# Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved.
# Licensed under the Mozilla Public 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://mozilla.org/MPL/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 import ome_static_group.group_1 "<existing_static_group_name>"