ome_devices (Resource)

This terraform resource is used to manage a set of device entities on OME.

Example Usage

/*
Copyright (c) 2023 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.
*/

# Resource to manage all devices
resource "ome_devices" "dev_list_1" {
}

# Resource to manage specific devices
resource "ome_devices" "dev_list_2" {
  devices = [
    {
      service_tag = "ABCD34"
    },
    {
      id = 2000
    },
    # removing this block will remove device with service tag `QWX321` from the OME
    {
      service_tag = "QWX321"
    }
  ]
}

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

Schema

Optional

Read-Only

  • id (String) ID for devices resource.

Nested Schema for devices

Optional:

  • id (Number) ID of device.
  • service_tag (String) Service tag of device.

Read-Only:

  • management_ips (List of String) List of management IPs of device.

Import

Import is supported using the following syntax:

# /*
# Copyright (c) 2023 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.
# */

# import devices by their ids
terraform import ome_devices.device_list_ids_default "<id1>,<id2>,<id3>"

# another way to import devices by their ids
terraform import ome_devices.device_list_ids "id:<id1>,<id2>,<id3>"

# import devices by their service tags
terraform import ome_devices.device_list_svc_tags "svc_tag:<svc_tag_1>,<svc_tag_2>,<svc_tag_3>"

# import all available devices
terraform import ome_devices.device_list_all ""