Juniper Networks Junos Ansible Collection

repository·master·Indexed 43 days ago

https://github.com/juniper/ansible-junos-stdlib

Ansible content for automating the management of Juniper Networks Junos network appliances, designed for Junos OS 18.4R1 and later. It provides modules for configuration, software installation, operational commands, and JSNAPy testing, supporting connection types network_cli and netconf. Tested against Ansible versions >=2.16.0.

Tokens
129.9K
Snippets
314
Records
501
Agent score
54%

What's inside ansible-junos-stdlib

  1. Manage prefix-lists with junipernetworks.junos.junos_prefix_lists

    master

    The junos_prefix_lists module manages prefix-list attributes on Junos network devices. It allows you to create, update, or delete prefix lists and their associated address prefixes.

    Requirements

    The host executing the module must have the following Python packages installed:

    • ncclient (>=v0.6.4)
    • xmltodict (>=0.12.0)

    Prerequisites

    • The netconf system service must be enabled on the target Junos device.
    • The module uses the netconf connection method.

    Supported States

    • merged: Merges the provided configuration with the existing configuration.
    • replaced: Replaces the existing prefix-list with the provided configuration.
    • overridden: Overrides the existing configuration.
    • deleted: Removes the specified prefix-list.
    • parsed: Reads configuration from the running_config parameter and transforms it into structured Ansible data.
    • gathered: Gathers the current state of the prefix-lists.
    • rendered: Renders the configuration.
  2. Use the junos_acls module for declarative ACL management

    master
    The junipernetworks.junos.junos_acls module allows for the declarative management of Access Control Lists (ACLs) and filters on Juniper JUNOS devices. Instead of imperative commands, you define the desired state of your ACLs/filters, and the module ensures the device configuration matches that state.
  3. Manage VLAN configurations with junos_vlans

    master

    The junipernetworks.junos.junos_vlans module is a resource module used to create and manage VLAN configurations on Junos OS. It supports multiple states such as merged, replaced, overridden, deleted, gathered, parsed, and rendered to control how the VLAN configuration is applied or retrieved.

    junipernetworks.junos.junos_vlans:
  4. Manage multiline banners with junos_banner

    master

    The junipernetworks.junos.junos_banner module manages multiline banners on Juniper JUNOS devices. It can configure both login banners (shown prior to authentication) and motd (Message of the Day) banners (shown after successful authentication). The module allows you to add or remove banner text from the active running configuration and supports activating or deactivating the configuration.

    - name: configure the login banner
      junipernetworks.junos.junos_banner:
        banner: login
        text: |
          this is my login banner
          that contains a multiline
          string
        state: present
  5. Manage ACL interfaces with junos_acl_interfaces

    master

    The junipernetworks.junos.junos_acl_interfaces module manages the addition and removal of Access Control Lists (ACLs) from interfaces on Juniper JUNOS devices. It is a resource module that supports various states such as merged, replaced, overridden, deleted, gathered, rendered, and parsed.

    Requirements

    To execute this module, the following Python packages must be installed on the host:

    • ncclient (>=v0.6.4)
    • xmltodict (>=0.12.0)

    Device Requirements

    • The netconf system service must be enabled on the managed Junos device.
    • The module uses the netconf connection type.
  6. Manage Junos interfaces with junos_interfaces

    master

    The junipernetworks.junos.junos_interfaces module allows you to manage Junos interface configurations using several different operational states: merged, deleted, overridden, replaced, gathered, parsed, and rendered.

    Depending on the state selected, the module can either apply configuration to the device, remove specific options, or perform data transformations (like converting XML to structured data or vice versa) without necessarily connecting to a live appliance.

    - name: Example task
      junipernetworks.junos.junos_interfaces:
        config: []
        state: merged