junipernetworks.junos.junos_lacp module – Global Link Aggregation Control Protocol (LACP) Junos resource module
Note
This module is part of the junipernetworks.junos collection (version 2.10.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install junipernetworks.junos
.
To use it in a playbook, specify: junipernetworks.junos.junos_lacp
.
New in version 1.0.0: of junipernetworks.junos
Synopsis
This module provides declarative management of global LACP on Juniper Junos network devices.
Note
This module has a corresponding action plugin.
Requirements
The below requirements are needed on the host that executes this module.
ncclient (>=v0.6.4)
Parameters
Parameter |
Comments |
---|---|
A dictionary of LACP global options |
|
Enable LACP link-protection for the system. If the value is set to Choices:
|
|
LACP priority for the system. |
|
This option is used only with state parsed. The value of this option should be the output received from the Junos device by executing the command show chassis aggregated-devices ethernet lacp. The state parsed reads the configuration from |
|
The state of the configuration after module completion Choices:
|
Notes
Note
This module requires the netconf system service be enabled on the remote device being managed.
Tested against vSRX JUNOS version 18.1R1.
This module works with connection
netconf
. See the Junos OS Platform Options.
Examples
# Using deleted
# Before state:
# -------------
# user@junos01# show chassis aggregated-devices ethernet lacp
# system-priority 63;
# link-protection {
# non-revertive;
# }
- name: Delete global LACP attributes
junipernetworks.junos.junos_lacp:
state: deleted
# After state:
# ------------
# user@junos01# show chassis aggregated-devices ethernet lacp
#
# Using merged
# Before state:
# -------------
# user@junos01# show chassis aggregated-devices ethernet lacp
#
- name: Merge global LACP attributes
junipernetworks.junos.junos_lacp:
config:
system_priority: 63
link_protection: revertive
state: merged
# After state:
# ------------
# user@junos01# show chassis aggregated-devices ethernet lacp
# system-priority 63;
# link-protection {
# non-revertive;
# }
# Using replaced
# Before state:
# -------------
# user@junos01# show chassis aggregated-devices ethernet lacp
# system-priority 63;
# link-protection {
# non-revertive;
# }
- name: Replace global LACP attributes
junipernetworks.junos.junos_lacp:
config:
system_priority: 30
link_protection: non-revertive
state: replaced
# After state:
# ------------
# user@junos01# show chassis aggregated-devices ethernet lacp
# system-priority 30;
# link-protection;
#
# Using gathered
# Before state:
# ------------
#
# ansible@cm123456tr21# show chassis aggregated-devices ethernet lacp
# system-priority 63;
# link-protection;
- name: Gather junos lacp as in given arguments
junipernetworks.junos.junos_lacp:
state: gathered
# Task Output (redacted)
# -----------------------
#
# "gathered": {
# "link_protection": "revertive",
# "system_priority": 63
# }
# After state:
# ------------
#
# ansible@cm123456tr21# show chassis aggregated-devices ethernet lacp
# system-priority 63;
# link-protection;
# Using rendered
- name: Render platform specific xml from task input using rendered state
junipernetworks.junos.junos_lacp:
config:
system_priority: 63
link_protection: revertive
state: rendered
# Task Output (redacted)
# -----------------------
# "rendered": "<nc:chassis
# xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
# <nc:aggregated-devices>
# <nc:ethernet>
# <nc:lacp>
# <nc:system-priority>63</nc:system-priority>
# <nc:link-protection>
# <nc:non-revertive delete="delete"/>
# </nc:link-protection>
# </nc:lacp>
# </nc:ethernet>
# </nc:aggregated-devices>
# </nc:chassis>
#
# Using parsed
# parsed.cfg
# ------------
#
# <?xml version="1.0" encoding="UTF-8"?>
# <rpc-reply message-id="urn:uuid:0cadb4e8-5bba-47f4-986e-72906227007f">
# <configuration changed-seconds="1590139550" changed-localtime="2020-05-22 09:25:50 UTC">
# <chassis>
# <aggregated-devices>
# <ethernet>
# <lacp>
# <system-priority>63</system-priority>
# <link-protection>
# </link-protection>
# </lacp>
# </ethernet>
# </aggregated-devices>
# </chassis>
# </configuration>
# </rpc-reply>
# - name: Convert lacp config to argspec without connecting to the appliance
# junipernetworks.junos.junos_lacp:
# running_config: "{{ lookup('file', './parsed.cfg') }}"
# state: parsed
# Task Output (redacted)
# -----------------------
# "parsed": {
# "link_protection": "revertive",
# "system_priority": 63
# }
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The configuration as structured data after module completion. Returned: when changed Sample: “The configuration returned will always be in the same format\n of the parameters above.\n” |
|
The configuration as structured data prior to module invocation. Returned: always Sample: “The configuration returned will always be in the same format\n of the parameters above.\n” |
|
The set of xml rpc payload pushed to the remote device. Returned: always Sample: [“\u003cnc:chassis xmlns:nc=\”urn:ietf:params:xml:ns:netconf:base:1.0\”\u003e \u003cnc:aggregated-devices\u003e \u003cnc:ethernet\u003e \u003cnc:lacp\u003e \u003cnc:system-priority\u003e63\u003c/nc:system-priority\u003e \u003cnc:link-protection\u003e \u003cnc:non-revertive delete=\”delete\”/\u003e \u003c/nc:link-protection\u003e \u003c/nc:lacp\u003e \u003c/nc:ethernet\u003e \u003c/nc:aggregated-devices\u003e \u003c/nc:chassis\u003e”, “xml 2”, “xml 3”] |
Authors
Ganesh Nalawade (@ganeshrn)