Giter VIP home page Giter VIP logo

Comments (16)

kbreit avatar kbreit commented on July 24, 2024 1

It is. I pasted their example payload but it does support trunk mode. I'll spend some time on it, hopefully this weekend. Are you able/open to testing it once I get it written?

from ansible-meraki.

kbreit avatar kbreit commented on July 24, 2024 1

This weekend got away from me so I wasn't able to create the module. It's on my short term roadmap though.

from ansible-meraki.

kbreit avatar kbreit commented on July 24, 2024 1

@richardjohnallsopp Absolutely. Please create new issues for each feature.

from ansible-meraki.

kbreit avatar kbreit commented on July 24, 2024

@richardjohnallsopp For the Meraki modules, not today. I'd need to create a new module, which shouldn't be that big of a deal. I did find and endpoint (https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-port). I can submit VLAN information using this data structure. It seems this would be what you're looking for?

{
    "enabled": true,
    "type": "access",
    "dropUntaggedTraffic": false,
    "vlan": 3,
    "accessPolicy": "open"
}

from ansible-meraki.

richardjohnallsopp avatar richardjohnallsopp commented on July 24, 2024

Yes that would be perfect!!!! Thanks so much man this is awesome!!

from ansible-meraki.

richardjohnallsopp avatar richardjohnallsopp commented on July 24, 2024

I don't need this right now, but I think it would be a good idea to support trunk mode too.

from ansible-meraki.

richardjohnallsopp avatar richardjohnallsopp commented on July 24, 2024

@kbreit can I ask if you would like ansible-meraki feature requests and if yes where is the best place to do this?

from ansible-meraki.

kbreit avatar kbreit commented on July 24, 2024

@richardjohnallsopp Please test this module as well.

from ansible-meraki.

richardjohnallsopp avatar richardjohnallsopp commented on July 24, 2024

I'm seeing the following error when running this module:

