On 19. okt. 2017 20:39, Zimidar Boy wrote:
> 
> On Thursday, October 19, 2017 at 12:44:16 PM UTC-4, Kai Stian Olstad wrote:
>>
>> On 19. okt. 2017 17:02, Zimidar Boy wrote:
>>>
>>> Hello Kai,
>>>                        As soon as i used your solution now i am getting
>> this
>>> error:
>>>
>>>     "msg": "No remaining responses for '(?i)sftp>', output was ':
>> \r\nsftp>'"
>>>
>                     Solved the issue but i have to add 5 exit i don't know
> why. Do you think it has to do something with number of commands as i am
> running 5 commands. new code:
> 

I you previous message it says 
"No remaining responses for '(?i)sftp>'"

So adding exit on the "root@" prompt shouldn't have any effect.


> - name: crates sftp session to terastation
>      expect:
>         command: ssh user@host
> 
> 
>         responses:
>             (?i)root@: ['sftp user@host', 'mkdir /tmp/backups', 'mv lst*tar
> /tmp/backups', 'cd /tmp/backups', 'rm -rf $(ls -1t /tmp/backups | tail -n
> +3)', 'exit', 'exit', 'exit', 'exit',' exit']
> 
>             (?i)Password: 213gfdshaa
>             (?i)sftp>: ['cd a/o/h', 'put lst*tar', 'exit']
> 
To understand what is happening you would need to provide a verbose output by 
running but

ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook -vvv your-playbook.yml



-- 
Kai Stian Olstad

-- 
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/06546763-a612-8cc3-7e45-9a00b62689c7%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to