blob: 2c7bc248cd355db9a57a9d797a0df9b3fbd60b90 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
.. _cisco.ios.ios_cliconf:
*************
cisco.ios.ios
*************
**Use ios cliconf to run command on Cisco IOS platform**
Version added: 1.0.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- This ios plugin provides low level abstraction apis for sending and receiving CLI commands from Cisco IOS network devices.
Parameters
----------
.. raw:: html
<table border=0 cellpadding=0 class="documentation-table">
<tr>
<th colspan="1">Parameter</th>
<th>Choices/<font color="blue">Defaults</font></th>
<th>Configuration</th>
<th width="100%">Comments</th>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>commit_confirm_immediate</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<b>Default:</b><br/><div style="color: blue">"no"</div>
</td>
<td>
<div>env:ANSIBLE_IOS_COMMIT_CONFIRM_IMMEDIATE</div>
<div>var: ansible_ios_commit_confirm_immediate</div>
</td>
<td>
<div>Enable or disable commit confirm mode.</div>
<div>Confirms the configuration pushed after a custom/ default timeout.(default 1 minute).</div>
<div>For custom timeout configuration set commit_confirm_timeout value.</div>
<div>On commit_confirm_immediate default value for commit_confirm_timeout is considered 1 minute when variable in not explicitly declared.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>commit_confirm_timeout</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">integer</span>
</div>
</td>
<td>
</td>
<td>
<div>env:ANSIBLE_IOS_COMMIT_CONFIRM_TIMEOUT</div>
<div>var: ansible_ios_commit_confirm_timeout</div>
</td>
<td>
<div>Commits the configuration on a trial basis for the time specified in minutes.</div>
<div>Using commit_confirm_timeout without specifying commit_confirm_immediate would need an explicit <code>configure confirm</code> using the ios_command module to confirm/commit the changes made.</div>
<div>Refer to example for a use case demonstration.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>config_commands</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
/ <span style="color: purple">elements=string</span>
</div>
<div style="font-style: italic; font-size: small; color: darkgreen">added in 2.0.0</div>
</td>
<td>
<b>Default:</b><br/><div style="color: blue">[]</div>
</td>
<td>
<div>var: ansible_ios_config_commands</div>
</td>
<td>
<div>Specifies a list of commands that can make configuration changes to the target device.</div>
<div>When `ansible_network_single_user_mode` is enabled, if a command sent to the device is present in this list, the existing cache is invalidated.</div>
</td>
</tr>
</table>
<br/>
Examples
--------
.. code-block:: yaml
# NOTE - IOS waits for a `configure confirm` when the configure terminal
# command executed is `configure terminal revert timer <timeout>` within the timeout
# period for the configuration to commit successfully, else a rollback
# happens.
# Use commit confirm with timeout and confirm the commit explicitly
- name: Example commit confirmed
vars:
ansible_ios_commit_confirm_timeout: 1
tasks:
- name: "Commit confirmed with timeout"
cisco.ios.ios_hostname:
state: merged
config:
hostname: R1
- name: "Confirm the Commit"
cisco.ios.ios_command:
commands:
- configure confirm
# Commands fired
# - configure terminal revert timer 1 (cliconf specific)
# - hostname R1 (from hostname resource module)
# - configure confirm (from ios_command module)
# Use commit confirm with timeout and confirm the commit via cliconf
- name: Example commit confirmed
vars:
ansible_ios_commit_confirm_immediate: True
ansible_ios_commit_confirm_timeout: 3
tasks:
- name: "Commit confirmed with timeout"
cisco.ios.ios_hostname:
state: merged
config:
hostname: R1
# Commands fired
# - configure terminal revert timer 3 (cliconf specific)
# - hostname R1 (from hostname resource module)
# - configure confirm (cliconf specific)
# Use commit confirm via cliconf using default timeout
- name: Example commit confirmed
vars:
ansible_ios_commit_confirm_immediate: True
tasks:
- name: "Commit confirmed with timeout"
cisco.ios.ios_hostname:
state: merged
config:
hostname: R1
# Commands fired
# - configure terminal revert timer 1 (cliconf specific with default timeout)
# - hostname R1 (from hostname resource module)
# - configure confirm (cliconf specific)
Status
------
Authors
~~~~~~~
- Ansible Networking Team (@ansible-network)
.. hint::
Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.
|