(tanglewoodgames_meraki) flynn@NCL-WL-16612:~/tanglewoodgames_meraki$ ./configure_mx_home.sh --tags "configure_interfaces" -vvv
ansible-playbook 2.9.7
  config file = /home/flynn/tanglewoodgames_meraki/ansible.cfg
  configured module search path = ['/home/flynn/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/flynn/.local/share/virtualenvs/tanglewoodgames_meraki-agoja1JE/lib/python3.7/site-packages/ansible
  executable location = /home/flynn/.local/share/virtualenvs/tanglewoodgames_meraki-agoja1JE/bin/ansible-playbook
  python version = 3.7.4 (default, Feb 21 2020, 16:42:30) [GCC 7.4.0]
Using /home/flynn/tanglewoodgames_meraki/ansible.cfg as config file
host_list declined parsing /home/flynn/tanglewoodgames_meraki/inventory as it did not pass its verify_file() method
script declined parsing /home/flynn/tanglewoodgames_meraki/inventory as it did not pass its verify_file() method
auto declined parsing /home/flynn/tanglewoodgames_meraki/inventory as it did not pass its verify_file() method
Parsed /home/flynn/tanglewoodgames_meraki/inventory inventory source with ini plugin

PLAYBOOK: deploy_mx.yml ****************************************************************************************************
1 plays in tasks/deploy_mx.yml
Read vars_file '../vault/meraki'
Read vars_file '../vault/ssid_psk'
Read vars_file '../group_vars/{{  user_name  }}.yml'
Read vars_file '../vault/meraki'
Read vars_file '../vault/ssid_psk'
Read vars_file '../group_vars/{{  user_name  }}.yml'
Read vars_file '../vault/meraki'
Read vars_file '../vault/ssid_psk'
Read vars_file '../group_vars/{{  user_name  }}.yml'

PLAY [localhost] ***********************************************************************************************************
Read vars_file '../vault/meraki'
Read vars_file '../vault/ssid_psk'
Read vars_file '../group_vars/{{  user_name  }}.yml'

TASK [Gathering Facts] *****************************************************************************************************
task path: /home/flynn/tanglewoodgames_meraki/tasks/deploy_mx.yml:3
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: flynn
<127.0.0.1> EXEC /bin/sh -c 'echo ~flynn && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/flynn/.ansible/tmp `"&& mkdir /home/flynn/.ansible/tmp/ansible-tmp-1602436212.6303964-2355-126254732838421 && echo ansible-tmp-1602436212.6303964-2355-126254732838421="` echo /home/flynn/.ansible/tmp/ansible-tmp-1602436212.6303964-2355-126254732838421 `" ) && sleep 0'
Using module file /home/flynn/.local/share/virtualenvs/tanglewoodgames_meraki-agoja1JE/lib/python3.7/site-packages/ansible/modules/system/setup.py
<127.0.0.1> PUT /home/flynn/.ansible/tmp/ansible-local-2349q072rfxj/tmp12mj_lbj TO /home/flynn/.ansible/tmp/ansible-tmp-1602436212.6303964-2355-126254732838421/AnsiballZ_setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/flynn/.ansible/tmp/ansible-tmp-1602436212.6303964-2355-126254732838421/ /home/flynn/.ansible/tmp/ansible-tmp-1602436212.6303964-2355-126254732838421/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/flynn/.ansible/tmp/ansible-tmp-1602436212.6303964-2355-126254732838421/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/flynn/.ansible/tmp/ansible-tmp-1602436212.6303964-2355-126254732838421/ > /dev/null 2>&1 && sleep 0'
ok: [127.0.0.1]
META: ran handlers
Read vars_file '../vault/meraki'
Read vars_file '../vault/ssid_psk'
Read vars_file '../group_vars/{{  user_name  }}.yml'
Read vars_file '../vault/meraki'
Read vars_file '../vault/ssid_psk'
Read vars_file '../group_vars/{{  user_name  }}.yml'

TASK [configure interface ports] *******************************************************************************************
task path: /home/flynn/tanglewoodgames_meraki/tasks/deploy_mx.yml:94
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: flynn
<localhost> EXEC /bin/sh -c 'echo ~flynn && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/flynn/.ansible/tmp `"&& mkdir /home/flynn/.ansible/tmp/ansible-tmp-1602436219.8707693-2467-229776088680050 && echo ansible-tmp-1602436219.8707693-2467-229776088680050="` echo /home/flynn/.ansible/tmp/ansible-tmp-1602436219.8707693-2467-229776088680050 `" ) && sleep 0'
Using module file /home/flynn/.ansible/collections/ansible_collections/cisco/meraki/plugins/modules/meraki_mx_l2_interface.py
<localhost> PUT /home/flynn/.ansible/tmp/ansible-local-2349q072rfxj/tmpjpq_kvp_ TO /home/flynn/.ansible/tmp/ansible-tmp-1602436219.8707693-2467-229776088680050/AnsiballZ_meraki_mx_l2_interface.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/flynn/.ansible/tmp/ansible-tmp-1602436219.8707693-2467-229776088680050/ /home/flynn/.ansible/tmp/ansible-tmp-1602436219.8707693-2467-229776088680050/AnsiballZ_meraki_mx_l2_interface.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python3 /home/flynn/.ansible/tmp/ansible-tmp-1602436219.8707693-2467-229776088680050/AnsiballZ_meraki_mx_l2_interface.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /home/flynn/.ansible/tmp/ansible-tmp-1602436219.8707693-2467-229776088680050/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/home/flynn/.ansible/tmp/ansible-tmp-1602436219.8707693-2467-229776088680050/AnsiballZ_meraki_mx_l2_interface.py", line 102, in <module>
    _ansiballz_main()
  File "/home/flynn/.ansible/tmp/ansible-tmp-1602436219.8707693-2467-229776088680050/AnsiballZ_meraki_mx_l2_interface.py", line 94, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/flynn/.ansible/tmp/ansible-tmp-1602436219.8707693-2467-229776088680050/AnsiballZ_meraki_mx_l2_interface.py", line 40, in invoke_module
    runpy.run_module(mod_name='ansible_collections.cisco.meraki.plugins.modules.meraki_mx_l2_interface', init_globals=None, run_name='__main__', alter_sys=True)
  File "/usr/lib/python3.6/runpy.py", line 205, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_meraki_mx_l2_interface_payload_4x66qwo5/ansible_meraki_mx_l2_interface_payload.zip/ansible_collections/cisco/meraki/plugins/modules/meraki_mx_l2_interface.py", line 269, in <module>
  File "/tmp/ansible_meraki_mx_l2_interface_payload_4x66qwo5/ansible_meraki_mx_l2_interface_payload.zip/ansible_collections/cisco/meraki/plugins/modules/meraki_mx_l2_interface.py", line 222, in main
KeyError: 'type'
fatal: [127.0.0.1 -> localhost]: FAILED! => changed=false 
  module_stderr: |-
    Traceback (most recent call last):
      File "/home/flynn/.ansible/tmp/ansible-tmp-1602436219.8707693-2467-229776088680050/AnsiballZ_meraki_mx_l2_interface.py", line 102, in <module>
        _ansiballz_main()
      File "/home/flynn/.ansible/tmp/ansible-tmp-1602436219.8707693-2467-229776088680050/AnsiballZ_meraki_mx_l2_interface.py", line 94, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/home/flynn/.ansible/tmp/ansible-tmp-1602436219.8707693-2467-229776088680050/AnsiballZ_meraki_mx_l2_interface.py", line 40, in invoke_module
        runpy.run_module(mod_name='ansible_collections.cisco.meraki.plugins.modules.meraki_mx_l2_interface', init_globals=None, run_name='__main__', alter_sys=True)
      File "/usr/lib/python3.6/runpy.py", line 205, in run_module
        return _run_module_code(code, init_globals, run_name, mod_spec)
      File "/usr/lib/python3.6/runpy.py", line 96, in _run_module_code
        mod_name, mod_spec, pkg_name, script_name)
      File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "/tmp/ansible_meraki_mx_l2_interface_payload_4x66qwo5/ansible_meraki_mx_l2_interface_payload.zip/ansible_collections/cisco/meraki/plugins/modules/meraki_mx_l2_interface.py", line 269, in <module>
      File "/tmp/ansible_meraki_mx_l2_interface_payload_4x66qwo5/ansible_meraki_mx_l2_interface_payload.zip/ansible_collections/cisco/meraki/plugins/modules/meraki_mx_l2_interface.py", line 222, in main
    KeyError: 'type'
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1

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

