-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from dell/idrac_attributes
idrac_attribute resource/datasource
- Loading branch information
Showing
23 changed files
with
1,063 additions
and
955 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,186 @@ | ||
--- | ||
# 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. | ||
|
||
title: "redfish_dell_idrac_attributes data source" | ||
linkTitle: "redfish_dell_idrac_attributes" | ||
page_title: "redfish_dell_idrac_attributes Data Source - terraform-provider-redfish" | ||
subcategory: "" | ||
description: |- | ||
Data source to provide redfish infiziya | ||
--- | ||
|
||
# redfish_dell_idrac_attributes (Data Source) | ||
|
||
Data source to provide redfish infiziya | ||
|
||
This Terraform datasource is used to query existing iDRAC configuration. The information fetched from this block can be further used for resource block. | ||
## Example Usage | ||
|
||
variables.tf | ||
```terraform | ||
/* | ||
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. | ||
*/ | ||
variable "rack1" { | ||
type = map(object({ | ||
user = string | ||
password = string | ||
endpoint = string | ||
validate_cert = bool | ||
})) | ||
} | ||
``` | ||
|
||
terraform.tfvars | ||
```terraform | ||
/* | ||
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. | ||
*/ | ||
rack1 = { | ||
"my-server-1" = { | ||
user = "admin" | ||
password = "passw0rd" | ||
endpoint = "https://my-server-1.myawesomecompany.org" | ||
validate_cert = false | ||
}, | ||
"my-server-2" = { | ||
user = "admin" | ||
password = "passw0rd" | ||
endpoint = "https://my-server-2.myawesomecompany.org" | ||
validate_cert = false | ||
}, | ||
} | ||
``` | ||
|
||
provider.tf | ||
```terraform | ||
/* | ||
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. | ||
*/ | ||
terraform { | ||
required_providers { | ||
redfish = { | ||
version = "1.1.0" | ||
source = "registry.terraform.io/dell/redfish" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
main.tf | ||
```terraform | ||
/* | ||
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. | ||
*/ | ||
data "redfish_dell_idrac_attributes" "idrac" { | ||
for_each = var.rack1 | ||
redfish_server = { | ||
user = each.value.user | ||
password = each.value.password | ||
endpoint = each.value.endpoint | ||
validate_cert = each.value.validate_cert | ||
} | ||
} | ||
output "idrac_attributes" { | ||
value = data.redfish_dell_idrac_attributes.idrac | ||
sensitive = true | ||
} | ||
``` | ||
|
||
After the successful execution of the above data block, we can see the output in the state file. | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `redfish_server` (Attributes) Redfish Server (see [below for nested schema](#nestedatt--redfish_server)) | ||
|
||
### Read-Only | ||
|
||
- `attributes` (Map of String) iDRAC attributes. To check allowed attributes please either use the datasource for dell idrac attributes or query /redfish/v1/Managers/iDRAC.Embedded.1/Oem/Dell/DellAttributes/iDRAC.Embedded.1. To get allowed values for those attributes, check /redfish/v1/Registries/ManagerAttributeRegistry/ManagerAttributeRegistry.v1_0_0.json from a Redfish Instance | ||
- `id` (String) ID of the iDRAC attributes resource | ||
|
||
<a id="nestedatt--redfish_server"></a> | ||
### Nested Schema for `redfish_server` | ||
|
||
Required: | ||
|
||
- `endpoint` (String) Server BMC IP address or hostname | ||
|
||
Optional: | ||
|
||
- `password` (String, Sensitive) User password for login | ||
- `user` (String) User name for login | ||
- `validate_cert` (Boolean) This field indicates whether the SSL/TLS certificate must be verified or not |
Oops, something went wrong.