SFTP and SCP issues from ansible ubuntu to cisco ios 15.0

Good day good peoplem
I am doing my labs on EVE-NG and its the time to practice what i have studied, This is the error I am getting when trying to use a ping module. I am sure there will be more errors, or there is more deadly errors in my system, but for now I want to sort out this SFTP and SCP error. I believe the first issue is, my images are old.
Would someone please guide on how to fix this, I an running ubuntu on VMWARE.

I have added few pics, where i can ssh directly to the ios and i can ping the eve-ng vm running these cisco devices

Thanks in advance.

In case my pics are not uploaded I have copied errors I’m getting:

Hosts

[Routers]
R-1 ansible_host=192.168.126.130 ansible_python_interpreter=/usr/bin/python3
R-2 ansible_host=192.168.126.132 ansible_python_interpreter=/usr/bin/python3
R-3 ansible_host=192.168.126.131 ansible_python_interpreter=/usr/bin/python3
R-5 ansible_host=192.168.126.136 ansible_python_interpreter=/usr/bin/python3

[Eveng]
eve-ng ansible_host=192.168.126.129 ansible_python_interpreter=/usr/bin/python3
saul@bipa:/etc/ansible$

nornal ssh

saul@bipa:/etc/ansible$ ssh admin@192.168.126.130


  • IOSv is strictly limited to use for evaluation, demonstration and IOS *
  • education. IOSv is provided as-is and is not supported by Cisco’s *
  • Technical Advisory Center. Any use or disclosure, in whole or in part, *
  • of the IOSv Software or Documentation to any third party for any *
  • purposes is expressly prohibited except as otherwise authorized by *
  • Cisco in writing. *
    (admin@192.168.126.130) Password: ****************************************

  • IOSv is strictly limited to use for evaluation, demonstration and IOS *
  • education. IOSv is provided as-is and is not supported by Cisco’s *
  • Technical Advisory Center. Any use or disclosure, in whole or in part, *
  • of the IOSv Software or Documentation to any third party for any *
  • purposes is expressly prohibited except as otherwise authorized by *
  • Cisco in writing. *

R-1>

ansible ping module
[WARNING]: sftp transfer mechanism failed on [192.168.126.130]. Use
ANSIBLE_DEBUG=1 to see detailed information
[WARNING]: scp transfer mechanism failed on [192.168.126.130]. Use
ANSIBLE_DEBUG=1 to see detailed information
R-1 | FAILED! => {
“changed”: false,
“module_stderr”: “\r\n**************************************************************************\r\n* IOSv is strictly limited to use for evaluation, demonstration and IOS \r\n education. IOSv is provided as-is and is not supported by Cisco’s \r\n Technical Advisory Center. Any use or disclosure, in whole or in part, \r\n of the IOSv Software or Documentation to any third party for any \r\n purposes is expressly prohibited except as otherwise authorized by \r\n Cisco in writing. *\r\n**************************************************************************Shared connection to 192.168.126.130 closed.\r\n”,
“module_stdout”: “\r\nLine has invalid autocommand "/bin/sh -c ‘/usr/bin/python3 ‘"’"‘Line has invalid autocommand "/bin/sh -c ‘"’"’"’"‘"’"‘"’"‘( umask 77 && mkdir -p "` echo Line has invalid autocommand "/bin/sh -c ‘"’"’"‘"’"‘"’"‘"’"‘"’"‘"’"‘"’"‘"’"‘"’"‘"’"‘"’"‘"’"‘"‘echo ~admin && sleep 0’"’"‘"’"‘"’"‘"’""”,
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,
“rc”: 0

Just because you’re running EVE-NG on VMware vSphere / ESXi this doesn’t make it a VMWARE problem. So please don’t tag it like this.

Anyway, isn’t this more or less the same question you’ve already asked in SFTP and SCP errors when trying to ping my cisco IOSv on Eve-NG? At least, it looks related… maybe I’m wrong, but if I’m right: Please don’t clutter the forum with opening several threads on the same issue :folded_hands:

I googled “line has invalid autocommand” and the first two results show that for IOS devices, you need to set additional variables/use specific IOS modules when possible.
Try setting

ansible_connection=network_cli
ansible_network_os=ios
ansible_port=22

For future issues, you will get more responses if you follow Mario’s advice (and format your posts using code blocks with three back ticks ```)

Thanks Mariolenz for your answer, The reasons you see vmware in my issuem is because i needed to be as clear and put everything on the table incase I am missing something and not blaming vmware, How can i blame something that I am looking for help on? I was just stating what I have and what errors I am getting, Please understand rather.
and yes, the link you copied is also me, and is the same issue.

Hi Mikemorencym

I will look into it, I am not sure if those vars should be added to cfg file, or playbook itself, My issue is far from playbook, I am just testing my connectivity, I had ssh issues, and they are being cleared step by step, Now, I am stuck here, which i cannot seem to get around. I will get to the bottom of this.
Thanks once again
Saul

No problem there, giving as much information as possible is a good thing. This helps people to help you.

But IIRC you’ve used the vmware tag (which I have removed). The problem here is not that I’m saying you’re blaming VMware, but that people are watching this tag to help people who have problems with VMware. If they see too many threads tagged vmware just because the problem turns up in a VM that’s running on VMware, they might stop watching this tag because there are too many false positives. And this would be bad for people looking for help on problems that are really VMware related. Your problem doesn’t look like it is.

I hope someone can help you with your problem!

Thank you for the clarification.
I didn’t recognise that I tagged em.
Thanks.

1 Like

@mariolenz @ssbipa6 the vmware tag might have been an automated one due to the parent post mentioning it.

You will notice some topics get tagged automatically, this was setup when the forum went live to ease the pain of classifying each thread manually. @mariolenz if you think this is causing issues with too many false positives for vmware we can revisit that decision.

2 Likes

If the tag has been added automatically, I think I have to apologize. Sorry @ssbipa6!

At the end of the day, I just want to avoid having too many threads tagged with vmware just because the question is about something that happens to run on VMware vSphere but isn’t related to virtualization. This might discourage people to watch this tag and help others with issues that really are related to VMware.

I don’t have any data on how often false ppositives happen. Just wanted to raise awareness to this.

2 Likes

Thanks mariolenz. I have learnt something.

You are right in calling it out, thank you for that. And vmware might be more prone than other keywords to cause false positives, as it’s probably added most of the time as “context”. If you notice there is a bad ratio of false positives, let us know and we can remove the autotag

1 Like