From: Tim Rozet Date: Wed, 11 Oct 2017 12:54:15 +0000 (-0400) Subject: Increase ssh timeout and add retry for Ansible X-Git-Tag: opnfv-6.0.0~69 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=0fc3c2190ad304052d0ec210c94ab3f09e95b71d;hp=75afddf0e4032e4af389c5d85b529704102a77a2;p=apex.git Increase ssh timeout and add retry for Ansible 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 --- diff --git a/apex/common/utils.py b/apex/common/utils.py index b1837b9b..f418d429 100644 --- a/apex/common/utils.py +++ b/apex/common/utils.py @@ -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') diff --git a/lib/ansible/playbooks/deploy_dependencies.yml b/lib/ansible/playbooks/deploy_dependencies.yml index 8a575216..d2749675 100644 --- a/lib/ansible/playbooks/deploy_dependencies.yml +++ b/lib/ansible/playbooks/deploy_dependencies.yml @@ -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