from ansible-meraki.

kbreit avatar kbreit commented on July 24, 2024

I made a couple of small changes to the integration tests, code, and documentation based on a parameter rename from type to port_type. Please try to re-download the file and let me know if that fixes it. If not, please post the error and a sanitized task I can use to test.

As a note, Meraki returns type as part of the data structure but Ansible doesn't like parameters called type so I renamed it to port_type. Right now you submit port_type and get a type key back. I may rename the response to be port_type so if you are doing stuff with the responses, it may break when I release.

from ansible-meraki.

kbreit avatar kbreit commented on July 24, 2024

@richardjohnallsopp Were you able to re-test this module?

from ansible-meraki.

richardjohnallsopp avatar richardjohnallsopp commented on July 24, 2024

Hey man I’ll try and get to it this week, but if not I will have time over the weekend. Sorry work has been crazy busy the last few weeks. I won’t forget, I really want these modules.

from ansible-meraki.

kbreit avatar kbreit commented on July 24, 2024

No problem. Just making sure it's on your radar. If they work for you, I could probably turn around a release within a day or two.

from ansible-meraki.

richardjohnallsopp avatar richardjohnallsopp commented on July 24, 2024

This one works great man, I think we're good to go :-)

from ansible-meraki.

kbreit avatar kbreit commented on July 24, 2024

@richardjohnallsopp I'm closing this issue as I've merged the module. I'm going to do a 2.1.0 (I think?) release today. If you're not watching this repository, click "Watch" at the top of the repo and you should be notified for releases.

from ansible-meraki.

richardjohnallsopp avatar richardjohnallsopp commented on July 24, 2024

I've downloaded latest and tested it works great thanks again man!!!

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.