# cisco.ios.ios\_config failing for dhcp snooping

**URL:** <https://forum.ansible.com/t/cisco-ios-ios-config-failing-for-dhcp-snooping/35862>\
**Category:** Ansible Developer\
**Created:** [October 13, 2021, 7:04pm UTC](https://forum.ansible.com/t/cisco-ios-ios-config-failing-for-dhcp-snooping/35862 "2021-10-13T19:04:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Madill](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@James\_Madill](https://forum.ansible.com/u/James_Madill)\
**Post date:** [October 13, 2021, 7:04pm UTC](https://forum.ansible.com/t/cisco-ios-ios-config-failing-for-dhcp-snooping/35862/1 "2021-10-13T19:04:29Z")

</div>

Help.

I am receiving a seemingly odd error when trying to assign multiple non-contiguous VLANs using the cisco ios\_config module (latest). Below is the playbook.

It runs just fine if there is only one vlan listed, or if there is a range listed (both with a space between them and a hyphen). But the moment Ansible sees that first comma, the job blows up.

---

<div class="post-metadata">

**Author:** ![James\_Madill](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@James\_Madill](https://forum.ansible.com/u/James_Madill)\
**Post date:** [October 13, 2021, 7:47pm UTC](https://forum.ansible.com/t/cisco-ios-ios-config-failing-for-dhcp-snooping/35862/2 "2021-10-13T19:47:05Z")

</div>

Well, I figured out how to have commas in the config command. Rather than having the ‘lines:’ variable being a string, have it be a list with the first entry being the config command:

- name: Issue out dhcp snooping config info  
cisco.ios.ios\_config:  
lines:
- ip dhcp snooping vlan 666,684,784  
register: commandOutput

But this still does not explain why I could issue the one vlan or range of vlans as a single line…
