Giter VIP home page Giter VIP logo

Comments (26)

richardjohnallsopp avatar richardjohnallsopp commented on July 4, 2024

Also I'm happy to help you test these and anything else you may need testing.

from ansible-meraki.

kbreit avatar kbreit commented on July 4, 2024

I already have some license functionality in one of the modules, I think meraki_device. But it should have its own module. One challenge will be testing both types of licenses.

from ansible-meraki.

richardjohnallsopp avatar richardjohnallsopp commented on July 4, 2024

I could probably help with that as I have access to several large Meraki deployments which I manage using ansible-meraki.

from ansible-meraki.

kbreit avatar kbreit commented on July 4, 2024

I'll let you know when it's ready. I suspect this will be the hardest of the modules to write so I'm saving it for last.

I also need to figure out how to handle licenses for integration tests.

from ansible-meraki.

kbreit avatar kbreit commented on July 4, 2024

@richardjohnallsopp Are your organizations using organization-wide licenses or the Per-Device License (PDL) model? These endpoints seem to focus on PDL and they don't seem to work on the organization-wide/legacy model.

from ansible-meraki.

richardjohnallsopp avatar richardjohnallsopp commented on July 4, 2024

Ah well that sucks as yeah most if not all of mine use Org wide licenses :-(

from ansible-meraki.

kbreit avatar kbreit commented on July 4, 2024

To address your requirements.

  • Moving licenses between organizations is a feature of the PDL structure.
  • Claiming licenses seems to be reasonable. It existed in API v0 but I never tested it. Submit a feature with the Make a Wish button.

from ansible-meraki.

richardjohnallsopp avatar richardjohnallsopp commented on July 4, 2024

I've submitted a feature request for this bud.

from ansible-meraki.

richardjohnallsopp avatar richardjohnallsopp commented on July 4, 2024

Do you know if there is a way to automate the management IP of a MS appliance, or more specifically the vlan ID?

image

It's a little annoying, I can automate the full network stack, but the switch just gets an IP from a random DHCP server accessible on the trunked uplink port (so long as the trunked port is native vlan one). Then I have to manually set the vlan ID on this virtual management interface. I can set the native vlan on the trunk port to be the vlan I want the switch to pull an IP from, but the upstream device doesn't support native vlans on trunked interfaces so it creates an miss match between the switch and the SDWAN appliance (not Meraki).

from ansible-meraki.

kbreit avatar kbreit commented on July 4, 2024

@richardjohnallsopp Look at the meraki_management_interface module. At first glance it supports only MX but I'm told it supports MX/MR/MS. How wan1/wan2 relate to MS or MR I don't know, but this should get you there. If there's new functionality you need (ex. VLAN) please create a new issue and I'll fix.

from ansible-meraki.

richardjohnallsopp avatar richardjohnallsopp commented on July 4, 2024

@kbreit yeah I did look at that module but for the life of me I couldn't see how the WAN interfaces translate to the MS interfaces and the Meraki API documentation is lacking somewhat. I shall dig it and see if I can get it to work :-)

from ansible-meraki.

kbreit avatar kbreit commented on July 4, 2024

Let me know what you find. I can make other modules with more sane parameters if needed.

from ansible-meraki.

richardjohnallsopp avatar richardjohnallsopp commented on July 4, 2024

It only works for MX devices
Enable or disable the interface (only for MX devices). Valid values are 'enabled', 'disabled', and 'not configured'.

What's super annoying is that you can query the management interface on a switch, but you can't set it.

    - name: set vlan on management information
      meraki_management_interface:
        auth_key: "{{ auth_key }}"
        org_name: "{{  org_name  }}"
        net_name: "{{  network_name  }}"
        state: "present"
        serial: "{{  ms_serial  }}"
        wan1:
          wan_enabled: "enabled"
          using_static_ip: false
          vlan: "30"
      delegate_to: localhost
      register: man_info
      tags:
        - "query_man"
        - "setup_switch"        

    - name: query management information
      meraki_management_interface:
        auth_key: "{{ auth_key }}"
        org_name: "{{  org_name  }}"
        net_name: "{{  network_name  }}"
        state: "query"
        serial: "{{  ms_serial  }}"
      delegate_to: localhost
      register: man_info
      tags:
        - "query_man"
        - "setup_switch"

    - debug: msg="{{  man_info  }}"
      tags:
        - "query_man"

Output

TASK [set vlan on management information] ***************************************************************************************************************
fatal: [localhost -> localhost]: FAILED! => changed=false 
  msg: 'Unsupported parameters for (meraki_management_interface) module: man1 Supported parameters include: auth_key, host, internal_error_retry_time, net_id, net_name, org_id, org_name, output_format, output_level, rate_limit_retry_time, serial, state, timeout, use_https, use_proxy, validate_certs, wan1, wan2'

PLAY RECAP **********************************************************************************************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

(ansible-silverpeak) flynn@NCL-WL-16612:~/ansible-silverpeak/ansible$ ./configure_meraki_switch.sh -e site_code="f-pascu" --tags "query_man"

PLAY [all] **********************************************************************************************************************************************

TASK [set vlan on management information] ***************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: 'NoneType' object is not subscriptable
fatal: [localhost -> localhost]: FAILED! => changed=false 
  module_stderr: |-
    Traceback (most recent call last):
      File "/home/flynn/.ansible/tmp/ansible-tmp-1604013886.165115-173013334994219/AnsiballZ_meraki_management_interface.py", line 102, in <module>
        _ansiballz_main()
      File "/home/flynn/.ansible/tmp/ansible-tmp-1604013886.165115-173013334994219/AnsiballZ_meraki_management_interface.py", line 94, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/home/flynn/.ansible/tmp/ansible-tmp-1604013886.165115-173013334994219/AnsiballZ_meraki_management_interface.py", line 40, in invoke_module
        runpy.run_module(mod_name='ansible_collections.cisco.meraki.plugins.modules.meraki_management_interface', init_globals=None, run_name='__main__', alter_sys=False)
      File "/home/flynn/.pyenv/versions/3.7.4/lib/python3.7/runpy.py", line 208, in run_module
        return _run_code(code, {}, init_globals, run_name, mod_spec)
      File "/home/flynn/.pyenv/versions/3.7.4/lib/python3.7/runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "/tmp/ansible_meraki_management_interface_payload_3u_uwcj4/ansible_meraki_management_interface_payload.zip/ansible_collections/cisco/meraki/plugins/modules/meraki_management_interface.py", line 369, in <module>
      File "/tmp/ansible_meraki_management_interface_payload_3u_uwcj4/ansible_meraki_management_interface_payload.zip/ansible_collections/cisco/meraki/plugins/modules/meraki_management_interface.py", line 356, in main
    TypeError: 'NoneType' object is not subscriptable
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1

Query output

TASK [query management information] *********************************************************************************************************************
ok: [localhost -> localhost]

TASK [debug] ********************************************************************************************************************************************
ok: [localhost] => 
  msg:
    changed: false
    data:
      wan1:
        using_static_ip: false
        vlan: 30
    failed: false
    response: OK (unknown bytes)
    status: 200

I feel like it would be so easy for them to enable it for switches too.

from ansible-meraki.

kbreit avatar kbreit commented on July 4, 2024

Thanks for letting me know. I'm asking about it.

from ansible-meraki.

kbreit avatar kbreit commented on July 4, 2024

@richardjohnallsopp I was able to get this to work using Paw and issuing raw requests to the API. I'll look into the module as I may need to adapt it.

from ansible-meraki.

richardjohnallsopp avatar richardjohnallsopp commented on July 4, 2024

Awesome, looking forward to testing :-)

