failed - "rc": 127 - stderr not found

1,219 views
Skip to first unread message

Tobias Mälzer

unread,
Sep 1, 2017, 3:50:41 AM9/1/17
to Ansible Project
Hi everybody,

I'm working on getting my hands on ansible to use it for network automation purposes. I've a problem with a first simple script which is issuing a show command on a switch.

I've to hosts defined in my hosts file /etc/ansible/hosts:

[...]
[nxos]
10.20.5.26
10.20.5.27
[...]

Now I have this simple playbook:

---
- name: Execute show version on NX-OS Devices
  hosts: nxos
  gather_facts: no
  tasks:
  - raw: "show version"

When I test my playbook I'm getting the following error:

ansible-playbook playbooks/show_version.yml -vvv

PLAY [Execute show version on NX-OS Devices] **********************************

TASK: [raw show version] ******************************************************
<10.20.5.26> EXEC show version
failed: [10.20.5.26] => {"rc": 127}
stderr: /bin/sh: 1: show: not found

<10.20.5.27> EXEC show version
failed: [10.20.5.27] => {"rc": 127}
stderr: /bin/sh: 1: show: not found


FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
           to retry, use: --limit @/root/show_version.retry

10.20.5.26                 : ok=0    changed=0    unreachable=0    failed=1
10.20.5.27                 : ok=0    changed=0    unreachable=0    failed=1

This playbook was working perfect on Debian 9 and Ansible 2.2 or 2.3. Now I'm testing this on Ansible 1.7.2, Debian 7 and Python 2.7.3.

It's looking like Ansible isn't able to connect to the networking devices because it doesn't try to connect via SSH. Iwas looking through the internet for some help but only found things like change your /bin/bash in ansible.cfg file but this won't help me as I need to find out why Ansible isn't able to get to the networking devices.

Thanks in advance.

Tobias

Dick Visser

unread,
Sep 1, 2017, 5:24:47 AM9/1/17
to ansible...@googlegroups.com
Ansible 1.7.2 at the time (2014) was about one year old.
Since then another three years of development have gone into the code.
Especially the networking area saw a huge amount of changes.
So while you might get this to work, I'm sure you'll run into many
other issues after that.

Of course it all depends on how much you're stuck with having to use
1.7.2, but instead of getting that to work, I'd spend my energy on
finding a way to run a recent release.


Dick
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/37f4ae9f-1cd4-4255-a056-67d439c1ec01%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Dick Visser
GÉANT

Want to join us? We're hiring: https://www.geant.org/jobs
Message has been deleted

Tobias Mälzer

unread,
Sep 1, 2017, 5:44:38 AM9/1/17
to Ansible Project
Hi Dick,

thanks for your reply. Yeah I know but I thought I just ask about this here, maybe someone has run into this and is aware of a fast solution.

Cheers
Reply all
Reply to author
Forward
0 new messages