| 1 |
.. _cisco.ios.ios_system_module: |
| 2 |
|
| 3 |
|
| 4 |
******************** |
| 5 |
cisco.ios.ios_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 devices. It provides an option to configure host system parameters or remove those parameters from the device active 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>domain_name</b> |
| 40 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 41 |
<div style="font-size: small"> |
| 42 |
<span style="color: purple">list</span> |
| 43 |
/ <span style="color: purple">elements=raw</span> |
| 44 |
</div> |
| 45 |
</td> |
| 46 |
<td> |
| 47 |
</td> |
| 48 |
<td> |
| 49 |
<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> |
| 50 |
</td> |
| 51 |
</tr> |
| 52 |
<tr> |
| 53 |
<td colspan="1"> |
| 54 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 55 |
<b>domain_search</b> |
| 56 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 57 |
<div style="font-size: small"> |
| 58 |
<span style="color: purple">list</span> |
| 59 |
/ <span style="color: purple">elements=raw</span> |
| 60 |
</div> |
| 61 |
</td> |
| 62 |
<td> |
| 63 |
</td> |
| 64 |
<td> |
| 65 |
<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> |
| 66 |
</td> |
| 67 |
</tr> |
| 68 |
<tr> |
| 69 |
<td colspan="1"> |
| 70 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 71 |
<b>hostname</b> |
| 72 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 73 |
<div style="font-size: small"> |
| 74 |
<span style="color: purple">string</span> |
| 75 |
</div> |
| 76 |
</td> |
| 77 |
<td> |
| 78 |
</td> |
| 79 |
<td> |
| 80 |
<div>Configure the device hostname parameter. This option takes an ASCII string value.</div> |
| 81 |
</td> |
| 82 |
</tr> |
| 83 |
<tr> |
| 84 |
<td colspan="1"> |
| 85 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 86 |
<b>lookup_enabled</b> |
| 87 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 88 |
<div style="font-size: small"> |
| 89 |
<span style="color: purple">boolean</span> |
| 90 |
</div> |
| 91 |
</td> |
| 92 |
<td> |
| 93 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 94 |
<li>no</li> |
| 95 |
<li>yes</li> |
| 96 |
</ul> |
| 97 |
</td> |
| 98 |
<td> |
| 99 |
<div>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> |
| 100 |
</td> |
| 101 |
</tr> |
| 102 |
<tr> |
| 103 |
<td colspan="1"> |
| 104 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 105 |
<b>lookup_source</b> |
| 106 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 107 |
<div style="font-size: small"> |
| 108 |
<span style="color: purple">string</span> |
| 109 |
</div> |
| 110 |
</td> |
| 111 |
<td> |
| 112 |
</td> |
| 113 |
<td> |
| 114 |
<div>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> |
| 115 |
</td> |
| 116 |
</tr> |
| 117 |
<tr> |
| 118 |
<td colspan="1"> |
| 119 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 120 |
<b>name_servers</b> |
| 121 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 122 |
<div style="font-size: small"> |
| 123 |
<span style="color: purple">list</span> |
| 124 |
/ <span style="color: purple">elements=raw</span> |
| 125 |
</div> |
| 126 |
</td> |
| 127 |
<td> |
| 128 |
</td> |
| 129 |
<td> |
| 130 |
<div>List of DNS name servers by IP address to use to perform name resolution lookups. This argument accepts either a list of DNS servers See examples.</div> |
| 131 |
</td> |
| 132 |
</tr> |
| 133 |
<tr> |
| 134 |
<td colspan="1"> |
| 135 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 136 |
<b>state</b> |
| 137 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 138 |
<div style="font-size: small"> |
| 139 |
<span style="color: purple">string</span> |
| 140 |
</div> |
| 141 |
</td> |
| 142 |
<td> |
| 143 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 144 |
<li><div style="color: blue"><b>present</b> ←</div></li> |
| 145 |
<li>absent</li> |
| 146 |
</ul> |
| 147 |
</td> |
| 148 |
<td> |
| 149 |
<div>State of the configuration values in the device'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> |
| 150 |
</td> |
| 151 |
</tr> |
| 152 |
</table> |
| 153 |
<br/> |
| 154 |
|
| 155 |
|
| 156 |
Notes |
| 157 |
----- |
| 158 |
|
| 159 |
.. note:: |
| 160 |
- Tested against Cisco IOSXE Version 17.3 on CML. |
| 161 |
- This module works with connection ``network_cli``. See https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html |
| 162 |
- For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>` |
| 163 |
- For more information on using Ansible to manage Cisco devices see the `Cisco integration page <https://www.ansible.com/integrations/networks/cisco>`_. |
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
Examples |
| 168 |
-------- |
| 169 |
|
| 170 |
.. code-block:: yaml |
| 171 |
|
| 172 |
- name: Configure hostname and domain name |
| 173 |
cisco.ios.ios_system: |
| 174 |
hostname: ios01 |
| 175 |
domain_name: test.example.com |
| 176 |
domain_search: |
| 177 |
- ansible.com |
| 178 |
- redhat.com |
| 179 |
- cisco.com |
| 180 |
|
| 181 |
- name: Remove configuration |
| 182 |
cisco.ios.ios_system: |
| 183 |
state: absent |
| 184 |
|
| 185 |
- name: Configure DNS lookup sources |
| 186 |
cisco.ios.ios_system: |
| 187 |
lookup_source: MgmtEth0/0/CPU0/0 |
| 188 |
lookup_enabled: true |
| 189 |
|
| 190 |
- name: Configure name servers |
| 191 |
cisco.ios.ios_system: |
| 192 |
name_servers: |
| 193 |
- 8.8.8.8 |
| 194 |
- 8.8.4.4 |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
Return Values |
| 199 |
------------- |
| 200 |
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: |
| 201 |
|
| 202 |
.. raw:: html |
| 203 |
|
| 204 |
<table border=0 cellpadding=0 class="documentation-table"> |
| 205 |
<tr> |
| 206 |
<th colspan="1">Key</th> |
| 207 |
<th>Returned</th> |
| 208 |
<th width="100%">Description</th> |
| 209 |
</tr> |
| 210 |
<tr> |
| 211 |
<td colspan="1"> |
| 212 |
<div class="ansibleOptionAnchor" id="return-"></div> |
| 213 |
<b>commands</b> |
| 214 |
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> |
| 215 |
<div style="font-size: small"> |
| 216 |
<span style="color: purple">list</span> |
| 217 |
</div> |
| 218 |
</td> |
| 219 |
<td>always</td> |
| 220 |
<td> |
| 221 |
<div>The list of configuration mode commands to send to the device</div> |
| 222 |
<br/> |
| 223 |
<div style="font-size: smaller"><b>Sample:</b></div> |
| 224 |
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">['hostname ios01', 'ip domain name test.example.com']</div> |
| 225 |
</td> |
| 226 |
</tr> |
| 227 |
</table> |
| 228 |
<br/><br/> |
| 229 |
|
| 230 |
|
| 231 |
Status |
| 232 |
------ |
| 233 |
|
| 234 |
|
| 235 |
Authors |
| 236 |
~~~~~~~ |
| 237 |
|
| 238 |
- Peter Sprygada (@privateip) |