Coder Social home page Coder Social logo

Comments (3)

sstotko avatar sstotko commented on May 30, 2024

I just tested this with the "pause" attribute from the ansible:devel branch but I still get the same error (the pause isn't included in the latest collection 2.4.0).
The result is the same with cisco.aci.aci_config_rollback from thew 2.4.0 collection and the ansible:devel branch.

ACI Version:
5.2.4e

$ ansible --version
ansible [core 2.13.7]
  config file = None
  configured module search path = ['/home/username/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
  ansible collection location = /home/username/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.8.10 (default, Nov 14 2022, 12:59:47) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True
  
 $ ansible-galaxy collection list cisco.aci

# /usr/share/ansible/collections/ansible_collections

Collection Version
---------- -------
cisco.aci  2.4.0

RESULT:

Traceback (most recent call last):
  File "/home/username/.ansible/tmp/ansible-tmp-1676380792.8544614-2020862-167128307661459/AnsiballZ_aci_config_rollback.py", line 107, in <module>
    _ansiballz_main()
  File "/home/username/.ansible/tmp/ansible-tmp-1676380792.8544614-2020862-167128307661459/AnsiballZ_aci_config_rollback.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/username/.ansible/tmp/ansible-tmp-1676380792.8544614-2020862-167128307661459/AnsiballZ_aci_config_rollback.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.cisco.aci.plugins.modules.aci_config_rollback', init_globals=dict(_module_fqn='ansible_collections.cisco.aci.plugins.modules.aci_config_rollback', _modlib_path=modlib_path),
  File "/usr/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_cisco.aci.aci_config_rollback_payload_48qj2d0e/ansible_cisco.aci.aci_config_rollback_payload.zip/ansible_collections/cisco/aci/plugins/modules/aci_config_rollback.py", line 324, in <module>
  File "/tmp/ansible_cisco.aci.aci_config_rollback_payload_48qj2d0e/ansible_cisco.aci.aci_config_rollback_payload.zip/ansible_collections/cisco/aci/plugins/modules/aci_config_rollback.py", line 286, in main
  File "/tmp/ansible_cisco.aci.aci_config_rollback_payload_48qj2d0e/ansible_cisco.aci.aci_config_rollback_payload.zip/ansible_collections/cisco/aci/plugins/modules/aci_config_rollback.py", line 307, in get_preview
AttributeError: 'NoneType' object has no attribute 'read'
fatal: [apick001.net.muenchen.de -> localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/home/username/.ansible/tmp/ansible-tmp-1676380792.8544614-2020862-167128307661459/AnsiballZ_aci_config_rollback.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/username/.ansible/tmp/ansible-tmp-1676380792.8544614-2020862-167128307661459/AnsiballZ_aci_config_rollback.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/username/.ansible/tmp/ansible-tmp-1676380792.8544614-2020862-167128307661459/AnsiballZ_aci_config_rollback.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.cisco.aci.plugins.modules.aci_config_rollback', init_globals=dict(_module_fqn='ansible_collections.cisco.aci.plugins.modules.aci_config_rollback', _modlib_path=modlib_path),\n  File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_cisco.aci.aci_config_rollback_payload_48qj2d0e/ansible_cisco.aci.aci_config_rollback_payload.zip/ansible_collections/cisco/aci/plugins/modules/aci_config_rollback.py\", line 324, in <module>\n  File \"/tmp/ansible_cisco.aci.aci_config_rollback_payload_48qj2d0e/ansible_cisco.aci.aci_config_rollback_payload.zip/ansible_collections/cisco/aci/plugins/modules/aci_config_rollback.py\", line 286, in main\n  File \"/tmp/ansible_cisco.aci.aci_config_rollback_payload_48qj2d0e/ansible_cisco.aci.aci_config_rollback_payload.zip/ansible_collections/cisco/aci/plugins/modules/aci_config_rollback.py\", line 307, in get_preview\nAttributeError: 'NoneType' object has no attribute 'read'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

Running the request directly on the APIC works:

apick003# icurl -sg 'http://localhost:7777/mqapi2/snapshots.diff.xml?s1dn=uni/backupst/snapshots-[uni/fabric/configexp-ansible_snapshot]/snapshot-run-2023-02-14T07-53-22&s2dn=uni/backupst/snapshots-[uni/fabric/configexp-ansible_snapshot]/snapshot-run-2023-02-14T07-54-29'
<?xml version="1.0" encoding="UTF-8"?><polUni rn="uni" status="" userdom="all">
...

This takes 4-5 seconds to complete but yields a result.

It would be great if this worked with the module.

from ansible-aci.

shrsr avatar shrsr commented on May 30, 2024

@sstotko I just ran the module against a configuration we use for the test and it passed.
Can you please share the playbook with minimal configuration which is failing for you?

from ansible-aci.

sstotko avatar sstotko commented on May 30, 2024

@shrsr I'm calling a role with the following task (copied from the examples):

    - name: DEBUG Compare Snapshot Files
      cisco.aci.aci_config_rollback:
        hostname: "{{ inventory_hostname }}"
        username: "{{ APIC_USER }}"
        certificate_name: "{{ APIC_USER }}"
        private_key: ./local_user/ansible.key
        validate_certs: yes
        export_policy: ansible_snapshot
        snapshot: run-2023-02-14T07-53-22
        compare_export_policy: ansible_snapshot
        compare_snapshot: run-2023-02-14T07-54-29
        state: preview
      delegate_to: localhost

from ansible-aci.

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.