Files
kayobe/ansible/roles/junos-switch/tasks/main.yml
Pierre Riteau 1372a7b01e junos-switch: Fix junos_config call
The junos_config module dropped support for the provider parameter and
for connection: local [1]. Apply a similar to fix to the Arista one [2].

[1] https://github.com/ansible-collections/junipernetworks.junos/pull/333
[2] https://review.opendev.org/c/openstack/kayobe/+/922631

Closes-Bug: #2111341
Change-Id: I531862fa9bebb8ef8ee900457278e0959dbe66cc
Signed-off-by: Pierre Riteau <pierre@stackhpc.com>
2025-07-03 12:25:42 +02:00

27 lines
992 B
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
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
name: "ncclient{{ ncclient_version }}"
virtualenv: "{{ lookup('env', 'VIRTUAL_ENV') | default(omit, true) }}"
become: "{{ lookup('env', 'VIRTUAL_ENV') == None }}"
check_mode: false
run_once: true
- name: Ensure Juniper switches are configured
junos_config:
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] }}"