-
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.
System boot datasource migration to TPF (#121)
* System boot datasource migration to TPF * linting fix * fixed doc * removed commented code
- Loading branch information
1 parent
ba3a53a
commit 9235286
Showing
6 changed files
with
254 additions
and
150 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,81 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "redfish_system_boot Data Source - terraform-provider-redfish" | ||
subcategory: "" | ||
description: |- | ||
Data source to fetch Firmware Inventory details via RedFish. | ||
--- | ||
|
||
# redfish_system_boot (Data Source) | ||
|
||
Data source to fetch Firmware Inventory details via RedFish. | ||
|
||
## Example Usage | ||
|
||
```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_system_boot" "system_boot" { | ||
for_each = var.rack1 | ||
redfish_server { | ||
user = each.value.user | ||
password = each.value.password | ||
endpoint = each.value.endpoint | ||
ssl_insecure = each.value.ssl_insecure | ||
} | ||
// resource_id is an optional argument. By default, the data source uses | ||
// the first ComputerSystem resource present in the ComputerSystem collection | ||
resource_id = "System.Embedded.1" | ||
} | ||
output "system_boot" { | ||
value = data.redfish_system_boot.system_boot | ||
sensitive = true | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `id` (String) Resource ID of the computer system. If not provided, the first system resource is used | ||
- `redfish_server` (Block List) List of server BMCs and their respective user credentials (see [below for nested schema](#nestedblock--redfish_server)) | ||
|
||
### Read-Only | ||
|
||
- `boot_order` (List of String) An array of BootOptionReference strings that represent the persistent boot order for this computer system | ||
- `boot_source_override_enabled` (String) The state of the boot source override feature | ||
- `boot_source_override_mode` (String) The BIOS boot mode to use when the system boots from the BootSourceOverrideTarget boot source | ||
- `boot_source_override_target` (String) Current boot source to use at next boot instead of the normal boot device, if BootSourceOverrideEnabled is true | ||
- `uefi_target_boot_source_override` (String) The UEFI device path of the device from which to boot when BootSourceOverrideTarget is UefiTarget | ||
|
||
<a id="nestedblock--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 | ||
- `ssl_insecure` (Boolean) This field indicates whether the SSL/TLS certificate must be verified or not | ||
- `user` (String) User name for login |
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,16 @@ | ||
package models | ||
|
||
import ( | ||
"github.com/hashicorp/terraform-plugin-framework/types" | ||
) | ||
|
||
// SystemBootDataSource struct for datasource | ||
type SystemBootDataSource struct { | ||
RedfishServer []RedfishServer `tfsdk:"redfish_server"` | ||
ResourceID types.String `tfsdk:"id"` | ||
BootOrder types.List `tfsdk:"boot_order"` | ||
BootSourceOverrideEnabled types.String `tfsdk:"boot_source_override_enabled"` | ||
BootSourceOverrideMode types.String `tfsdk:"boot_source_override_mode"` | ||
BootSourceOverrideTarget types.String `tfsdk:"boot_source_override_target"` | ||
UefiTargetBootSourceOverride types.String `tfsdk:"uefi_target_boot_source_override"` | ||
} |
Oops, something went wrong.