<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Ansible IOS_config prompts in Network Devices</title>
    <link>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/4932166#M404</link>
    <description>&lt;P&gt;Thanks for the response.&amp;nbsp; I've actually tried cli_command and cli_config already and thought it would work but I get a "connection type local is not valid for this module".&amp;nbsp; I tried to add ansible_connection: network_cli but it didn't make a difference.&amp;nbsp; not sure what to try next to get cli_command or cli_config to work.&lt;/P&gt;</description>
    <pubDate>Sun, 01 Oct 2023 22:01:57 GMT</pubDate>
    <dc:creator>EditWu</dc:creator>
    <dc:date>2023-10-01T22:01:57Z</dc:date>
    <item>
      <title>Ansible IOS_config prompts</title>
      <link>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/4931789#M402</link>
      <description>&lt;P&gt;Hello, I'm trying to convert our current switch configuration to IBNS configuration for 802.1x with ansible but ran into an issue that i'm trying to figure out. &amp;nbsp;I can get ansible to write "authentication display new-style" and remove some of the default lines that it generates like the class-map type control ... but when I get ansible to remove the policy-map type control.... lines it prompts with a message basically asking if i'm sure and expects a yes. &amp;nbsp;From what i've been reading, the ios_config modules waits for hostname(config)# to show back up before sending the next command and because of this ansible times out waiting for that prompt. &amp;nbsp;I've tied to use the cli_config module as well but it says that it doesn't support a connection type of local. &amp;nbsp;I'm not 100% sure what that means but is there a way to get the ios_config module to look for a different prompt so that i can continue? &amp;nbsp;Or ignore prompts so that i can send a "yes"? &amp;nbsp;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 22:07:56 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/4931789#M402</guid>
      <dc:creator>EditWu</dc:creator>
      <dc:date>2023-09-29T22:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible IOS_config prompts</title>
      <link>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/4932049#M403</link>
      <description>&lt;P&gt;Hi, try the cli_command module which is part of the ansible.netcommon collection. This module has prompt and answer parameters, which should do the trick. In order to use it in config mode there is an example provided (you need to adjust this to your case):&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;- name: run config mode command and handle prompt/answer
  ansible.netcommon.cli_command:
    command: '{{ item }}'
    prompt:
      - Exit with uncommitted changes
    answer: y
  loop:
    - configure
    - set system syslog file test any any
    - exit&lt;/LI-CODE&gt;
