Manage multiline banners on Cisco NXOS devices
Version added: 1.0.0
- This will configure both exec and motd banners on remote devices running Cisco NXOS. It allows playbooks to add or remove banner text from the active running configuration.
Note
- Since responses from the device are always read with surrounding whitespaces stripped, tasks that configure banners with preceeding or trailing whitespaces will not be idempotent.
- Limited Support for Cisco MDS
- For information on using CLI and NX-API see the :ref:`NXOS Platform Options guide <nxos_platform_options>`
- For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>`
- For more information on using Ansible to manage Cisco devices see the Cisco integration page.
- name: configure the exec banner
cisco.nxos.nxos_banner:
banner: exec
text: |
this is my exec banner
that contains a multiline
string
state: present
- name: remove the motd banner
cisco.nxos.nxos_banner:
banner: motd
state: absent
- name: Configure banner from file
cisco.nxos.nxos_banner:
banner: motd
text: "{{ lookup('file', './config_partial/raw_banner.cfg') }}"
state: present
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
commands
list
|
always |
The list of configuration mode commands to send to the device
Sample:
['banner exec', 'this is my exec banner', 'that contains a multiline', 'string']
|
- Trishna Guha (@trishnaguha)