cisco.ios.ios_banner 模块 – 配置多行横幅的模块。
注意
此模块是 cisco.ios 集合(版本 9.0.3)的一部分。
如果您正在使用 ansible 包,您可能已经安装了此集合。 它不包含在 ansible-core 中。 要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install cisco.ios。
要在 playbook 中使用它,请指定:cisco.ios.ios_banner。
cisco.ios 1.0.0 中的新功能
概要
- 这将在运行 Cisco IOS 的远程设备上配置登录和 motd 横幅。 它允许 playbook 从活动的运行配置中添加或删除横幅文本。 
参数
| 参数 | 注释 | 
|---|---|
| 指定应在远程设备上配置哪个横幅。 在 Ansible 2.4 和更早版本中,仅支持 login 和 motd。 选择 
 | |
| 指定用于配置的分隔符字符。 默认值:  | |
| 指定当前设备的活动运行配置中是否存在该配置。 选择 
 | |
| 应存在于远程设备运行配置中的横幅文本。 此参数接受多行字符串,且没有空行。 需要 state=present。 | 
说明
注意
- 已在 CML 上的 Cisco IOSXE 版本 17.3 上进行测试。 
- 此模块与连接 - network_cli一起使用。 请参阅 https://docs.ansible.org.cn/ansible/latest/network/user_guide/platform_ios.html
- 有关使用 Ansible 管理网络设备的更多信息,请参阅:ref:`Ansible 网络指南 <network_guide>` 
- 有关使用 Ansible 管理 Cisco 设备的更多信息,请参阅 `Cisco 集成页面 <https://ansible.org.cn/integrations/networks/cisco>`_。 
示例
- name: Configure the login banner
  cisco.ios.ios_banner:
    banner: login
    text: |
      this is my login banner
      that contains a multiline
      string
    state: present
- name: Remove the motd banner
  cisco.ios.ios_banner:
    banner: motd
    state: absent
- name: Configure banner from file
  cisco.ios.ios_banner:
    banner: motd
    text: "{{ lookup('file', './config_partial/raw_banner.cfg') }}"  # Use unix formatted text files (LF not CRLF) to avoid idempotency issues.
    state: present
- name: Configure the login banner using delimiter
  cisco.ios.ios_banner:
    banner: login
    multiline_delimiter: x
    text: this is my login banner
    state: present
返回值
常见的返回值记录在 此处,以下是此模块独有的字段
| 键 | 描述 | 
|---|---|
| 要发送到设备的配置模式命令列表 返回: 始终 示例:  | 
作者
- Ricardo Carrillo Cruz (@rcarrillocruz) 
