Skip to content

[Feature]: Allow Configuring BMCs with NTP, Syslog, SSH Keys, etc. #129

@davidallendj

Description

@davidallendj

Describe the feature

Adding this feature would allow magellan to configure BMC settings as mentioned in the title of this issue. This can currently be done using curl itself and making a request to the /redfish/v1/Managers/BMC/NetworkProtocol endpoint.

Example update setting NTP:

    curl -skL \
        -u ${RF_PASS} \
        -H "If-None-Match: 570254F2" \
        -H "Content-Type: application/json" \
        -X PATCH \
        -d @payload.json \
        https://<bmc_ip>/redfish/v1/Managers/BMC/NetworkProtocol
{
    "NTP": {
        "NTPServers": ["192.168.100.254"],
        "Port": 123,
        "ProtocolEnabled": true
    }
}

Example updating SSH keys on EX hardware:

curl -skL \
        -u ${RF_PASS} \
        -H "If-None-Match: 570254F2" \
        -H "Content-Type: application/json" \
        -X PATCH \
        -d @payload.json \
        https://<bmc_ip>/redfish/v1/Managers/BMC/NetworkProtocol
{
    "Oem": {
        "SSHAdmin": {
            "AuthorizedKeys": "<SSH Public Key>"
        }
    }
}

The new CLI command might look something like the following:

# get list all of the settings available to update 
magellan settings list
# get list of all of the Oem settings 
magellan settings list Oem

# get the port number for IPMI
magellan settings get IPMI Port 

# update the setting
magellan settings update IPMI Port 623

The CLI arguments build a JSON payload that is sent to the appropriate endpoint. For example:

magellan settings update Oem SSHAdmin AuthorizedKeys <SSH Public Key>

This creates a request that is equivalent to the following:

curl -skL \
        -u ${RF_PASS} \
        -H "If-None-Match: 570254F2" \
        -H "Content-Type: application/json" \
        -X PATCH \
        -d '{
    "Oem": {
        "SSHAdmin": {
            "AuthorizedKeys": "<SSH Public Key>"
        }
    }
}'
        https://<bmc_ip>/redfish/v1/Managers/BMC/NetworkProtocol

This feature can be expanded in the future to track a history of changes made to settings.

Why do you want this feature?

This feature will make it easier and more convenient to configure BMC settings with CLI instead of raw curl commands.

Alternatives you've considered

This is possible already with curl. It makes sense to put this in magellan since it's already a CLI frontend for Redfish interactions.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions