Comments (6)
Resolved by PR #74
from community.ciscosmb.
From looking at the code, I think it's because of this
community.ciscosmb/plugins/terminal/ciscosmb.py
Lines 82 to 84 in cb9b3f3
where it will skip attempting an elevation if it sees a prompt starts with #
. For my switch, #
indicates that you're at priv 7 or 15, so this logic doesn't really work because you should still be able to elevate past privilege 7
from community.ciscosmb.
alright... found a workaround. If I add the following task before my non-working task
- name: disable
become: no
community.ciscosmb.command:
commands:
- disable
AND ensure that ansible_become
is unset or set to no in the inventory file,
then my original task works as expected.
This forces the cli session to go to the lowest possible setting and changes the cli prefix to >
instead of #
, which then properly triggers the code to run an enable
for subsequent tasks
If I set become: yes
either in the "disable" task or globally, then I get the following error on the disable
task:
{"changed": false, "msg": "Negative size passed to PyBytes_FromStringAndSize"}
from community.ciscosmb.
Hi
my understanding to become: yes is this: immediately after login it (on cisco sw) sends enable command.
And the priv. 7 account looks like "edgy" ... but legit.
I should check privilege more exactly.
Can you test this and send me output?
- name: Set up ansible user account
become: yes
community.ciscosmb.command:
commands:
- sh privilege
- enable
- sh privilege
- config t
- "username ansible password {{new_user_password}} privilege 15"
- ip ssh pubkey-auth auto-login
- exit
And just in case test this
- name: Set up ansible user account
become: yes
community.ciscosmb.command:
commands:
- enable
- config t
- "username ansible password {{new_user_password}} privilege 15"
- ip ssh pubkey-auth auto-login
- exit
from community.ciscosmb.
@ckhordiasma Never mind, I just checked the code and the leading test is redundant.
I will delete it and release ASAP.
Thank you for help.
from community.ciscosmb.
thank you!
from community.ciscosmb.
Related Issues (20)
- SX550X-24F issue with parse_inventory HOT 2
- Links at bottom of readme don't work in Galaxy HOT 1
- README Typo and misleading vars HOT 2
- Important information for collection maintainers
- Bad authentication HOT 10
- Ansible Contributor Summit. Tuesday, April 12, 2022.
- Action required: Add stable-2.13 to the test matrix HOT 2
- Possible to edit switch config HOT 11
- How to pass STDIN to commands HOT 1
- Not saving all running config HOT 4
- CBS350-24T-4G: "Failed to authenticate: Authentication failed." HOT 4
- Consider using true/false for all booleans in docs
- ConnectionError HOT 9
- Typo in /plugins/cliconf/ciscosmb.py HOT 2
- Add support for netcommon/gather_facts HOT 2
- Cisco CBS350 command Time-Out due to NO newline after command output HOT 4
- bandwith not bandwidth HOT 1
- Collection Requirements Violation - Semantic Versioning HOT 2
- ssh_common_args not being applied to ssh connection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from community.ciscosmb.