Ahhh, yea.. The provider is network_cli, so paramilko.. I miss NETCONF ;)
You’ve just spun another ios_* module assumption I had around :) I was under the impression that each ‘- name:’ definition was bounded with ios_. And so a subsequent ‘- name:’ stanzas would go back to their root again, and thus you couldn’t chain commands to elevate the CLI levels like your example. Let me test. You’ve given me lots of ideas on how I can do this cleanly, as I want the IOS 12 workarounds to be the exceptions.. Thanks Brad. Sent from a teeny tiny keyboard, so please excuse typos > On 3 Oct 2018, at 17:10, Brad Van Orden <[email protected]> wrote: > > No, darn it. I forgot those modules expect python on the target. So, > expect, command, shell, etc won't work. I think what you want to do is > something like (I don't have any way to test this at the moment): > > --- > - name: enable-mode > ios_command: > commands: > - command: enable > prompt: 'Password: ' > answer: {{ enable_password }} > - name: config-mode > ios_command: > commands: config terminal > - name: delete-user > ios_command: > commands: username {{ user_to_delete }} delete > > or something like that? > >> On Tuesday, October 2, 2018 at 12:02:24 PM UTC-4, [email protected] wrote: >> Hi, >> >> I just want to quickly check a finding with the community, something which >> should be so trivial it must be me :) >> >> I have found that it is not possible to remove Cisco users from IOS 12.x >> using the Ansible module ios_user: >> >> This is becuase IOS 12.x doesnt support "show running-config | section >> username" which the module tries to run. >> >> >> Ok, thats fair enough. So I'll have to write the logic using ios_config: >> module instead.. >> >> But ios_config: still does not seem to support 'prompt:' and 'answer:' :( >> >> Catch 22! As IOS prompts user removal with; >> "This operation will remove all username related configurations with same >> name.Do you want to continue? [confirm]" >> >> >> Thankfully, and only by dump luck, IOS 12 does not give this prompt, so >> ios_config: does work.. in this one case.. Phew.. >> >> But this to me seems like another exmaple of how much we need ios_config: to >> support 'prompt:' and 'answer:' as Cisco IOS plays so poorly with Ansible >> compared to other vendors becuase of the Cisco CLI. >> >> Thanks for your thoughts. >> Kind regards, Andy Lemin > > -- > You received this message because you are subscribed to a topic in the Google > Groups "Ansible Project" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/ansible-project/sAgM6EvjLWs/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/16b9e874-63ca-4e22-9df2-4ee9d32f57cd%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/095EAE24-A1CB-4C31-8D10-C07B5F00AC79%40gmail.com. For more options, visit https://groups.google.com/d/optout.
