Giter Site home page Giter Site logo

Comments (12)

IPvSean avatar IPvSean commented on July 20, 2024

which version of ansible? (cut and paste ansible --version), and what version of IOS? (do a show version)

from ansible_inventory_report.

hoyeunglee avatar hoyeunglee commented on July 20, 2024

ansible 2.7.1

from ansible_inventory_report.

hoyeunglee avatar hoyeunglee commented on July 20, 2024

i ask here too
ansible/ansible#47836

from ansible_inventory_report.

IPvSean avatar IPvSean commented on July 20, 2024

can you git pull the latest, there was just a PR in here to switch to network_cli. The error you have on ansible/ansible#47836 is about jinja2 installing... that doesn't make sense to me.

after you update the git repo, can you re-run with -vvvv and paste the output?

can I also see your inventory?

from ansible_inventory_report.

hoyeunglee avatar hoyeunglee commented on July 20, 2024
[Testdevices]
noc01as01
c0101as01

[Testdevices:vars]
ansible_network_os=ios

i change to Testdevices , still error,

i use other script can get config, but i guess this script error due to template
may not have hostvars[network_switch] or other variables

martin@ubuntu:/etc/ansible$ ansible -m ios_facts -u martinlee -k noc01as01
SSH password:
noc01as01 | FAILED! => {
"changed": false,
"msg": "Connection type ssh is not valid for this module"
}

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="css/main.css">
</head>
<body>
<table>
    <thead>
        <tr>
            <th>Hostname</th>
            <th>Model Type</th>
            <th>Serial Number</th>
        </tr>
    </thead>
    <tbody>
{% for network_switch in groups['Testdevices'] %}
        <tr>
            <td>{{hostvars[network_switch]['ansible_net_hostname']}}</td>
            <td>{{hostvars[network_switch]['ansible_net_model']}}</td>
            <td>{{hostvars[network_switch]['ansible_net_serialnum']}}</td>
        </tr>
{% endfor %}
    </tbody>
</table>

</body>
</html>

TASK [gathering IOS XE facts] **************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ValueError: No JSON object could be decoded
fatal: [c0101as01]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/home/martin/.ansible/tmp/ansible-tmp-1541059761.13-131561984825353/AnsiballZ_ios_facts.py\", line 113, in <module>\n    _ansiballz_main()\n  File \"/home/martin/.ansible/tmp/ansible-tmp-1541059761.13-131561984825353/AnsiballZ_ios_facts.py\", line 105, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/martin/.ansible/tmp/ansible-tmp-1541059761.13-131561984825353/AnsiballZ_ios_facts.py\", line 48, in invoke_module\n    imp.load_module('__main__', mod, module, MOD_DESC)\n  File \"/tmp/ansible_ios_facts_payload_rTPxya/__main__.py\", line 543, in <module>\n  File \"/tmp/ansible_ios_facts_payload_rTPxya/__main__.py\", line 529, in main\n  File \"/tmp/ansible_ios_facts_payload_rTPxya/__main__.py\", line 228, in populate\n  File \"/tmp/ansible_ios_facts_payload_rTPxya/__main__.py\", line 164, in populate\n  File \"/tmp/ansible_ios_facts_payload_rTPxya/ansible_ios_facts_payload.zip/ansible/module_utils/network/ios/ios.py\", line 135, in run_commands\n  File \"/tmp/ansible_ios_facts_payload_rTPxya/ansible_ios_facts_payload.zip/ansible/module_utils/connection.py\", line 167, in __rpc__\n  File \"/tmp/ansible_ios_facts_payload_rTPxya/ansible_ios_facts_payload.zip/ansible/module_utils/connection.py\", line 146, in _exec_jsonrpc\n  File \"/usr/lib/python2.7/json/__init__.py\", line 339, in loads\n    return _default_decoder.decode(s)\n  File \"/usr/lib/python2.7/json/decoder.py\", line 364, in decode\n    obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n  File \"/usr/lib/python2.7/json/decoder.py\", line 382, in raw_decode\n    raise ValueError(\"No JSON object could be decoded\")\nValueError: No JSON object could be decoded\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ValueError: No JSON object could be decoded
fatal: [noc01as01]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/home/martin/.ansible/tmp/ansible-tmp-1541059761.13-127531505657203/AnsiballZ_ios_facts.py\", line 113, in <module>\n    _ansiballz_main()\n  File \"/home/martin/.ansible/tmp/ansible-tmp-1541059761.13-127531505657203/AnsiballZ_ios_facts.py\", line 105, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/martin/.ansible/tmp/ansible-tmp-1541059761.13-127531505657203/AnsiballZ_ios_facts.py\", line 48, in invoke_module\n    imp.load_module('__main__', mod, module, MOD_DESC)\n  File \"/tmp/ansible_ios_facts_payload_IgBMVP/__main__.py\", line 543, in <module>\n  File \"/tmp/ansible_ios_facts_payload_IgBMVP/__main__.py\", line 529, in main\n  File \"/tmp/ansible_ios_facts_payload_IgBMVP/__main__.py\", line 228, in populate\n  File \"/tmp/ansible_ios_facts_payload_IgBMVP/__main__.py\", line 164, in populate\n  File \"/tmp/ansible_ios_facts_payload_IgBMVP/ansible_ios_facts_payload.zip/ansible/module_utils/network/ios/ios.py\", line 135, in run_commands\n  File \"/tmp/ansible_ios_facts_payload_IgBMVP/ansible_ios_facts_payload.zip/ansible/module_utils/connection.py\", line 167, in __rpc__\n  File \"/tmp/ansible_ios_facts_payload_IgBMVP/ansible_ios_facts_payload.zip/ansible/module_utils/connection.py\", line 146, in _exec_jsonrpc\n  File \"/usr/lib/python2.7/json/__init__.py\", line 339, in loads\n    return _default_decoder.decode(s)\n  File \"/usr/lib/python2.7/json/decoder.py\", line 364, in decode\n    obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n  File \"/usr/lib/python2.7/json/decoder.py\", line 382, in raw_decode\n    raise ValueError(\"No JSON object could be decoded\")\nValueError: No JSON object could be decoded\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}


