Add missing elements to netbox_fhrp_group#1348
Open
Hramoff wants to merge 9 commits intonetbox-community:develfrom
Open
Add missing elements to netbox_fhrp_group#1348Hramoff wants to merge 9 commits intonetbox-community:develfrom
Hramoff wants to merge 9 commits intonetbox-community:develfrom
Conversation
Author
|
I confused how additional ones are added. I wanted to add functionality so that the IP address could be added to the FHRP group. I thought that the keys from the json that is sent to the web interface coincide with the keys in Ansible, but as it turns out, they do not. I looked at what the debug outputs: - name:
debug:
msg: "{{ query('netbox.netbox.nb_lookup', 'ip-addresses', api_endpoint=netbox_url, token=netbox_user_token, api_filter=filter_description) }}" {
"key": 11186,
"value": {
"address": "10.22.5.88/32",
"assigned_object": {
"description": "demo-network",
"display": "keepalived-vip VRRPv3: 3 (10.22.5.88/32)",
"group_id": 3,
"id": 30,
"protocol": "vrrp3",
"url": "https://netbox.local/api/ipam/fhrp-groups/30/"
},
"assigned_object_id": 30,
"assigned_object_type": "ipam.fhrpgroup",
}
}
I saw that in order to link an address to a fhrp group you need to specify its ID and type, respectively I decided to add these two parameters because I think they will be universal for other types and IDs. |
Author
|
I think that it is better to search using the name key rather than group_id. |
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.
New Behavior
I can't specify a virtual IP when creating an FHRP group via Ansible, so I added this functionality
Contrast to Current Behavior
Two new keys
ip_addressandip_statushave been added to netbox_fhrp_group.pyDiscussion: Benefits and Drawbacks
My solution is backwards compatible because I use
required=Falseand user tasks will not stop working.Next. This functionality is needed to conveniently manage FHRP groups.
Changes to the Documentation
As far as I know, the documentation in the wiki is automatically generated from the
DOCUMENTATIONvariable in the module, so I added a description there of what I did and how to work with itProposed Release Note Entry
Add missing elements to netbox_fhrp_group
develbranch.