community.network.avi – Look up Avi
objects.¶
Note
This plugin is part of the community.network collection (version 2.1.1).
To install it use: ansible-galaxy collection install community.network
.
To use it in a playbook, specify: community.network.avi
.
Synopsis¶
Given an object_type, fetch all the objects of that type or fetch the specific object that matches the name/uuid given via options.
For single object lookup. If you want the output to be a list, you may want to pass option wantlist=True to the plugin.
Parameters¶
Notes¶
Note
For more information on using Ansible to manage Avi Network devices see https://www.ansible.com/ansible-avi-networks.
Examples¶
# Lookup query for all the objects of a specific type.
- ansible.builtin.debug: msg="{{ lookup('community.network.avi', avi_credentials=avi_credentials, obj_type='virtualservice') }}"
# Lookup query for an object with the given name and type.
- ansible.builtin.debug: msg="{{ lookup('community.network.avi', avi_credentials=avi_credentials, obj_name='vs1', obj_type='virtualservice', wantlist=True) }}"
# Lookup query for an object with the given UUID and type.
- ansible.builtin.debug: msg="{{ lookup('community.network.avi', obj_uuid='virtualservice-5c0e183a-690a-45d8-8d6f-88c30a52550d', obj_type='virtualservice') }}"
# We can replace lookup with query function to always the get the output as list.
# This is helpful for looping.
- ansible.builtin.debug: msg="{{ query('community.network.avi', obj_uuid='virtualservice-5c0e183a-690a-45d8-8d6f-88c30a52550d', obj_type='virtualservice') }}"
Return Values¶
Common return values are documented here, the following are the fields unique to this lookup:
Key | Returned | Description |
---|---|---|
_raw
list
/ elements=dictionary
|
success |
One ore more objects returned from ``Avi`` API.
|
Authors¶
Sandeep Bandi (@sabandi) <sandeepb@avinetworks.com>