from ansible-meraki.

kbreit avatar kbreit commented on July 4, 2024

Are you able to create a new issue for the management interface problems?

from ansible-meraki.

richardjohnallsopp avatar richardjohnallsopp commented on July 4, 2024

Sure

from ansible-meraki.

ianvalero avatar ianvalero commented on July 4, 2024

Hello, is there any module available to work with meraki licenses?
I need to list the available licenses and be able to assign a license to a computer.

Utilizo la version 2.9 de ansible

from ansible-meraki.

richardjohnallsopp avatar richardjohnallsopp commented on July 4, 2024

What do you mean assign a licenses to a computer?

There is an API v1 endpoint for claiming licenses into an Org but there are no Meraki Ansible modules using it https://developer.cisco.com/meraki/api-v1/#!claim-into-organization you could of course use Ansible's URI module to call the Endpoint which would be pretty straightforward.

from ansible-meraki.

ianvalero avatar ianvalero commented on July 4, 2024

I need to use the following endpoints in Ansible
https://developer.cisco.com/meraki/api-v1/#!get-organization-licenses
https://developer.cisco.com/meraki/api-v1/#!update-organization-license

I have been looking for information in the official Ansible documentation for meraki but there is nothing about this topic

from ansible-meraki.

kbreit avatar kbreit commented on July 4, 2024

As commented in this thread I've been interested in a licensing module but haven't done it. I have a lot of PTO coming up so I hope to tackle it. For now though you'll want to use the uri module.

from ansible-meraki.

kbreit avatar kbreit commented on July 4, 2024

I want to confirm you're using org licenses (probably) and not per device licenses.

from ansible-meraki.

ianvalero avatar ianvalero commented on July 4, 2024

I am working with one license per device

from ansible-meraki.

kbreit avatar kbreit commented on July 4, 2024

Technically every device has a license. Do you mean you're using their newer per device license model?

from ansible-meraki.

kbreit avatar kbreit commented on July 4, 2024

Take a look at https://documentation.meraki.com/General_Administration/Licensing/Meraki_Licensing for more information on the options. The endpoints probably don't support both.

from ansible-meraki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.