community / community.network / 5.0.2 / module / cnos_banner Manage multiline banners on Lenovo CNOS devices Authors: Anil Kumar Muraleedharan (@amuraleedhar)community.network.cnos_banner (5.0.2) — module
Install with ansible-galaxy collection install community.network:==5.0.2
collections: - name: community.network version: 5.0.2
This will configure both login and motd banners on remote devices running Lenovo CNOS. It allows playbooks to add or remote banner text from the active running configuration.
- name: Configure the login banner community.network.cnos_banner: banner: login text: | this is my login banner that contains a multiline string state: present
- name: Remove the motd banner community.network.cnos_banner: banner: motd state: absent
- name: Configure banner from file community.network.cnos_banner: banner: motd text: "{{ lookup('file', './config_partial/raw_banner.cfg') }}" state: present
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 should be configured on the remote device. In Ansible 2.8 and earlier only I(login) and I(motd) were supported. required: true
commands: description: The list of configuration mode commands to send to the device returned: always sample: - banner login - this is my login banner - that contains a multiline - string type: list