Check ssh-agent before running tests. Fail playbook if not running. 69/34669/6
authorTaseer <taseer94@gmail.com>
Fri, 12 May 2017 11:10:05 +0000 (16:10 +0500)
committerTaseer <taseer94@gmail.com>
Mon, 15 May 2017 07:05:22 +0000 (12:05 +0500)
- Need to start it manually. Not possible via playbook.

JIRA: QTIP-242

Change-Id: Ief593fe54a900f7aa36890be5317a60bcb65a82e
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
resources/ansible_roles/qtip/tasks/setup-local.yml

index f5f8327..a177d52 100644 (file)
@@ -9,6 +9,20 @@
 
 ---
 
+- name: checking status of ssh_auth_sock
+  shell: echo $SSH_AUTH_SOCK
+  register: sock_status
+  ignore_errors: yes
+
+- name: checking status of ssh_agent_pid
+  shell: pidof ssh-agent
+  register: pid_status
+  ignore_errors: yes
+
+- fail:
+    msg: "ssh-agent is required to execute QTIP. Use 'eval $(ssh-agent)' to start it"
+  when: sock_status.stdout == '' or pid_status.stdout == ''
+
 - name: formatting directory name for current run
   set_fact:
     pod_results: "{{ pod_name }}-{{ lookup('pipe', 'date +%Y%m%d-%H%M') }}"