-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing elements to netbox_fhrp_group #1348
base: devel
Are you sure you want to change the base?
Add missing elements to netbox_fhrp_group #1348
Conversation
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. |
I think that it is better to search using the name key rather than group_id. |
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_address
andip_status
have been added to netbox_fhrp_group.pyDiscussion: Benefits and Drawbacks
My solution is backwards compatible because I use
required=False
and 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
DOCUMENTATION
variable 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
devel
branch.