Integrate API with ansible

luisleon
Comes here often

Integrate API with ansible

Hello everyone, I am currently finding the Cisco Meraki collection module in Ansible to obtain the IP information of my servers, Network, Name, Model, Mac Address among others, this is in order to obtain all the data, What is the module?

 

Kind regards

3 Replies 3
alemabrahao
Kind of a big deal
Kind of a big deal

To gather information about your servers, such as IP, network, name, model, MAC address, and other data using Ansible, you can use the cisco.meraki.networks module. This module is part of the cisco.meraki collection and allows you to manage operations like creating, updating, and deleting networks within the Meraki environment.

 

Here’s an example of how you can use the module in an Ansible playbook:

 

- name: Get Meraki network information
cisco.meraki.networks:
auth_key: your_meraki_auth_key
state: query
org_name: your_organization_name
net_name: your_network_name
delegate_to: localhost

 

Make sure to replace your_meraki_auth_key, your_organization_name, and your_network_name with your actual data. This playbook will query and return information about the specified network.

 

For more details and configuration options, you can refer to the official documentation of the cisco.meraki.networks module. Remember that you’ll need to have the cisco.meraki collection installed to use this module. If you haven’t installed it yet, you can do so with the following command:

 

ansible-galaxy collection install cisco.meraki

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.

Hello thank you very much for the information, yes I was just reviewing the following links based on the cisco meraki module:

 

https://docs.ansible.com/ansible/latest/collections/cisco/meraki/meraki_network_module.html#ansible-...

 

Thanks to the playbook that you shared with me, I have a question, the auth_key parameter, having the value of the parameter, communicates directly with the cisco meraki platform?

 

My second question is, running this playbook, it will automatically connect to my cisco meraki?

 

Best regards

Hi, I'm sorry yesterday was a busy day at work. But to answer your question, yes, the auth_key parameter in the Ansible Meraki module is used to authenticate with the Meraki platform. Basically it is the API key that allows Ansible to communicate with the Meraki network.
As for the playbook, it is also yes, when you run the playbook with the correct auth_key Ansible will automatically connect to the Meraki network and perform the tasks defined in the playbook.
 
Maybe this document can help you.
 
 
Hope this helps.
I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.