from ansible_inventory_report.

IPvSean avatar IPvSean commented on July 20, 2024

change this->

martin@ubuntu:/etc/ansible$ ansible -m ios_facts -u martinlee -k noc01as01

to

martin@ubuntu:/etc/ansible$ ansible -m ios_facts -u martinlee -k noc01as01 -c network_cli

from ansible_inventory_report.

hoyeunglee avatar hoyeunglee commented on July 20, 2024

martin@ubuntu:/etc/ansible$ ansible -m ios_facts -u martinlee -k noc01as01 -c network_cli
SSH password:
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ValueError: No JSON object could be decoded
noc01as01 | FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File "/home/martin/.ansible/tmp/ansible-local-2395_beMfx/ansible-tmp-1541118182.69-119543614930279/AnsiballZ_ios_facts.py", line 113, in \n _ansiballz_main()\n File "/home/martin/.ansible/tmp/ansible-local-2395_beMfx/ansible-tmp-1541118182.69-119543614930279/AnsiballZ_ios_facts.py", line 105, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/home/martin/.ansible/tmp/ansible-local-2395_beMfx/ansible-tmp-1541118182.69-119543614930279/AnsiballZ_ios_facts.py", line 48, in invoke_module\n imp.load_module('main', mod, module, MOD_DESC)\n File "/tmp/ansible_ios_facts_payload_w7ex2y/main.py", line 543, in \n File "/tmp/ansible_ios_facts_payload_w7ex2y/main.py", line 529, in main\n File "/tmp/ansible_ios_facts_payload_w7ex2y/main.py", line 228, in populate\n File "/tmp/ansible_ios_facts_payload_w7ex2y/main.py", line 164, in populate\n File "/tmp/ansible_ios_facts_payload_w7ex2y/ansible_ios_facts_payload.zip/ansible/module_utils/network/ios/ios.py", line 135, in run_commands\n File "/tmp/ansible_ios_facts_payload_w7ex2y/ansible_ios_facts_payload.zip/ansible/module_utils/connection.py", line 167, in rpc\n File "/tmp/ansible_ios_facts_payload_w7ex2y/ansible_ios_facts_payload.zip/ansible/module_utils/connection.py", line 146, in _exec_jsonrpc\n File "/usr/lib/python2.7/json/init.py", line 339, in loads\n return _default_decoder.decode(s)\n File "/usr/lib/python2.7/json/decoder.py", line 364, in decode\n obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode\n raise ValueError("No JSON object could be decoded")\nValueError: No JSON object could be decoded\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}

from ansible_inventory_report.

IPvSean avatar IPvSean commented on July 20, 2024

this has got to be a bad install, uninstall ansible and reinstall

from ansible_inventory_report.

hoyeunglee avatar hoyeunglee commented on July 20, 2024

I use apt get install , not the link of ansible tower, Is apt get install a correct install?

I prepare apt get uninstall and install

from ansible_inventory_report.

hoyeunglee avatar hoyeunglee commented on July 20, 2024

i apt-get remove ansible and apt-get install ansible again, still have error

from ansible_inventory_report.

IPvSean avatar IPvSean commented on July 20, 2024

this is not a project problem, this is a user error installing ansible

from ansible_inventory_report.

hoyeunglee avatar hoyeunglee commented on July 20, 2024

I uninstall version 2.7.1 and install 2.6 then works and thanks

from ansible_inventory_report.

Related Issues (5)

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.