# Ansible cisco\_ios. Change Tunnel Interface Only Settings

**URL:** <https://forum.ansible.com/t/ansible-cisco-ios-change-tunnel-interface-only-settings/35448>\
**Category:** Ansible Project\
**Created:** [July 1, 2021, 1:09pm UTC](https://forum.ansible.com/t/ansible-cisco-ios-change-tunnel-interface-only-settings/35448 "2021-07-01T13:09:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![user107](https://avatars.discourse-cdn.com/v4/letter/u/e19adc/32.png) [@user107](https://forum.ansible.com/u/user107)\
**Post date:** [July 1, 2021, 1:09pm UTC](https://forum.ansible.com/t/ansible-cisco-ios-change-tunnel-interface-only-settings/35448/1 "2021-07-01T13:09:51Z")

</div>

I collect information about interfaces and after that I need to add the command “no cdp enable” in the tunnels. With the first part, it somehow worked out, but now how to select only the tunnels and add information?

tasks:

- name: Gather facts (ios)  
cisco.ios.ios\_facts:  
gather\_subset: min  
gather\_network\_resources:

- l3\_interfaces

- name: Store facts to host\_vars  
copy: content: “{{ ansible\_network\_resources | dict2items }}”  
dest: “{{ playbook\_dir }}/backup/{{ inventory\_hostname }}”

- name: configure interface settings  
cisco.ios.ios\_config:  
lines:

- no cdp enable  
parents: **interface {{ ansible\_network\_resources.l3\_interfaces[‘name’] }}** # what is the format of this string?  
.  
.  
.  
[{“key”: “l3\_interfaces”, “value”: [{“name”: “Tunnel1”, “ipv4”: [{“address”: “10.111.22.23 255.255.255.224”}]}, {“name”: “Tunnel2”, “ipv4”: [{“address”: “10.111.24.23 255.255.255.224”}]}, {“name”: “FastEthernet0/0”}, {“name”: “FastEthernet0/0.1”, “ipv4”: [{“address”: “10.205.23.2 255.255.255.0”}]}, {“name”: “FastEthernet0/0.2”, “ipv4”: [{“address”: “10.205.254.197 255.255.255.252”}]}, {“name”: “FastEthernet0/0.3”, “ipv4”: [{“address”: “10.111.210.82 255.255.255.252”}]}, {“name”: “FastEthernet0/1”}, {“name”: “FastEthernet0/1.3”, “ipv4”: [{“address”: “10.111.21.82 255.255.255.252”}]}, {“name”: “Serial0/2/0”}, {“name”: “Serial0/2/1”}]}]
