Deprecated

Removed in None

i

Reason:Updated modules released with more functionality | Alternative:Use platform-specific "[netos]_banner" module

ansible.netcommon.net_banner (3.1.3) — module

(deprecated, removed after 2022-06-01) Manage multiline banners on network devices

| "added in version" 1.0.0 of ansible.netcommon"

Authors: Ricardo Carrillo Cruz (@rcarrillocruz)

This plugin has a corresponding action plugin.

Install collection

Install with ansible-galaxy collection install ansible.netcommon:==3.1.3


Add to requirements.yml

  collections:
    - name: ansible.netcommon
      version: 3.1.3

Description

This will configure both login and motd banners on network devices. It allows playbooks to add or remove banner text from the active running configuration.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure the login banner
  ansible.netcommon.net_banner:
    banner: login
    text: |
      this is my login banner
      that contains a multiline
      string
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove the motd banner
  ansible.netcommon.net_banner:
    banner: motd
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure banner from file
  ansible.netcommon.net_banner:
    banner: motd
    text: "{{ lookup('file', './config_partial/raw_banner.cfg') }}"
    state: present

Inputs

    
text:
    description:
    - The banner text that should be present in the remote device running configuration.  This
      argument accepts a multiline string, with no empty lines. Requires I(state=present).

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Specifies whether or not the configuration is present in the current devices active
      running configuration.

banner:
    choices:
    - login
    - motd
    description:
    - Specifies which banner that should be configured on the remote device.
    required: true

Outputs

commands:
  description: The list of configuration mode commands to send to the device
  returned: always, except for the platforms that use Netconf transport to manage
    the device.
  sample:
  - banner login
  - this is my login banner
  - that contains a multiline
  - string
  type: list