Skip to content

feat(ironic): add network device credentials config - #2408

Merged
cardoe merged 1 commit into
mainfrom
add-network-device-credentials-config
Oct 1, 2026
Merged

cardoe merged 1 commit into
mainfrom
add-network-device-credentials-config

Conversation

@khackworth

Copy link
Copy Markdown
Contributor

Adding volume mount for network-device-credentials secret
Adding oslo.config for netdev creds
includes get_credential and get_panos_credentials helpers

@khackworth
khackworth force-pushed the add-network-device-credentials-config branch from 45dfaf5 to 2016a8e Compare September 25, 2026 14:19
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Python test results

416 tests   411 ✅  51s ⏱️
  1 suites    5 💤
  1 files      0 ❌

Results for commit 7761d79.

♻️ This comment has been updated with latest results.

cardoe
cardoe previously requested changes Sep 25, 2026

@cardoe cardoe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really don't need to mess with mounting paths. We should use Oslo.config for anything we need to load.

@khackworth
khackworth force-pushed the add-network-device-credentials-config branch from 70f5ff7 to 8122093 Compare September 28, 2026 17:04
@khackworth
khackworth requested a review from cardoe September 28, 2026 17:36
@khackworth
khackworth force-pushed the add-network-device-credentials-config branch from d330bb4 to e068bc0 Compare September 30, 2026 18:54

@cardoe cardoe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we'll revisit this to declare the variables properly so we can validate configs as well but we can move forward to let testing happen.

@cardoe
cardoe dismissed their stale review September 30, 2026 19:18

So we'll revisit this to declare the variables properly so we can validate configs as well but we can move forward to let testing happen.

@haseebsyed12
haseebsyed12 force-pushed the add-network-device-credentials-config branch from 49afddd to d3eafbb Compare September 30, 2026 19:47

@cardoe cardoe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together. A few things to change before merging:

1. Password and key options need secret=True

None of the credential options set secret=True. Without it, oslo.config prints the real values in the config dump at service startup whenever debug logging is on. Please add it to every *_password option and to panorama_master_key:

cfg.StrOpt("standard_password", secret=True, help="PAN-OS standard password"),
cfg.StrOpt("panorama_master_key", secret=True, help="Panorama master key"),

2. Rename the groups to share a netdev_ prefix

  • nd_service_accounts → netdev_common
  • f5 → netdev_f5
  • panos → netdev_panos

All three now group together in the config and are clearly tied to network devices. A bare f5 or panos section in ironic.conf could also clash with an upstream or vendor plugin later. With the rename, the nd = "nd" entry in .typos.toml can go. Allowing nd everywhere would hide real "and" typos across the repo.

3. Drop the enroll-fw.yaml change

This loads a different secret (network-device-credentials, not -ini) into the enroll-fw pod as environment variables. Nothing in the workflow reads them, so every network device password ends up in the env of every enroll-fw pod for no benefit. Please add it in the PR that actually uses it, and use a file mount rather than envFrom when that happens.

4. The secret key must end in .conf

etcSources mounts network-device-credentials-ini into /etc/ironic/ironic.conf.d/, and --config-dir only reads *.conf files. If the ExternalSecret's key is something like network_devices.ini, it will be ignored without any error and every option will come back as None or its default. Please confirm the key is network_devices.conf.

5. Trim the tests and fix the cleanup

Most of these tests set an override and check that oslo.config returns it, which tests oslo.config rather than our code. One small test that checks the helpers return the right shape is enough.

Whatever stays shouldn't reach into CONF._groups[group]._opts. If those private attributes change, the try/except silently skips the cleanup and the tests start affecting each other. test_panos_uses_defaults already only passes because of the order the tests run in. Use oslo_config.fixture.Config instead, which undoes the overrides for you.

Also, rather than turning off S105/S106 for every test file in pyproject.toml, please put # noqa: S105 / # noqa: S106 on the specific lines that have fake passwords.

@cardoe

cardoe commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

These review comments are done in add-network-device-credentials-config...netdev-credentials-review

- adds config and helper util to read creds
- integrates with puc-2053
@cardoe
cardoe force-pushed the add-network-device-credentials-config branch from 7761d79 to d0996ee Compare October 1, 2026 18:06
@cardoe
cardoe enabled auto-merge October 1, 2026 18:06
@cardoe
cardoe added this pull request to the merge queue Oct 1, 2026
Merged via the queue into main with commit ff8601a Oct 1, 2026
64 checks passed
@cardoe
cardoe deleted the add-network-device-credentials-config branch October 1, 2026 18:07
cardoe added a commit that referenced this pull request Oct 1, 2026
Load the network-device-credentials secret in the argo-events namespace into the ansible-run container via envFrom so playbooks can read the PAN-OS, F5, and service account credentials as environment variables. The secret's keys are already shaped as env var names. It's optional so sites without the secret keep working. The Ironic side is handled through oslo.config in #2408.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants