From 1560bbc8fb2dea21bd8ae1a7b3881be7e35d03e0 Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Fri, 14 Feb 2020 09:43:49 +0000
Subject: [PATCH] Junos switch: update ncclient to 0.6.7+

ncclient 0.6.7 has been released and includes a fix [1] for the host key
checking issue that required us to pin to 0.6.2.

Restrict the package to <0.7.0 to avoid potential breakage from new
releases of ncclient.

[1] https://github.com/ncclient/ncclient/commit/ead7b640921ef9e1af4aab698ba287c3b8a48553

Change-Id: Ia665cffb11253f58bbdce7ea9892766c36f7af40
Story: 2006378
Task: 38765
---
 ansible/roles/junos-switch/tasks/main.yml | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/ansible/roles/junos-switch/tasks/main.yml b/ansible/roles/junos-switch/tasks/main.yml
index 5855de86..7c3176d4 100644
--- a/ansible/roles/junos-switch/tasks/main.yml
+++ b/ansible/roles/junos-switch/tasks/main.yml
@@ -2,12 +2,13 @@
 # The NETCONF client ncclient is required. This must be installed on the
 # Ansible control host where the ansible-connection subprocess is executed.
 - name: Ensure python dependencies are installed
+  vars:
+    # NOTE(mgoddard): 0.6.7 includes a fix for host key checking:
+    # https://github.com/ncclient/ncclient/issues/302.
+    ncclient_version: ">=0.6.7,<0.7.0"
   local_action:
     module: pip
-    # NOTE(mgoddard): Restrict ncclient to 0.6.2 or less, due to a bug in host
-    # key checking: https://github.com/ncclient/ncclient/issues/302.
-    # TODO(mgoddard): Remove this restriction when ncclient has been fixed.
-    name: ncclient<=0.6.2
+    name: "ncclient{{ ncclient_version }}"
     virtualenv: "{{ lookup('env', 'VIRTUAL_ENV') | default(omit, true) }}"
   become: "{{ lookup('env', 'VIRTUAL_ENV') == None }}"
   run_once: true
-- 
GitLab