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>'"
On Thursday, October 12, 2017 at 9:42:06 AM UTC-4, Kai Stian Olstad wrote:
>
> On 12.10.2017 15:29, Zimidar Boy wrote:
> > TASK [Creates Sftp session to send files to terastation.]
> >
> ****************************************************************************************************************************************************************************************************************************
>
>
> > changed: [localhost] => {"changed": true, "cmd": "sftp user@hostname",
> > "delta": "0:00:01.136744", "end": "2017-10-11 05:14:25.224441",
> > "failed":
> > false, "rc": 0, "start": "2017-10-11 05:14:24.087697", "stdout":
> > "Connecting to terastation...\r\nPassword: \r\nsftp> exit",
> > "stdout_lines":
> > ["Connecting to terastation...", "Password: ", "sftp> exit"]}
>
> It do login but just run and exit afterward, and exit is the last of you
> responses.
>
>
> > my code
> - name: Creates Sftp session to send files to terastation.
> expect:
> command: ssh user@hostname
> responses:
>
(?i)root@": "sftp user@hostname"
> (?i)Password: "1rfr2345"
> (?i)sftp>:
> - "cd abc/def/"
> - "put "$HOSTNAME"_`date +"%Y-%m-%d"`.tar "
> - "exit"
>
> --
> 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/b95bc840-f736-41f4-9df3-ae6af07512ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.