1

I am running an Ansible script, which has a module which takes backup in the remote server. Since the backup job is taking more than 15 mins, the conn getting closed by remote host, as there is security standard implemented to close conn after 15 mins of idle time(ClientAliveInterval set in ssh_config). Don't want to change the security standard and also at the same time, want Ansible to work.

I have already tried below 2 solutions, but both not working. Any help in this regard will be much appreciated.

  1. Included -o ServerAliveInterval in ansible.cfg file in ssh_args section.
  2. Implemented below param in the Ansible hosts by creating a config file in .~/.ssh/config
TCPKeepAlive yes
ServerAliveInterval 30

Thank you in advance.

ilias-sp
  • 6,135
  • 4
  • 28
  • 41
Prabhu
  • 11
  • 2
  • Can you try deploying your backup script to the remote server and run it there instead of running it from your local ? – Kashyap KN Jul 25 '20 at 07:31
  • Yes, that can be done. Since we are using Ansible host as cenralised host for monitoring and backup etc, any solution to this, will serve the purpose. – Prabhu Jul 25 '20 at 08:06
  • Hello, Edit you question and post the relevant part of the code that does this backup task. Thanks – Baptiste Mille-Mathias Jul 25 '20 at 09:51
  • 1
    https://stackoverflow.com/questions/39533532/ansible-timeout-12s-waiting-for-privilege-escalation-prompt try adding `timeout=30` to `/etc/ansible/ansible.cfg` Also https://stackoverflow.com/questions/54757444/which-ansible-cfg-timeout-value-is-t-overriding-on-the-ansible-playbook-comma – error404 Jul 25 '20 at 13:49

0 Answers0