Skip to content
Discussion options

You must be logged in to vote

Custom Links are probably what you want.

Here is a config I use to display an "Open IPMI" button on any device which has exactly one interface marked "Management Only" with exactly one IP address on that interface.

### Link text ###
{% if object.interfaces.filter(mgmt_only=True).count() == 1 and object.interfaces.get(mgmt_only=True).ip_addresses.count() == 1 %}Open IPMI{% endif %}

### Link URL ###
https://{{ object.interfaces.get(mgmt_only=True).ip_addresses.first().address.ip }}/

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ryanmerolle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants