Re: [ansible-project] Raw module and interactive commands

2015-12-11 Thread theyuseus
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

2015-12-11 Thread Brian Coca
In 2.0 we have module_utils/ssh.py (to be renamed) that is the core of
shared code for future  modules that will deal with that kind of switch.
On Dec 11, 2015 16:37,  wrote:

> 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.
>

-- 
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/CAJ5XC8kQOQ7G%2BQGf8%2BmmJKqLqb4osX%2BbMxPmpQoLDc7pEV5fTg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Raw module and interactive commands

2015-12-10 Thread theyuseus
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

2015-12-10 Thread theyuseus
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

2015-12-10 Thread Matt Martz
The Ansible expect module will be shipped with 2.0. The current released
version is 1.9.4.

On Thursday, December 10, 2015,  wrote:

> 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.
>


-- 
Matt Martz
@sivel
sivel.net

-- 
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/CAD8N0v8ER7X1JwL1Zb2_AaV0%3DWFQcq7rCtF7%2BiFRga3_4PejyA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Raw module and interactive commands

2015-12-10 Thread theyuseus
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

2015-12-10 Thread Brian Coca
It still won't work with the switch as it is a module, which NEEDS to
be copied to the target and then executed via python, raw is the only
'module' that does not do this, it is really a special case inside
Ansible and not a real module.

In 2.0 we are adding the scaffolding to deal with switches, we will
also be adding modules to manage them that take into account the
quirks they have.

-- 
Brian Coca

-- 
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/CAJ5XC8n8_AnVMCPekX1DE2f0z8kAbg7-CPbw4-snr8LE%2B_ihKQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Raw module and interactive commands

2015-12-02 Thread theyuseus
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.


Re: [ansible-project] Raw module and interactive commands

2015-12-02 Thread Tim Fletcher
On 02/12/15 03:23, pspryg...@ansible.com wrote:
> What switch are you trying to send commands to?   
> 
> We have started to incorporate network device support into the
> module_utils for connecting to interactive devices over ssh with initial
> support for IOS based devices.   See here for the IOS shared module
> support (https://github.com/ansible/ansible/pull/13358/files) and here
> (https://github.com/ansible/ansible-modules-core/pull/2587/files) for an
> example module

That's great news, especially as I have written an ugly bit of bash this
week to bulk unset and reset the correct ntp servers on all out Cisco
switches...

-- 
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/565F8694.3010205%40night-shade.org.uk.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Re: [ansible-project] Raw module and interactive commands

2015-12-01 Thread Brian Coca
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/CAJ5XC8kF49%2BeFtBsSvx5wBxjYjDgbovWfz2eqnEvqHRfJVckCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Raw module and interactive commands

2015-12-01 Thread psprygada
What switch are you trying to send commands to?   

We have started to incorporate network device support into the module_utils 
for connecting to interactive devices over ssh with initial support for IOS 
based devices.   See here for the IOS shared module support 
(https://github.com/ansible/ansible/pull/13358/files) and here 
(https://github.com/ansible/ansible-modules-core/pull/2587/files) for an 
example module

-- 
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/d80472a1-122e-4705-a835-599a5fa434c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.