Debian Codegraph @

ansible_collections/cisco/ios/docs/cisco.ios.ios_cliconf.rst

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