&lt;P&gt;&lt;A href="https://docs.ansible.com/ansible/latest/collections/ansible/netcommon/cli_command_module.html#ansible-collections-ansible-netcommon-cli-command-module" target="_blank"&gt;https://docs.ansible.com/ansible/latest/collections/ansible/netcommon/cli_command_module.html#ansible-collections-ansible-netcommon-cli-command-module&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Oct 2023 07:14:43 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/4932049#M403</guid>
      <dc:creator>Marcel Zehnder</dc:creator>
      <dc:date>2023-10-01T07:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible IOS_config prompts</title>
      <link>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/4932166#M404</link>
      <description>&lt;P&gt;Thanks for the response.&amp;nbsp; I've actually tried cli_command and cli_config already and thought it would work but I get a "connection type local is not valid for this module".&amp;nbsp; I tried to add ansible_connection: network_cli but it didn't make a difference.&amp;nbsp; not sure what to try next to get cli_command or cli_config to work.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Oct 2023 22:01:57 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/4932166#M404</guid>
      <dc:creator>EditWu</dc:creator>
      <dc:date>2023-10-01T22:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible IOS_config prompts</title>
      <link>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/4932676#M405</link>
      <description>&lt;P&gt;Can you try&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;ansible_connection: ansible.netcommon.network_cli&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 02 Oct 2023 14:08:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/4932676#M405</guid>
      <dc:creator>Marcel Zehnder</dc:creator>
      <dc:date>2023-10-02T14:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible IOS_config prompts</title>
      <link>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/4932719#M406</link>
      <description>&lt;P&gt;I've tried that also and I get the following, "conflicting action statements: ansible_connection, ansible.netcommon.cli_command"&lt;/P&gt;&lt;P&gt;Would setting ansible_connection elseware override whatever is defined in this block or would this take precedence?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 14:50:50 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/4932719#M406</guid>
      <dc:creator>EditWu</dc:creator>
      <dc:date>2023-10-02T14:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible IOS_config prompts</title>
      <link>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/4932793#M407</link>
      <description>&lt;P&gt;I would just configure it in the inventory.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 15:58:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/4932793#M407</guid>
      <dc:creator>Marcel Zehnder</dc:creator>
      <dc:date>2023-10-02T15:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible IOS_config prompts</title>
      <link>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/5209225#M508</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;Did you find a solution ? I am facing the exact same issue while converting switch to IBNS2.&lt;/P&gt;&lt;P&gt;I have tried both&amp;nbsp;ansible.netcommon.cli_command and&amp;nbsp;cisco.ios.ios_config.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 19:10:59 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/5209225#M508</guid>
      <dc:creator>cnezakaren</dc:creator>
      <dc:date>2024-10-15T19:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible IOS_config prompts</title>
      <link>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/5209299#M509</link>
      <description>&lt;P&gt;We actually did. &amp;nbsp;I'm not 100% sure if cli_command: is the same as net_common.cli_command. &amp;nbsp;If so, I should accept the previous message as a solution. &amp;nbsp; I apologize for that if I should have done it earlier but I had to get some help as there were vars that needed to be set in order for cli_command to work. &amp;nbsp; But I would assume the vars in the local task would depend on your environment. &amp;nbsp;What we used under cli_command looked like this.&lt;/P&gt;&lt;P&gt;cli_command:&lt;/P&gt;&lt;P&gt;&amp;nbsp; command:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;configure terminal&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;authentication convert-to new-style&lt;/P&gt;&lt;P&gt;&amp;nbsp; prompt:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; - "^Do you wish to continue? &amp;nbsp;.*$"&lt;/P&gt;&lt;P&gt;&amp;nbsp; answer: "yes"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 23:41:11 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/5209299#M509</guid>
      <dc:creator>EditWu</dc:creator>
      <dc:date>2024-10-15T23:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible IOS_config prompts</title>
      <link>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/5209423#M510</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I still have something wrong, it's not working for me with this following lines :&lt;/P&gt;&lt;P&gt;&lt;EM&gt;tasks: &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- name : IBNS2&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;cli_command:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;command: &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- configure terminal&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- authentication convert-to new-style&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;prompt :&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- "^Do you wish to continue? .*$" &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;answer: "yes"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Which vars did you need to set in order for cli_command to work ?&lt;/P&gt;&lt;P&gt;Here are mines :&amp;nbsp;&lt;/P&gt;&lt;P&gt;[all:vars]&lt;BR /&gt;&lt;EM&gt;ansible_connection=ansible.netcommon.network_cli&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ansible_network_cli_ssh_type=libssh&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ansible_ssh_user=xxxx&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ansible_ssh_pass=xxx&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ansible_become=true&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ansible_become_method=enable&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ansible_become_pass=xxx&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 07:17:31 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/5209423#M510</guid>
      <dc:creator>cnezakaren</dc:creator>
      <dc:date>2024-10-16T07:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible IOS_config prompts</title>
      <link>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/5209426#M511</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Here are the errors I am getting, it seems to be related with difficult to access in configuration mode :&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/231386i575115C360F831FB/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# ansible --version&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ansible [core 2.15.12]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;config file = /var/www/html/IOS/ansible.cfg&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ansible python module location = /usr/local/lib/python3.9/site-packages/ansible&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;executable location = /usr/local/bin/ansible&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;python version = 3.9.1 (default, Oct 9 2024, 11:45:58) [GCC 8.5.0 20210514 (Red Hat 8.5.0-22)] (/usr/local/bin/python3.9)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;jinja version = 3.1.4&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;libyaml = True&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 07:40:27 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/5209426#M511</guid>
      <dc:creator>cnezakaren</dc:creator>
      <dc:date>2024-10-16T07:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible IOS_config prompts</title>
      <link>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/5209871#M512</link>
      <description>&lt;P&gt;my vars are more or less the same. &amp;nbsp;Looks like it's not related to vars but what is being sent to the switch. &amp;nbsp;I'm not at a spot to test this task but try to remove the "-" next to configure terminal and&amp;nbsp;&lt;EM&gt;authentication convert-to new-style &lt;/EM&gt;in your section. &amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what mine looks like.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EditWu_0-1729117647906.png" style="width: 400px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/231455i87526D97932B1B73/image-size/medium?v=v2&amp;amp;px=400" role="button" title="EditWu_0-1729117647906.png" alt="EditWu_0-1729117647906.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 22:27:56 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/5209871#M512</guid>
      <dc:creator>EditWu</dc:creator>
      <dc:date>2024-10-16T22:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible IOS_config prompts</title>
      <link>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/5210200#M513</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1603826"&gt;@EditWu&lt;/a&gt;&amp;nbsp;, I was missing the "|" next to command: and removed the "-" to make it work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 11:03:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-devices/ansible-ios-config-prompts/m-p/5210200#M513</guid>
      <dc:creator>cnezakaren</dc:creator>
      <dc:date>2024-10-17T11:03:05Z</dc:date>
    </item>
  </channel>
</rss>

