| 1 |
.. _cisco.nxos.nxos_install_os_module: |
| 2 |
|
| 3 |
|
| 4 |
************************** |
| 5 |
cisco.nxos.nxos_install_os |
| 6 |
************************** |
| 7 |
|
| 8 |
**Set boot options like boot, kickstart image and issu.** |
| 9 |
|
| 10 |
|
| 11 |
Version added: 1.0.0 |
| 12 |
|
| 13 |
.. contents:: |
| 14 |
:local: |
| 15 |
:depth: 1 |
| 16 |
|
| 17 |
|
| 18 |
Synopsis |
| 19 |
-------- |
| 20 |
- Install an operating system by setting the boot options like boot image and kickstart image and optionally select to install using ISSU (In Server Software Upgrade). |
| 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>issu</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 |
</div> |
| 44 |
</td> |
| 45 |
<td> |
| 46 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 47 |
<li>required</li> |
| 48 |
<li>desired</li> |
| 49 |
<li>yes</li> |
| 50 |
<li><div style="color: blue"><b>no</b> ←</div></li> |
| 51 |
</ul> |
| 52 |
</td> |
| 53 |
<td> |
| 54 |
<div>Upgrade using In Service Software Upgrade (ISSU). (Supported on N5k, N7k, N9k platforms)</div> |
| 55 |
<div>Selecting 'required' or 'yes' means that upgrades will only proceed if the switch is capable of ISSU.</div> |
| 56 |
<div>Selecting 'desired' means that upgrades will use ISSU if possible but will fall back to disruptive upgrade if needed.</div> |
| 57 |
<div>Selecting 'no' means do not use ISSU. Forced disruptive.</div> |
| 58 |
</td> |
| 59 |
</tr> |
| 60 |
<tr> |
| 61 |
<td colspan="1"> |
| 62 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 63 |
<b>kickstart_image_file</b> |
| 64 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 65 |
<div style="font-size: small"> |
| 66 |
<span style="color: purple">string</span> |
| 67 |
</div> |
| 68 |
</td> |
| 69 |
<td> |
| 70 |
</td> |
| 71 |
<td> |
| 72 |
<div>Name of the kickstart image file on flash. (Not required on all Nexus platforms)</div> |
| 73 |
</td> |
| 74 |
</tr> |
| 75 |
<tr> |
| 76 |
<td colspan="1"> |
| 77 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 78 |
<b>system_image_file</b> |
| 79 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 80 |
<div style="font-size: small"> |
| 81 |
<span style="color: purple">string</span> |
| 82 |
/ <span style="color: red">required</span> |
| 83 |
</div> |
| 84 |
</td> |
| 85 |
<td> |
| 86 |
</td> |
| 87 |
<td> |
| 88 |
<div>Name of the system (or combined) image file on flash.</div> |
| 89 |
</td> |
| 90 |
</tr> |
| 91 |
</table> |
| 92 |
<br/> |
| 93 |
|
| 94 |
|
| 95 |
Notes |
| 96 |
----- |
| 97 |
|
| 98 |
.. note:: |
| 99 |
- Tested against the following platforms and images - N9k 7.0(3)I4(6), 7.0(3)I5(3), 7.0(3)I6(1), 7.0(3)I7(1), 7.0(3)F2(2), 7.0(3)F3(2) - N3k 6.0(2)A8(6), 6.0(2)A8(8), 7.0(3)I6(1), 7.0(3)I7(1) - N7k 7.3(0)D1(1), 8.0(1), 8.1(1), 8.2(1) |
| 100 |
- Tested against Cisco MDS NX-OS 9.2(1) |
| 101 |
- This module requires both the ANSIBLE_PERSISTENT_CONNECT_TIMEOUT and ANSIBLE_PERSISTENT_COMMAND_TIMEOUT timers to be set to 600 seconds or higher. The module will exit if the timers are not set properly. |
| 102 |
- When using connection local, ANSIBLE_PERSISTENT_CONNECT_TIMEOUT and ANSIBLE_PERSISTENT_COMMAND_TIMEOUT can only be set using ENV variables or the ansible.cfg file. |
| 103 |
- Do not include full file paths, just the name of the file(s) stored on the top level flash directory. |
| 104 |
- This module attempts to install the software immediately, which may trigger a reboot. |
| 105 |
- In check mode, the module will indicate if an upgrade is needed and whether or not the upgrade is disruptive or non-disruptive(ISSU). |
| 106 |
- For information on using CLI and NX-API see the :ref:`NXOS Platform Options guide <nxos_platform_options>` |
| 107 |
- For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>` |
| 108 |
- For more information on using Ansible to manage Cisco devices see the `Cisco integration page <https://www.ansible.com/integrations/networks/cisco>`_. |
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
Examples |
| 113 |
-------- |
| 114 |
|
| 115 |
.. code-block:: yaml |
| 116 |
|
| 117 |
- name: Install OS on N9k |
| 118 |
check_mode: false |
| 119 |
cisco.nxos.nxos_install_os: |
| 120 |
system_image_file: nxos.7.0.3.I6.1.bin |
| 121 |
issu: desired |
| 122 |
|
| 123 |
- name: Wait for device to come back up with new image |
| 124 |
wait_for: |
| 125 |
port: 22 |
| 126 |
state: started |
| 127 |
timeout: 500 |
| 128 |
delay: 60 |
| 129 |
host: '{{ inventory_hostname }}' |
| 130 |
|
| 131 |
- name: Check installed OS for newly installed version |
| 132 |
nxos_command: |
| 133 |
commands: [show version | json] |
| 134 |
register: output |
| 135 |
|
| 136 |
- assert: |
| 137 |
that: |
| 138 |
- output['stdout'][0]['kickstart_ver_str'] == '7.0(3)I6(1)' |
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
Return Values |
| 143 |
------------- |
| 144 |
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: |
| 145 |
|
| 146 |
.. raw:: html |
| 147 |
|
| 148 |
<table border=0 cellpadding=0 class="documentation-table"> |
| 149 |
<tr> |
| 150 |
<th colspan="1">Key</th> |
| 151 |
<th>Returned</th> |
| 152 |
<th width="100%">Description</th> |
| 153 |
</tr> |
| 154 |
<tr> |
| 155 |
<td colspan="1"> |
| 156 |
<div class="ansibleOptionAnchor" id="return-"></div> |
| 157 |
<b>install_state</b> |
| 158 |
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> |
| 159 |
<div style="font-size: small"> |
| 160 |
<span style="color: purple">dictionary</span> |
| 161 |
</div> |
| 162 |
</td> |
| 163 |
<td>always</td> |
| 164 |
<td> |
| 165 |
<div>Boot and install information.</div> |
| 166 |
<br/> |
| 167 |
<div style="font-size: smaller"><b>Sample:</b></div> |
| 168 |
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">{'install_state': ['Compatibility check is done:', 'Module bootable Impact Install-type Reason', '------ -------- -------------- ------------ ------', ' 1 yes non-disruptive reset ', 'Images will be upgraded according to following table:', 'Module Image Running-Version(pri:alt) New-Version Upg-Required', '------ ---------- ---------------------------------------- -------------------- ------------', ' 1 nxos 7.0(3)I6(1) 7.0(3)I7(1) yes', ' 1 bios v4.4.0(07/12/2017) v4.4.0(07/12/2017) no']}</div> |
| 169 |
</td> |
| 170 |
</tr> |
| 171 |
</table> |
| 172 |
<br/><br/> |
| 173 |
|
| 174 |
|
| 175 |
Status |
| 176 |
------ |
| 177 |
|
| 178 |
|
| 179 |
Authors |
| 180 |
~~~~~~~ |
| 181 |
|
| 182 |
- Jason Edelman (@jedelman8) |
| 183 |
- Gabriele Gerbibo (@GGabriele) |