Hi 
Thanks for your feedback 
I solved it using regular expression 

Bikram

Sent from my iPhone

> On Apr 2, 2019, at 11:28 PM, P. Varsha <[email protected]> wrote:
> 
> Hello,
> I am not working on cisco switches but try once - "show run interface 
> "\Gi9/1\" | i no cdp" .
> check your commands once your using - "show run interface \" right because of 
> that you got error.
> 
> Thanks
> 
> 
>> On Tue, Apr 2, 2019 at 8:28 AM bikram40 <[email protected]> wrote:
>> Hello,
>> 
>> I am running an audit against some interfaces on Cisco switches:
>> Here is the task:
>> - ios_command:
>>     provider: "{{ cli }}"
>>     commands: show run interface "{{ item }}" | i no cdp
>>     timeout: 15
>>   register: no_cdp
>>   with_items: "{{ interface_all.stdout_lines }}"
>> 
>> From with_items the value of variables passing as "show run interface 
>> \"Gi9/1\" | i no cdp" which gives me an error as it has \" in both leading 
>> and trailing side of interface name.
>> 
>> I tried  | regex_replace after item to avoid these two characters but no 
>> luck.
>> 
>> Could you please help.
>> 
>> Thanks,
>> Bikram Biswas
>> 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/CAEFfMJTTQEjjBHUq_iXjPSH5iAwB6unSYws%2BrKbk%2B79Eg2e58Q%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/CAA3T03%2BUff_ftstzjB6Tv9TW8F-Q-2-vscLR0GqV44AzDnLT9g%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4B13253B-E467-4EA6-92F5-50120B1AAE3D%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to