Juniper physical network device configuration fails when running the
following command:
kayobe physical network configure --group switches
The error is as follows:
fatal: [switch]: FAILED! => {
"msg": "Unknown host key [<key>] for [[<IP>]:830]"
}
This is due to a bug [1] in ncclient.
This patch avoids the issue by pinning ncclient to version 0.6.2 or
lower.
[1] https://github.com/ncclient/ncclient/issues/302
Change-Id: I7ecd6cd3460bea56d0ab9cb221d0ef5b5ec2d0bb
Story: 2006378
Task: 36174
26 lines
1.0 KiB
YAML
26 lines
1.0 KiB
YAML
---
|
|
# 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
|
|
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
|
|
virtualenv: "{{ lookup('env', 'VIRTUAL_ENV') | default(omit, true) }}"
|
|
become: "{{ lookup('env', 'VIRTUAL_ENV') == None }}"
|
|
|
|
- name: Ensure Juniper switches are configured
|
|
local_action:
|
|
module: junos_config
|
|
provider: "{{ junos_switch_provider }}"
|
|
src: "{{ junos_switch_src }}"
|
|
src_format: "{{ junos_switch_config_format }}"
|
|
vars:
|
|
junos_switch_config_format_to_src:
|
|
set: junos-config-set.j2
|
|
text: junos-config.j2
|
|
json: junos-config.json.j2
|
|
junos_switch_src: "{{ junos_switch_config_format_to_src[junos_switch_config_format] }}"
|