mirror of
https://github.com/ovh/the-bastion.git
synced 2026-05-09 16:35:33 +02:00
[GH-ISSUE #254] Cisco IOS supported? #69
Labels
No labels
answered
bug
documentation
enhancement
enhancement
feature
feature
kept-open-for-info
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/the-bastion#69
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dwydler on GitHub (Oct 15, 2021).
Original GitHub issue: https://github.com/ovh/the-bastion/issues/254
Hi Guys,
we use The Bastion in combination with Ansible via the Ansible Wrapper extension. Not only for administration but also to distribute configurations (e.g. SNMP). This works fine in combination with Debian and Ubuntu Server.
We are currently trying to do the same with Cisco Catalyst devices (IOS). We have set up a very simple example for testing.
This is our Inventory:
This this our playbook:
This this our group_vars:
This is our displayed error output:
Ansible version:
Can someone give me a push on what I'm doing wrong?
@speed47 commented on GitHub (Oct 20, 2021):
Hello,
Can you run it with
-vvv? Ansible should dump way more info that should help pinpoint the problem@speed47 commented on GitHub (Oct 20, 2021):
Btw, yes Cisco IOS is supported: we have workflows that use it daily on thousands of devices, however I think nobody tested the combo Ansible + Cisco IOS yes. However I don't see any reason as to why it wouldn't work.
@dwydler commented on GitHub (Oct 20, 2021):
Which tool do you use for the workflow, puppet?
@speed47 commented on GitHub (Oct 21, 2021):
No, as Puppet has a reverse workflow logic compared to Ansible: the puppet agent installed on the host pulls data from the puppet master and applies the needed changes. The puppet master never needs to have SSH access to any of its agents.
In that case I was referring to business workflows, implemented through homemade code in Python, Golang, or any other language. But it doesn't mean Ansible should not work ;) did you have a chance to run it in very verbose mode?
@dwydler commented on GitHub (Oct 21, 2021):
Yes, i did it today. How can i sent you the logfile? I don't want to post the output publicly. Otherwise i have to mask all internal data.
@speed47 commented on GitHub (Oct 27, 2021):
Sorry, I was sure I had answered this one: you can send it by e-mail to the address you get from:
git log | grep bastion@ | head -n1(trying to avoid spambots ;) )
@dwydler commented on GitHub (Oct 27, 2021):
No problem. I wrote you an email.
@dwydler commented on GitHub (Nov 8, 2021):
Did you find the time to look into the logfiles?
@speed47 commented on GitHub (Nov 10, 2021):
Yes, did it just now, thanks for the e-mail.
So, the links you've found and indicated in the email (in addition to the log) were a good hint about where the problem lies, and your debug logs does confirm that. For completeness sake, the links were:
https://twitter.com/vince2_/status/1279402577919201281
https://github.com/ansible/ansible/issues/54981
Indeed it seems that this particular ansible module, network_cli, is not using the normal 'ssh' ansible module, but the 'paramiko_ssh' module instead (in the logs you provided, we can see both modules loaded, probably 'ssh' is used by the ansible core in all cases). Paramiko is a Python ssh lib which doesn't use the system's ssh binary, so AFAIK there's no way to easily "hook" into it and use the wrappers.
I think we already had people using paramiko here (not through an Ansible module, but in a custom python code), and we found no way to use it without actually patching Paramiko itself. I think today we no longer use it.
So, that would explain why it probably won't work with network_cli, unfortunately. However, maybe it would just work with the plain ssh module directly? As the bastion handles the SSH negotiation on the egress side, including potentially typing passwords where ssh keys are not supported, it might work?
@dwydler commented on GitHub (Nov 15, 2021):
Thanks for your time.
In my opinion that means a bash is expected ?! Which is not the case with Cisco IOS devices.
So in this case we will connect directly to the switches without bastion. :-(
@speed47 commented on GitHub (Dec 21, 2021):
Added an FAQ entry for this: https://ovh.github.io/the-bastion/faq.html#can-i-use-ansible-over-the-bastion