Re: [ansible-project] Raw module and interactive commands
Awesome, thank you for the information. -- 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-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c3601104-2b2c-43d7-a905-86d317a68da4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Raw module and interactive commands
Is there a tutorial anywhere about how to get started using the expect module? I've installed pexpect but when I try to use it in a playbook it fails with this message: ERROR: expect is not a legal parameter in an Ansible task or handler Based on what I've found (I could only find 2-3 examples, there doesn't seem to be any documentation other than https://docs.ansible.com/ansible/expect_module.html, which doesn't adequately explain how to use it), the playbook should look something like this. tasks: - expect: command: save primary responses: Do you want to save configuration to primary.cfg and overwrite it\? \(y/N\): "Y" Am I missing something? This page says that the extra's modules is shipped with ansible, is that still accurate? https://docs.ansible.com/ansible/modules_extra.html James On Tuesday, December 1, 2015 at 5:53:52 PM UTC-7, Brian Coca wrote: > > No, its completely batch, you can try the expect module for interactive > prompts. > -- 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-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/525f1c99-cddc-48f5-a2b5-7f42af4ea4c4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Raw module and interactive commands
I've uninstalled and reinstalled version 1.9.4 and it isn't with it. I downloaded it from github and added "library = /path/to/ansible/modules:/path/to/extras" to the ansible.cfg file, had to fix my command to the following text - expect: command: save primary responses: Do you want to save configuration to primary.cfg and overwrite it\? \(y/N\): "Y" but I still get an error. It looks like ansible is still trying to copy a file to the switch. The switches don't allow files to be copied to them. I'm guessing I can't use the expect module after all. fatal: [sw_s1-6] => Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: mkdir -p $HOME/.ansible/tmp/ansible-tmp-1449790332.18-49609163795878 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1449790332.18-49609163795878 && echo $HOME/.ansible/tmp/ansible-tmp-1449790332.18-49609163795878, exited with result -1: %% Unrecognized command: "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1449790332.18-49609163795878 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1449790332.18-49609163795878 && echo $HOME/.ansible/tmp/ansible-tmp-1449790332.18-49609163795878'" -- 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-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3f8a7ed1-8c9d-40d4-a910-17eba8b54f61%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Raw module and interactive commands
On investigation it appears that I do not have the expect module. I thought I installed ansible with pip install ansible, but I earlier tried homebrew but it didn't work. Maybe something got messed up. I guess I'll try to figure out how to fix my installation. -- 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-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/67fee4a6-d49a-46d7-b250-6ebb787455b4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Raw module and interactive commands
Extreme Networks' EXOS. It's Linux based but doesn't have Python or other languages except one that I can't remember it's heritage (TCL maybe?). I think the prompt is a heavily modified BusyBox or something. I'm not sure how I would go about testing those 2 modules. I could try them if you think they might work. I can use the raw module to send commands and get back results, I just can't find any way around some of the interactive prompts. I believe Extreme is working on adding Ansible support to their OS, but my switches won't can't be upgraded to any newer versions so I can't get those updates. -- 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-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2ec50404-c7fc-4974-98e2-68d6c2dfcc5a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Re: SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh
Well, I just tried anything and everything I could and it looks like adding "-c paramiko" fixed it. -- 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-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3eb03045-fd75-4d72-9981-16918ac3eba7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Re: SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh
Am I missing a flag or setting? I've got "ansible_ssh_private_key_file" set to the full path to my id_rsa file. Is that all it takes to get Ansible to use private keys? -- 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-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/31a41cad-defc-4d53-a7a2-82673d8ea868%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Re: SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh
The version on my master computer is: OpenSSL 0.9.8zc 15 Oct 2014. I can't seem to find the version on the the clients, which are switches. What I don't get is why --ask-pass works with OpenSSH but private keys don't. I added this to my ansible.cfg and it made no difference but I'm not sure if this is what you meant by "empty ssh_args". [ssh_connection] ssh_args = -- 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-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d05a218c-b088-4836-a650-725f5f61690e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh
I’m trying to use private keys. I've got it all setup and it works when I use this command. ssh -C james@172.30.129.174 some command It works when I use the command as formatted by Ansible too. ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/Users/james/.ansible/cp/ansible-ssh-%h-%p-%r" -o IdentityFile="/Users/james/.ssh/id_rsa" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=james -o ConnectTimeout=10 172.30.129.174 some command When I use Ansible it doesn’t work. ansible - 172.30.129.174 -m raw -a "show switch” <172.30.129.174> ESTABLISH CONNECTION FOR USER: james <172.30.129.174> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/Users/james /.ansible/cp/ansible-ssh-%h-%p-%r" -o IdentityFile="/Users/james/.ssh/id_rsa" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=james -o ConnectTimeout=10 172.30.129.174 show switch sw_b2-1 | FAILED => SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh Does anyone have any ideas why I can't get private keys to work? James -- 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-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d3c85f38-0cdb-4b3f-8109-3308b80e221f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Re: SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh
One more comment, if I add --ask-pass to the Ansible command it works. I just can't get the private keys to work. -- 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-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/45e6f09b-ecd3-4408-aa46-dad14c6d2d7d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.