WendellOdom / devnet-ansible-01

Used for a DevNet Learning Lab about Ansible.
0 stars 6 forks source link

ansible-playbook test-to-sandbox.yml -i my-inventory #3

Open sar2015 opened 5 years ago

sar2015 commented 5 years ago

Trying to compare results of the playbook with CLI commands for cisco DevNet IOS XE Router. This only for Lab purpose. Please let me know if there are any known bugs with this or something i might be missing on my site. ansible 2.8.1 /devnet/AN01/venv/lib/python2.7/site-packages/ansible Please help me to fix this issue with step by step Thanks Sar2018

Please see below output

(venv) [devnet@CentOS7 devnet-ansible-01]$ ansible-playbook test-to-sandbox.yml -i my-inventory

PLAY [Get IOS Facts from a Cisco IOS or XE router.] **

TASK [Gathering Facts] *** fatal: [sandbox1]: FAILED! => {"ansible_facts": {}, "changed": false, "msg": "The following modules failed to execute: setup\n setup: The module failed to execute correctly, you probably need to set the interpreter.\nSee stdout/stderr for the exact error\n"}

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

annegentle commented 4 years ago

I think this error could be caused by the ansible_python_interpreter= line in the my-inventory file. Could you try this?

  1. Run which python.
  2. Copy the output from which python, such as /home/agentle/AN01/venv/bin/python.
  3. Open the my-inventory file and paste the output into the ansible_python_interpreter=, such as ansible_python_interpreter="/Users/agentle/src/AN01/venv/bin/python".
  4. Run the ansible-playbook test-to-sandbox.yml -i my-inventory again and hopefully it'll work this time.