Add cyhy-domainsync option to skip "owned" resolved IPs#128
Merged
Conversation
Skips resolved IP addresses that are owned by a CyHy entity other than the default owner. See #126 for more info.
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jsf9k
approved these changes
Nov 17, 2025
Member
jsf9k
left a comment
There was a problem hiding this comment.
One comment for your evaluation.
dav3r
added a commit
to cisagov/ansible-role-cyhy-commander
that referenced
this pull request
Nov 17, 2025
The --no-owned flag skips resolved IP addresses that are owned by a CyHy entity other than the default owner. See cisagov/cyhy-core#128 for more info.
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗣 Description
This PR adds a
--no-ownedoption tocyhy-domainsyncthat (when enabled) does not assign a hostname to an existing HostDoc if the HostDoc is already owned by an existing CyHy entity (other than the defaultCYHYentity).💭 Motivation and context
A similar change was made to
cyhy-domainin #122, but it's possible for this situation (adding a hostname to an IP that's owned by an existing non-default CyHy entity) to occur whencyhy-domainsyncruns, so we want to updatecyhy-domainsyncto be able to prevent this from happening, if so desired.Resolves #126.
🧪 Testing
I tested in a dev environment and confirmed the following:
--no-ownedoption is set, a hostname that resolves to an IP address that is "owned" in CyHy by a non-CYHYentity is not added to the HostDoc for that IP (different from current behavior).--no-ownedoption is set, a hostname that resolves to an IP address that is "owned" in CyHy by the defaultCYHYentity is added to the HostDoc for that IP (no change from current behavior).--no-ownedoption is not set, a hostname that resolves to an IP address that is "owned" in CyHy by a non-CYHYentity is added to the HostDoc for that IP (no change from current behavior).--no-ownedoption is not set, a hostname that resolves to an IP address that is "owned" in CyHy by the defaultCYHYentity is added to the HostDoc for that IP (no change from current behavior).--no-ownedoption is not set, a hostname that resolves to an IP address that is not "owned" in CyHy by anyone is added to a newly-created HostDoc (owned by the defaultCYHYentity) for that IP (no change from current behavior).--no-ownedoption is set, a hostname that resolves to an IP address that is not "owned" in CyHy by anyone is added to a newly-created HostDoc (owned by the defaultCYHYentity) for that IP (no change from current behavior).✅ Pre-approval checklist
bump_versionscript if this repository is versioned and the changes in this PR warrant a version bump.✅ Pre-merge checklist
✅ Post-merge checklist
--no-ownedflag (confirm with CyHy Ops team first)