• Blog
  • Ansible community forum
  • Documentation
Ansible Logo
Ansible Community Documentation
Ansible

Ansible getting started

  • Getting started with Ansible
  • Getting started with Execution Environments

Installation, Upgrade & Configuration

  • Installation Guide
  • Ansible Porting Guides

Using Ansible

  • Building Ansible inventories
  • Using Ansible command line tools
  • Using Ansible playbooks
  • Protecting sensitive data with Ansible vault
  • Using Ansible modules and plugins
  • Using Ansible collections
  • Using Ansible on Windows and BSD
  • Ansible tips and tricks

Contributing to Ansible

  • Ansible Community Guide
  • Ansible Collections Contributor Guide
  • ansible-core Contributors Guide
  • Advanced Contributor Guide
  • Ansible documentation style guide

Extending Ansible

  • Developer Guide

Common Ansible Scenarios

  • Legacy Public Cloud Guides

Network Automation

  • Network Getting Started
  • Network Advanced Topics
  • Network Developer Guide

Ansible Galaxy

  • Galaxy User Guide
  • Galaxy Developer Guide

Reference & Appendices

  • Collection Index
    • Collections in the Amazon Namespace
    • Collections in the Ansible Namespace
    • Collections in the Arista Namespace
    • Collections in the Awx Namespace
    • Collections in the Azure Namespace
    • Collections in the Check_point Namespace
    • Collections in the Chocolatey Namespace
    • Collections in the Cisco Namespace
    • Collections in the Cloud Namespace
    • Collections in the Cloudscale_ch Namespace
    • Collections in the Community Namespace
    • Collections in the Containers Namespace
    • Collections in the Cyberark Namespace
    • Collections in the Dellemc Namespace
    • Collections in the F5networks Namespace
    • Collections in the Fortinet Namespace
    • Collections in the Frr Namespace
    • Collections in the Gluster Namespace
    • Collections in the Google Namespace
    • Collections in the Grafana Namespace
    • Collections in the Hetzner Namespace
    • Collections in the Hpe Namespace
    • Collections in the Ibm Namespace
    • Collections in the Ieisystem Namespace
    • Collections in the Infinidat Namespace
    • Collections in the Infoblox Namespace
    • Collections in the Inspur Namespace
    • Collections in the Junipernetworks Namespace
      • Junipernetworks.Junos
        • Description
        • Plugin Index
    • Collections in the Kaytus Namespace
    • Collections in the Kubernetes Namespace
    • Collections in the Kubevirt Namespace
    • Collections in the Lowlydba Namespace
    • Collections in the Mellanox Namespace
    • Collections in the Microsoft Namespace
    • Collections in the Netapp Namespace
    • Collections in the Netapp_eseries Namespace
    • Collections in the Netbox Namespace
    • Collections in the Ngine_io Namespace
    • Collections in the Openstack Namespace
    • Collections in the Openvswitch Namespace
    • Collections in the Ovirt Namespace
    • Collections in the Purestorage Namespace
    • Collections in the Sensu Namespace
    • Collections in the Servicenow Namespace
    • Collections in the Splunk Namespace
    • Collections in the T_systems_mms Namespace
    • Collections in the Telekom_mms Namespace
    • Collections in the Theforeman Namespace
    • Collections in the Vmware Namespace
    • Collections in the Vultr Namespace
    • Collections in the Vyos Namespace
    • Collections in the Wti Namespace
  • Indexes of all modules and plugins
  • Playbook Keywords
  • Return Values
  • Ansible Configuration Settings
  • Controlling how Ansible behaves: precedence rules
  • YAML Syntax
  • Python 3 Support
  • Interpreter Discovery
  • Releases and maintenance
  • Testing Strategies
  • Sanity Tests
  • Frequently Asked Questions
  • Glossary
  • Ansible Reference: Module Utilities
  • Special Variables
  • Red Hat Ansible Automation Platform
  • Ansible Automation Hub
  • Logging Ansible output

Roadmaps

  • Ansible Roadmap
  • ansible-core Roadmaps




Ansible
  • Collection Index
  • Collections in the Junipernetworks Namespace
  • Junipernetworks.Junos
  • junipernetworks.junos.junos_lacp module – Global Link Aggregation Control Protocol (LACP) Junos resource module


You are reading an older version of the Ansible documentation. Use the version selection to the left if you want the latest (stable) released version.

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 8.0.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. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: junipernetworks.junos.junos_lacp.

New in junipernetworks.junos 1.0.0

  • Synopsis

  • Requirements

  • Parameters

  • Notes

  • Examples

  • Return Values

Synopsis

  • This module provides declarative management of global LACP on Juniper Junos network devices.

Requirements

The below requirements are needed on the host that executes this module.

  • ncclient (>=v0.6.4)

Parameters

Parameter

Comments

config

dictionary

A dictionary of LACP global options

link_protection

string

Enable LACP link-protection for the system. If the value is set to non-revertive it will not revert links when a better priority link comes up. By default the link will be reverted.

Choices:

  • "revertive"

  • "non-revertive"

system_priority

integer

LACP priority for the system.

running_config

string

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 running_config option and transforms it into Ansible structured data as per the resource module’s argspec and the value is then returned in the parsed key within the result

state

string

The state of the configuration after module completion

Choices:

  • "merged" ← (default)

  • "replaced"

  • "deleted"

  • "gathered"

  • "rendered"

  • "parsed"

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

after

dictionary

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"

before

dictionary

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"

xml

list / elements=string

The set of xml rpc payload pushed to the remote device.

Returned: always

Sample: ["<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>", "xml 2", "xml 3"]

Authors

  • Ganesh Nalawade (@ganeshrn)

Collection links

  • Issue Tracker
  • Repository (Sources)
Previous Next

© Copyright Ansible project contributors. Last updated on Dec 03, 2024.