Read now works, and terraform directory contains example code
This commit is contained in:
1 parent
ef498e4a72
commit
a6f1019175
43 files changed
+4341
-38
No files matched your search
@@ -0,0 +1,42 @@
|
||||
# Example OpenTofu config for the hpe1810 provider
|
||||
|
||||
Run this once the switch is reachable again.
|
||||
|
||||
## 1. Build the provider
|
||||
|
||||
```bash
|
||||
cd ../terraform-provider-hpe1810
|
||||
go build -o terraform-provider-hpe1810 .
|
||||
```
|
||||
|
||||
`~/.tofurc` already has a `dev_overrides` entry pointing at that directory, so `tofu`
|
||||
picks up this locally-built binary instead of trying to fetch anything from a registry.
|
||||
|
||||
## 2. Plan
|
||||
|
||||
```bash
|
||||
cd ../terraform # this directory
|
||||
tofu plan
|
||||
```
|
||||
|
||||
No `tofu init` needed (and it would fail anyway — `local/joachimfriberg/hpe1810` isn't a
|
||||
real registry source) since `dev_overrides` bypasses that step entirely.
|
||||
|
||||
You'll see a warning about dev overrides being in effect — that's expected during local
|
||||
development, not an error.
|
||||
|
||||
## Files here
|
||||
|
||||
- `versions.tf` — `required_providers` block, points at the provider source name.
|
||||
- `provider.tf` — `provider "hpe1810"` block; all fields optional (see comments for the
|
||||
env-var fallback chain).
|
||||
- `main.tf` — the actual data source usage.
|
||||
- `outputs.tf` — prints what came back.
|
||||
|
||||
## Remember
|
||||
|
||||
- Only one login session to the switch at a time (see AGENT.md) — close the switch's web
|
||||
UI in your browser before running `tofu plan`.
|
||||
- Same proxy issue as the Python project: Go's `net/http` also respects `HTTP_PROXY`/
|
||||
`NO_PROXY`. If you get `login request returned status 502`, run
|
||||
`export NO_PROXY=192.168.2.10` (or `no_proxy=192.168.2.10`) before `tofu plan`.
|
||||
Reference in new issue
Block a user