Metadata-Version: 2.4
Name: saltext.bmc
Version: 0.0.1
Summary: Salt extension for out-of-band server management via Redfish (with IPMI fallback): power, boot-device override, inventory, and sensors.
Author-email: "Daniel A. Wozniak" <dwozniak@broadcom.com>
License: Apache Software License
Project-URL: Homepage, https://github.com/salt-extensions/saltext-bmc
Project-URL: Documentation, https://salt-extensions.github.io/saltext-bmc/
Project-URL: Source, https://github.com/salt-extensions/saltext-bmc
Project-URL: Tracker, https://github.com/salt-extensions/saltext-bmc/issues
Keywords: salt-extension,bmc,redfish,ipmi,baremetal,out-of-band,ipmitool,idrac,ilo
Platform: any
Classifier: Programming Language :: Python
Classifier: Programming Language :: Cython
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: salt>=3008.0rc1
Requires-Dist: requests>=2.28.0
Provides-Extra: ipmi
Requires-Dist: pyghmi>=1.5.69; extra == "ipmi"
Provides-Extra: changelog
Requires-Dist: towncrier==25.8.0; extra == "changelog"
Provides-Extra: dev
Requires-Dist: nox[uv]!=2025.05.01,>=2024.3; extra == "dev"
Requires-Dist: pre-commit>=2.21.0; extra == "dev"
Provides-Extra: dev-extra
Requires-Dist: black==26.3.1; extra == "dev-extra"
Requires-Dist: isort==8.0.1; extra == "dev-extra"
Requires-Dist: coverage==7.13.5; extra == "dev-extra"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-prompt; extra == "docs"
Requires-Dist: sphinxcontrib-spelling; extra == "docs"
Requires-Dist: sphinx-copybutton; extra == "docs"
Requires-Dist: towncrier==25.8.0; extra == "docs"
Requires-Dist: sphinxcontrib-towncrier; extra == "docs"
Requires-Dist: myst_parser; extra == "docs"
Requires-Dist: furo; extra == "docs"
Requires-Dist: sphinx-inline-tabs; extra == "docs"
Provides-Extra: docsauto
Requires-Dist: sphinx-autobuild; extra == "docsauto"
Provides-Extra: lint
Requires-Dist: pylint==4.0.4; extra == "lint"
Requires-Dist: nox[uv]!=2025.05.01,>=2024.3; extra == "lint"
Provides-Extra: tests
Requires-Dist: pytest>=7.2.0; extra == "tests"
Requires-Dist: pytest-salt-factories>=1.0.0; extra == "tests"
Requires-Dist: pytest-helpers-namespace>=2019.1.8; extra == "tests"
Requires-Dist: pytest-timeout; extra == "tests"
Requires-Dist: pytest-instafail; extra == "tests"
Requires-Dist: responses>=0.25.0; extra == "tests"
Dynamic: license-file

# saltext-bmc

A Salt extension for out-of-band management of bare-metal servers via their BMC
(Baseboard Management Controller). Speaks **Redfish** first and **IPMI** as a
fallback (auto-detected by default), with a uniform interface for:

- power control (on / off / cycle / reset, graceful or forced)
- boot-device override (disk, PXE, UEFI HTTP, BIOS setup, CD, USB — one-shot or persistent)
- inventory (manufacturer, model, serial, UUID, BIOS version, BMC firmware)
- sensors (temperatures, fans, voltages)
- a low-level `bmc_redfish` passthrough for raw GET/POST/PATCH/DELETE against any Redfish endpoint

Primary use case: automated bare-metal provisioning (e.g. UEFI HTTP Boot for ESXi
installs) where Salt needs to power-cycle a host and steer its next boot.
See [`PLAN.md`](PLAN.md) for the full design.

## Install

```bash
pip install saltext.bmc           # Redfish only
pip install 'saltext.bmc[ipmi]'   # adds pyghmi for the IPMI fallback
```

Requires Python ≥ 3.10 and Salt ≥ 3008.

## Quick start

Configure one or more BMC profiles in Pillar:

```yaml
saltext.bmc:
  profiles:
    bmc-host-01:
      host: 10.0.0.5
      username: root
      password: calvin
      verify_ssl: false
      # backend defaults to 'auto' — probes Redfish, falls back to IPMI.
      # Set to 'redfish' or 'ipmi' explicitly to skip the probe.
      # backend: redfish
    legacy-host:
      host: 10.0.0.7
      username: ADMIN
      password: ADMIN
      backend: ipmi
      port: 623          # IPMI-only override
```

Execution module:

```bash
salt-call --local bmc.power_status     bmc-host-01
salt-call --local bmc.set_boot_device  bmc-host-01 device=http persistent=False
salt-call --local bmc.power_cycle      bmc-host-01
salt-call --local bmc.get_system_info  bmc-host-01
salt-call --local bmc.get_sensor_data  bmc-host-01

# Connection kwargs work without a pillar profile:
salt-call --local bmc.power_status host=10.0.0.5 username=root password=calvin verify_ssl=False
```

State module:

```yaml
my-host-boot:
  bmc.boot_device:
    - name: bmc-host-01
    - device: http
    - persistent: false

my-host-power:
  bmc.powered:
    - name: bmc-host-01
    - power: 'on'
```

Low-level Redfish passthrough (Redfish-only profiles):

```bash
salt-call --local bmc_redfish.get   /redfish/v1/ name=bmc-host-01
salt-call --local bmc_redfish.patch /redfish/v1/Systems/1 \
    body='{"AssetTag": "rack-7-slot-3"}' name=bmc-host-01
```

## Resource type

For Salt 3008+ resource-driven workflows, the same operations are exposed as a
`bmc` resource type with per-host targeting:

```yaml
# Pillar
resources:
  bmc:
    bmc-host-01:
      host: 10.10.10.5
      username: root
      password: calvin
      verify_ssl: false
```

```bash
salt  bmc-host-01              bmc_host.power_status   # by resource ID alone
salt -C 'T@bmc:bmc-host-01'    bmc_host.power_status   # by full SRN (type:id)
salt -C 'T@bmc'                bmc_host.power_cycle    # all bmc resources
```

## What's not here

- **Serial-over-LAN console** (`sol`) — SOL is inherently interactive and is
  better served by `ipmitool sol activate` or your BMC's web console. We do not
  ship a `bmc.sol_activate`.
- **IPMI-side `bmc_redfish.*`** — the low-level passthrough is Redfish-only by
  design; it errors immediately if the resolved profile uses `backend: ipmi`.

## License

Apache 2.0
