Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added pause attribute to the aci_config_rollback #8

Closed
aciguru opened this issue Apr 9, 2020 · 3 comments · Fixed by #450
Closed

added pause attribute to the aci_config_rollback #8

aciguru opened this issue Apr 9, 2020 · 3 comments · Fixed by #450
Assignees
Labels
enhancement New feature or request has_pr

Comments

@aciguru
Copy link
Contributor

aciguru commented Apr 9, 2020

SUMMARY

ISSUE OPENER nkatarmal-crest

ISSUE LINK ansible/ansible#67773

ISSUE TYPE
Added a pause attribute to the aci_config_rollback.

Feature Pull Request

COMPONENT NAME
aci_config_rollback

ADDITIONAL INFORMATION
Linked to #16

@sstotko
Copy link

sstotko commented Feb 14, 2023

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.

@shrsr
Copy link
Collaborator

shrsr commented Feb 14, 2023

@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?

@sstotko
Copy link

sstotko commented Feb 15, 2023

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request has_pr
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants