Increase ssh timeout and add retry for Ansible 89/44789/2
authorTim Rozet <trozet@redhat.com>
Wed, 11 Oct 2017 12:54:15 +0000 (08:54 -0400)
committerTim Rozet <trozet@redhat.com>
Wed, 11 Oct 2017 13:03:07 +0000 (09:03 -0400)
Several users have experienced random disconnections from the undercloud
during deployment.  This should help to stop deployments from aborting.

Change-Id: Idb7619d493b329944f21ea6641f6826a8fcc3907
Signed-off-by: Tim Rozet <trozet@redhat.com>
apex/common/utils.py
lib/ansible/playbooks/deploy_dependencies.yml

index b1837b9..f418d42 100644 (file)
@@ -76,7 +76,8 @@ def run_ansible(ansible_vars, playbook, host='localhost', user='root',
     else:
         conn_type = 'smart'
     ansible_command = ['ansible-playbook', '--become', '-i', inv_host,
-                       '-u', user, '-c', conn_type, playbook, '-vv']
+                       '-u', user, '-c', conn_type, '-T', '30',
+                       playbook, '-vv']
     if dry_run:
         ansible_command.append('--check')
 
index 8a57521..d274967 100644 (file)
@@ -78,3 +78,9 @@
         regexp: "tostring"
         path: /usr/lib/python3.4/site-packages/virtualbmc/vbmc.py
       when: vbmc_py.stat.exists == True
+    - name: Add ssh retry to Ansible config
+      ini_file:
+        path: /etc/ansible/ansible.cfg
+        section: ssh_connection
+        option: retries
+        value: 5