Debian Codegraph @

ansible_collections/cisco/nxos/docs/cisco.nxos.nxos_banner_module.rst

raw
1 .. _cisco.nxos.nxos_banner_module:
2
3
4 **********************
5 cisco.nxos.nxos_banner
6 **********************
7
8 **Manage multiline banners on Cisco NXOS devices**
9
10
11 Version added: 1.0.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - 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.
21
22
23
24
25 Parameters
26 ----------
27
28 .. raw:: html
29
30 <table border=0 cellpadding=0 class="documentation-table">
31 <tr>
32 <th colspan="1">Parameter</th>
33 <th>Choices/<font color="blue">Defaults</font></th>
34 <th width="100%">Comments</th>
35 </tr>
36 <tr>
37 <td colspan="1">
38 <div class="ansibleOptionAnchor" id="parameter-"></div>
39 <b>banner</b>
40 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
41 <div style="font-size: small">
42 <span style="color: purple">string</span>
43 / <span style="color: red">required</span>
44 </div>
45 </td>
46 <td>
47 <ul style="margin: 0; padding: 0"><b>Choices:</b>
48 <li>exec</li>
49 <li>motd</li>
50 </ul>
51 </td>
52 <td>
53 <div>Specifies which banner that should be configured on the remote device.</div>
54 </td>
55 </tr>
56 <tr>
57 <td colspan="1">
58 <div class="ansibleOptionAnchor" id="parameter-"></div>
59 <b>multiline_delimiter</b>
60 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
61 <div style="font-size: small">
62 <span style="color: purple">string</span>
63 </div>
64 </td>
65 <td>
66 <b>Default:</b><br/><div style="color: blue">"@"</div>
67 </td>
68 <td>
69 <div>Specify the delimiting character than will be used for configuration.</div>
70 </td>
71 </tr>
72 <tr>
73 <td colspan="1">
74 <div class="ansibleOptionAnchor" id="parameter-"></div>
75 <b>state</b>
76 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
77 <div style="font-size: small">
78 <span style="color: purple">string</span>
79 </div>
80 </td>
81 <td>
82 <ul style="margin: 0; padding: 0"><b>Choices:</b>
83 <li><div style="color: blue"><b>present</b>&nbsp;&larr;</div></li>
84 <li>absent</li>
85 </ul>
86 </td>
87 <td>
88 <div>Specifies whether or not the configuration is present in the current devices active running configuration.</div>
89 </td>
90 </tr>
91 <tr>
92 <td colspan="1">
93 <div class="ansibleOptionAnchor" id="parameter-"></div>
94 <b>text</b>
95 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
96 <div style="font-size: small">
97 <span style="color: purple">string</span>
98 </div>
99 </td>
100 <td>
101 </td>
102 <td>
103 <div>The banner text that should be present in the remote device running configuration. This argument accepts a multiline string, with no empty lines. Requires <em>state=present</em>.</div>
104 </td>
105 </tr>
106 </table>
107 <br/>
108
109
110 Notes
111 -----
112
113 .. note::
114 - 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.
115 - Limited Support for Cisco MDS
116 - For information on using CLI and NX-API see the :ref:`NXOS Platform Options guide <nxos_platform_options>`
117 - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>`
118 - For more information on using Ansible to manage Cisco devices see the `Cisco integration page <https://www.ansible.com/integrations/networks/cisco>`_.
119
120
121
122 Examples
123 --------
124
125 .. code-block:: yaml
126
127 - name: configure the exec banner
128 cisco.nxos.nxos_banner:
129 banner: exec
130 text: |
131 this is my exec banner
132 that contains a multiline
133 string
134 state: present
135 - name: remove the motd banner
136 cisco.nxos.nxos_banner:
137 banner: motd
138 state: absent
139 - name: Configure banner from file
140 cisco.nxos.nxos_banner:
141 banner: motd
142 text: "{{ lookup('file', './config_partial/raw_banner.cfg') }}"
143 state: present
144
145
146
147 Return Values
148 -------------
149 Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
150
151 .. raw:: html
152
153 <table border=0 cellpadding=0 class="documentation-table">
154 <tr>
155 <th colspan="1">Key</th>
156 <th>Returned</th>
157 <th width="100%">Description</th>
158 </tr>
159 <tr>
160 <td colspan="1">
161 <div class="ansibleOptionAnchor" id="return-"></div>
162 <b>commands</b>
163 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
164 <div style="font-size: small">
165 <span style="color: purple">list</span>
166 </div>
167 </td>
168 <td>always</td>
169 <td>
170 <div>The list of configuration mode commands to send to the device</div>
171 <br/>
172 <div style="font-size: smaller"><b>Sample:</b></div>
173 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;banner exec&#x27;, &#x27;this is my exec banner&#x27;, &#x27;that contains a multiline&#x27;, &#x27;string&#x27;]</div>
174 </td>
175 </tr>
176 </table>
177 <br/><br/>
178
179
180 Status
181 ------
182
183
184 Authors
185 ~~~~~~~
186
187 - Trishna Guha (@trishnaguha)