Skip to content

Not reading variable value inside nb_lookup query #676

Answered by ThomasADavis
MercifulCamel asked this question in Q&A
Discussion options

You must be logged in to vote

try something like this:

  - name: setup | create api filter
    set_fact:
      api_filter: "name={{ vm_name }}"

  - name: setup | lookup the vm from netbox
    set_fact:
      vip_address: "{{ query('netbox.netbox.nb_lookup', 'virtual-machines',
        api_endpoint=netbox_url,
        api_filter=api_filter,
        raw_data=true,
        token=netbox_token) }}"

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@MercifulCamel
Comment options

Answer selected by MercifulCamel
Comment options

You must be logged in to vote
0 replies
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