Debian Codegraph @

ansible_collections/cisco/iosxr/docs/cisco.iosxr.iosxr_system_module.rst

raw
1 .. _cisco.iosxr.iosxr_system_module:
2
3
4 ************************
5 cisco.iosxr.iosxr_system
6 ************************
7
8 **Module to manage the system attributes.**
9
10
11 Version added: 1.0.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - This module provides declarative management of node system attributes on Cisco IOS XR devices. It provides an option to configure host system parameters or remove those parameters from the device active configuration.
21
22
23
24 Requirements
25 ------------
26 The below requirements are needed on the host that executes this module.
27
28 - ncclient >= 0.5.3 when using netconf
29 - lxml >= 4.1.1 when using netconf
30
31
32 Parameters
33 ----------
34
35 .. raw:: html
36
37 <table border=0 cellpadding=0 class="documentation-table">
38 <tr>
39 <th colspan="1">Parameter</th>
40 <th>Choices/<font color="blue">Defaults</font></th>
41 <th width="100%">Comments</th>
42 </tr>
43 <tr>
44 <td colspan="1">
45 <div class="ansibleOptionAnchor" id="parameter-"></div>
46 <b>domain_name</b>
47 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
48 <div style="font-size: small">
49 <span style="color: purple">string</span>
50 </div>
51 </td>
52 <td>
53 </td>
54 <td>
55 <div>Configure the IP domain name on the remote device to the provided value. Value should be in the dotted name form and will be appended to the <code>hostname</code> to create a fully-qualified domain name.</div>
56 </td>
57 </tr>
58 <tr>
59 <td colspan="1">
60 <div class="ansibleOptionAnchor" id="parameter-"></div>
61 <b>domain_search</b>
62 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
63 <div style="font-size: small">
64 <span style="color: purple">list</span>
65 / <span style="color: purple">elements=string</span>
66 </div>
67 </td>
68 <td>
69 </td>
70 <td>
71 <div>Provides the list of domain suffixes to append to the hostname for the purpose of doing name resolution. This argument accepts a list of names and will be reconciled with the current active configuration on the running node.</div>
72 </td>
73 </tr>
74 <tr>
75 <td colspan="1">
76 <div class="ansibleOptionAnchor" id="parameter-"></div>
77 <b>hostname</b>
78 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
79 <div style="font-size: small">
80 <span style="color: purple">string</span>
81 </div>
82 </td>
83 <td>
84 </td>
85 <td>
86 <div>Configure the device hostname parameter. This option takes an ASCII string value.</div>
87 </td>
88 </tr>
89 <tr>
90 <td colspan="1">
91 <div class="ansibleOptionAnchor" id="parameter-"></div>
92 <b>lookup_enabled</b>
93 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
94 <div style="font-size: small">
95 <span style="color: purple">boolean</span>
96 </div>
97 </td>
98 <td>
99 <ul style="margin: 0; padding: 0"><b>Choices:</b>
100 <li>no</li>
101 <li><div style="color: blue"><b>yes</b>&nbsp;&larr;</div></li>
102 </ul>
103 </td>
104 <td>
105 <div>Provides administrative control for enabling or disabling DNS lookups. When this argument is set to True, lookups are performed and when it is set to False, lookups are not performed.</div>
106 </td>
107 </tr>
108 <tr>
109 <td colspan="1">
110 <div class="ansibleOptionAnchor" id="parameter-"></div>
111 <b>lookup_source</b>
112 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
113 <div style="font-size: small">
114 <span style="color: purple">string</span>
115 </div>
116 </td>
117 <td>
118 </td>
119 <td>
120 <div>The <code>lookup_source</code> argument provides one or more source interfaces to use for performing DNS lookups. The interface provided in <code>lookup_source</code> must be a valid interface configured on the device.</div>
121 </td>
122 </tr>
123 <tr>
124 <td colspan="1">
125 <div class="ansibleOptionAnchor" id="parameter-"></div>
126 <b>name_servers</b>
127 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
128 <div style="font-size: small">
129 <span style="color: purple">list</span>
130 / <span style="color: purple">elements=string</span>
131 </div>
132 </td>
133 <td>
134 </td>
135 <td>
136 <div>The <code>name_serves</code> argument accepts a list of DNS name servers by way of either FQDN or IP address to use to perform name resolution lookups. This argument accepts wither a list of DNS servers See examples.</div>
137 </td>
138 </tr>
139 <tr>
140 <td colspan="1">
141 <div class="ansibleOptionAnchor" id="parameter-"></div>
142 <b>state</b>
143 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
144 <div style="font-size: small">
145 <span style="color: purple">string</span>
146 </div>
147 </td>
148 <td>
149 <ul style="margin: 0; padding: 0"><b>Choices:</b>
150 <li><div style="color: blue"><b>present</b>&nbsp;&larr;</div></li>
151 <li>absent</li>
152 </ul>
153 </td>
154 <td>
155 <div>State of the configuration values in the device&#x27;s current active configuration. When set to <em>present</em>, the values should be configured in the device active configuration and when set to <em>absent</em> the values should not be in the device active configuration</div>
156 </td>
157 </tr>
158 <tr>
159 <td colspan="1">
160 <div class="ansibleOptionAnchor" id="parameter-"></div>
161 <b>vrf</b>
162 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
163 <div style="font-size: small">
164 <span style="color: purple">string</span>
165 </div>
166 </td>
167 <td>
168 <b>Default:</b><br/><div style="color: blue">"default"</div>
169 </td>
170 <td>
171 <div>VRF name for domain services</div>
172 </td>
173 </tr>
174 </table>
175 <br/>
176
177
178 Notes
179 -----
180
181 .. note::
182 - This module works with connection ``network_cli`` and ``netconf``. See `the IOS-XR Platform Options <../network/user_guide/platform_iosxr.html>`_.
183 - name-servers *state=absent* operation with ``netconf`` transport is a success, but with rpc-error. This is due to XR platform issue. Recommended to use *ignore_errors* option with the task as a workaround.
184 - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>`
185 - For more information on using Ansible to manage Cisco devices see the `Cisco integration page <https://www.ansible.com/integrations/networks/cisco>`_.
186
187
188
189 Examples
190 --------
191
192 .. code-block:: yaml
193
194 - name: configure hostname and domain-name (default vrf=default)
195 cisco.iosxr.iosxr_system:
196 hostname: iosxr01
197 domain_name: test.example.com
198 domain_search:
199 - ansible.com
200 - redhat.com
201 - cisco.com
202 - name: remove configuration
203 cisco.iosxr.iosxr_system:
204 hostname: iosxr01
205 domain_name: test.example.com
206 domain_search:
207 - ansible.com
208 - redhat.com
209 - cisco.com
210 state: absent
211 - name: configure hostname and domain-name with vrf
212 cisco.iosxr.iosxr_system:
213 hostname: iosxr01
214 vrf: nondefault
215 domain_name: test.example.com
216 domain_search:
217 - ansible.com
218 - redhat.com
219 - cisco.com
220 - name: configure DNS lookup sources
221 cisco.iosxr.iosxr_system:
222 lookup_source: MgmtEth0/0/CPU0/0
223 lookup_enabled: true
224 - name: configure name servers
225 cisco.iosxr.iosxr_system:
226 name_servers:
227 - 8.8.8.8
228 - 8.8.4.4
229
230
231
232 Return Values
233 -------------
234 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:
235
236 .. raw:: html
237
238 <table border=0 cellpadding=0 class="documentation-table">
239 <tr>
240 <th colspan="1">Key</th>
241 <th>Returned</th>
242 <th width="100%">Description</th>
243 </tr>
244 <tr>
245 <td colspan="1">
246 <div class="ansibleOptionAnchor" id="return-"></div>
247 <b>commands</b>
248 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
249 <div style="font-size: small">
250 <span style="color: purple">list</span>
251 </div>
252 </td>
253 <td>always</td>
254 <td>
255 <div>The list of configuration mode commands to send to the device</div>
256 <br/>
257 <div style="font-size: smaller"><b>Sample:</b></div>
258 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;hostname iosxr01&#x27;, &#x27;ip domain-name test.example.com&#x27;]</div>
259 </td>
260 </tr>
261 <tr>
262 <td colspan="1">
263 <div class="ansibleOptionAnchor" id="return-"></div>
264 <b>xml</b>
265 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
266 <div style="font-size: small">
267 <span style="color: purple">list</span>
268 </div>
269 </td>
270 <td>always (empty list when no xml rpc to send)</td>
271 <td>
272 <div>NetConf rpc xml sent to device with transport <code>netconf</code></div>
273 <br/>
274 <div style="font-size: smaller"><b>Sample:</b></div>
275 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;&lt;config xmlns:xc=&quot;urn:ietf:params:xml:ns:netconf:base:1.0&quot;&gt; &lt;ip-domain xmlns=&quot;http://cisco.com/ns/yang/Cisco-IOS-XR-ip-domain-cfg&quot;&gt; &lt;vrfs&gt; &lt;vrf&gt; &lt;vrf-name&gt;default&lt;/vrf-name&gt; &lt;lists&gt; &lt;list xc:operation=&quot;merge&quot;&gt; &lt;order&gt;0&lt;/order&gt; &lt;list-name&gt;redhat.com&lt;/list-name&gt; &lt;/list&gt; &lt;/lists&gt; &lt;/vrf&gt; &lt;/vrfs&gt; &lt;/ip-domain&gt; &lt;/config&gt;&#x27;]</div>
276 </td>
277 </tr>
278 </table>
279 <br/><br/>
280
281
282 Status
283 ------
284
285
286 Authors
287 ~~~~~~~
288
289 - Peter Sprygada (@privateip)
290 - Kedar Kekan (@kedarX)