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>
This commit is contained in:
@@ -1,28 +1,9 @@
|
|||||||
---
|
---
|
||||||
# Switch configuration.
|
# Switch configuration.
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# Authentication configuration.
|
|
||||||
|
|
||||||
# For Juniper switches, this defines a 'provider' argument to the junos_*
|
|
||||||
# modules.
|
|
||||||
switch_junos_provider:
|
|
||||||
host: "{{ ansible_host|default(inventory_hostname) }}"
|
|
||||||
username: "{{ ansible_user }}"
|
|
||||||
password: "{{ ansible_ssh_pass|default(omit) }}"
|
|
||||||
ssh_keyfile: "{{ ansible_ssh_private_key_file|default(omit) }}"
|
|
||||||
timeout: "{{ switch_junos_timeout }}"
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Configuration format.
|
# Configuration format.
|
||||||
|
|
||||||
# Format of configuration in junos_switch_config and
|
# Format of configuration in junos_switch_config and
|
||||||
# junos_switch_interface_config. May be one of 'set', 'text' or 'json'.
|
# junos_switch_interface_config. May be one of 'set', 'text' or 'json'.
|
||||||
switch_junos_config_format: text
|
switch_junos_config_format: text
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# Timeout.
|
|
||||||
|
|
||||||
# Timeout in seconds for communicating with the network device either for
|
|
||||||
# connecting or sending commands.
|
|
||||||
switch_junos_timeout: 10
|
|
||||||
|
|||||||
@@ -173,7 +173,6 @@
|
|||||||
|
|
||||||
- role: junos-switch
|
- role: junos-switch
|
||||||
junos_switch_type: "{{ switch_type }}"
|
junos_switch_type: "{{ switch_type }}"
|
||||||
junos_switch_provider: "{{ switch_junos_provider }}"
|
|
||||||
junos_switch_config_format: "{{ switch_junos_config_format }}"
|
junos_switch_config_format: "{{ switch_junos_config_format }}"
|
||||||
junos_switch_config: "{{ switch_config }}"
|
junos_switch_config: "{{ switch_config }}"
|
||||||
junos_switch_interface_config: "{{ switch_interface_config }}"
|
junos_switch_interface_config: "{{ switch_interface_config }}"
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
JunOS Switch
|
JunOS Switch
|
||||||
============
|
============
|
||||||
|
|
||||||
This role configures Juniper switches using the `junos` Ansible modules. It
|
This role configures Juniper switches using the `junipernetworks.junos` Ansible
|
||||||
provides a fairly minimal abstraction of the configuration interface provided
|
collection. It provides a fairly minimal abstraction of the configuration
|
||||||
by the `junos` modules, allowing for application of arbitrary switch
|
interface provided by the collection, allowing for application of arbitrary
|
||||||
configuration options.
|
switch configuration options.
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
@@ -14,12 +14,6 @@ The switches should be configured to allow access to NETCONF via SSH.
|
|||||||
Role Variables
|
Role Variables
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
`junos_switch_delegate_to` is the host on which to execute the `junos` Ansible
|
|
||||||
modules.
|
|
||||||
|
|
||||||
`junos_switch_provider` is authentication provider information passed as the
|
|
||||||
`provider` argument to the `junos` modules.
|
|
||||||
|
|
||||||
`junos_switch_config_format` is the format of configuration in
|
`junos_switch_config_format` is the format of configuration in
|
||||||
`junos_switch_config` and `junos_switch_interface_config`. May be one of `set`,
|
`junos_switch_config` and `junos_switch_interface_config`. May be one of `set`,
|
||||||
`text` or `json`.
|
`text` or `json`.
|
||||||
@@ -53,11 +47,6 @@ passwords. It applies global configuration for LLDP, and enables two
|
|||||||
gather_facts: no
|
gather_facts: no
|
||||||
roles:
|
roles:
|
||||||
- role: junos-switch
|
- role: junos-switch
|
||||||
junos_switch_delegate_to: localhost
|
|
||||||
junos_switch_provider:
|
|
||||||
host: "{{ switch_host }}"
|
|
||||||
username: "{{ switch_user }}"
|
|
||||||
password: "{{ switch_password }}"
|
|
||||||
junos_switch_config:
|
junos_switch_config:
|
||||||
- "protocols {"
|
- "protocols {"
|
||||||
- " lldp {"
|
- " lldp {"
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
---
|
---
|
||||||
# Authentication provider information.
|
|
||||||
junos_switch_provider:
|
|
||||||
|
|
||||||
# Format of configuration in junos_switch_config and
|
# Format of configuration in junos_switch_config and
|
||||||
# junos_switch_interface_config. May be one of 'set', 'text' or 'json'.
|
# junos_switch_interface_config. May be one of 'set', 'text' or 'json'.
|
||||||
junos_switch_config_format: text
|
junos_switch_config_format: text
|
||||||
|
|||||||
@@ -15,9 +15,7 @@
|
|||||||
run_once: true
|
run_once: true
|
||||||
|
|
||||||
- name: Ensure Juniper switches are configured
|
- name: Ensure Juniper switches are configured
|
||||||
local_action:
|
junos_config:
|
||||||
module: junos_config
|
|
||||||
provider: "{{ junos_switch_provider }}"
|
|
||||||
src: "{{ junos_switch_src }}"
|
src: "{{ junos_switch_src }}"
|
||||||
src_format: "{{ junos_switch_config_format }}"
|
src_format: "{{ junos_switch_config_format }}"
|
||||||
vars:
|
vars:
|
||||||
|
|||||||
@@ -293,24 +293,14 @@ module.
|
|||||||
configuration. The variable is passed as the ``src_format`` argument to the
|
configuration. The variable is passed as the ``src_format`` argument to the
|
||||||
``junos_config`` module. The default value is ``text``.
|
``junos_config`` module. The default value is ``text``.
|
||||||
|
|
||||||
Provider
|
|
||||||
^^^^^^^^
|
|
||||||
|
|
||||||
* ``ansible_host`` is the hostname or IP address. Optional.
|
* ``ansible_host`` is the hostname or IP address. Optional.
|
||||||
|
|
||||||
* ``ansible_user`` is the SSH username.
|
* ``ansible_user`` is the SSH username.
|
||||||
|
|
||||||
* ``ansible_ssh_pass`` is the SSH password. Mutually exclusive with
|
* ``ansible_ssh_pass`` is the SSH password. Mutually exclusive with
|
||||||
``ansible_ssh_private_key_file``.
|
``ansible_ssh_private_key_file``.
|
||||||
|
|
||||||
* ``ansible_ssh_private_key_file`` is the SSH private key file. Mutually
|
* ``ansible_ssh_private_key_file`` is the SSH private key file. Mutually
|
||||||
exclusive with ``ansible_ssh_pass``.
|
exclusive with ``ansible_ssh_pass``.
|
||||||
|
* ``ansible_connection`` should be ``ansible.netcommon.netconf``.
|
||||||
* ``switch_junos_timeout`` may be set to a timeout in seconds for communicating
|
* ``ansible_network_os`` should be ``junipernetworks.junos.junos``.
|
||||||
with the device.
|
|
||||||
|
|
||||||
Alternatively, set ``switch_junos_provider`` to the value to be passed as the
|
|
||||||
``provider`` argument to the ``junos_config`` module.
|
|
||||||
|
|
||||||
Mellanox MLNX OS
|
Mellanox MLNX OS
|
||||||
----------------
|
----------------
|
||||||
|
|||||||
15
releasenotes/notes/bug-2111341-706fe5689414a9c1.yaml
Normal file
15
releasenotes/notes/bug-2111341-706fe5689414a9c1.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
Deployments using Juniper Junos OS switches are required to update their
|
||||||
|
configuration according to `Juniper Junos OS documentation
|
||||||
|
<https://docs.openstack.org/kayobe/latest/configuration/reference/physical-network.html#juniper-junos-os>`_.
|
||||||
|
This is due to the ``junos_config`` module dropping support for the
|
||||||
|
``provider`` parameter.
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fixes physical network configuration for Juniper Junos OS switches.
|
||||||
|
Note that users are required to update their configuration according to
|
||||||
|
`Juniper Junos OS documentation
|
||||||
|
<https://docs.openstack.org/kayobe/latest/configuration/reference/physical-network.html#juniper-junos-os>`_.
|
||||||
|
`LP#2111341 <https://bugs.launchpad.net/kayobe/+bug/2111341>`__
|
||||||
Reference in New Issue
Block a user