Skip to content

Conversation

@raddessi
Copy link
Contributor

@raddessi raddessi commented Nov 9, 2023

What does this PR do?

This adds support to allow the user to configure in what pillar key the netbox ext_pillar data gets populated in. For example I already use the netbox pillar for server and client configuration and there are a few overlapping keys there. Personally I would prefer to leave the existing config as-is and then move the minion data in to the pillar location netbox:minion.

What issues does this PR fix or reference?

I didn't open an issue for this since it seemed like a trivial addition for me to just add and ask for opinions on afterwards.

Previous Behavior

The netbox minion data would always be populated in the netbox pillar.

New Behavior

The netbox minion data will be populated in the netbox pillar by default but the user can now specify the pillar location they would like it placed in to, optionally.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@raddessi raddessi requested a review from a team as a code owner November 9, 2023 19:18
@raddessi raddessi requested review from dwoz and removed request for a team November 9, 2023 19:18
@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title feat: allow configurable destination for netbox ext_pillar data [master] feat: allow configurable destination for netbox ext_pillar data Nov 9, 2023
Comment on lines +2342 to +2344
default_kwargs["connected_devices"] = True
default_kwargs["destination_pillar_key"] = "netbox:minion"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just copied the full test so this could be cleaned up for sure. I can add a minimal response fixture that is dedicated for this test if wanted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Scratch that, I have now copied the fixture data also. In theory we could deduplicate this a little now if you would like.

Comment on lines +94 to +95
A colon-delimited compound key string of nested pillar keys in which the
data should be populated. This lets put the data in the pillar at
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's a cleaner way to say this?

Copy link
Contributor

Choose a reason for hiding this comment

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

How about this from ChatGPT:
A colon-delimited string representing a nested path within the pillar where the data should be placed. This allows flexibility in organizing pillar data. For example, you can store the data under netbox:minion or an-arbitrary-location, which is useful if you already use the netbox pillar and need to avoid key conflicts within it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll update this PR tonight, thanks!

@raddessi
Copy link
Contributor Author

raddessi commented Nov 9, 2023

@ggiesen you may want to comment here? Thanks!

@raddessi
Copy link
Contributor Author

raddessi commented Nov 9, 2023

the logic doesn't work, I will update

@raddessi
Copy link
Contributor Author

Looks like the current test failure may be unrelated?

Comment on lines +94 to +95
A colon-delimited compound key string of nested pillar keys in which the
data should be populated. This lets put the data in the pillar at
Copy link
Contributor

Choose a reason for hiding this comment

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

How about this from ChatGPT:
A colon-delimited string representing a nested path within the pillar where the data should be placed. This allows flexibility in organizing pillar data. For example, you can store the data under netbox:minion or an-arbitrary-location, which is useful if you already use the netbox pillar and need to avoid key conflicts within it.

@twangboy twangboy added pending-changes The pull request needs additional changes before it can be merged test:pkg Run the package tests labels Jul 2, 2025
@twangboy twangboy added the merge-conflict PR has a merge conflict label Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-conflict PR has a merge conflict pending-changes The pull request needs additional changes before it can be merged test:pkg Run the package tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants