napalm-automation / napalm-ansible

Apache License 2.0
245 stars 103 forks source link

npalm_install_merge.yml does not revert all changes #195

Open barryconstantly opened 3 years ago

barryconstantly commented 3 years ago

Hi,

I was using the replace = True option for full roll-back, but started to use merge.

This is a summary of what I am seeing, not sure why the entire interface content is not being removed:

  1. State of Cisco before napalm_install_merge execution:

! interface GigabitEthernet0/6 description Lab-Interface-with-trunk switchport mode trunk switchport nonegotiate spanning-tree portfast trunk !

  1. The 'config_merge_file.txt' contents:

interface GigabitEthernet0/6 no description Lab-Interface-with-trunk no switchport mode trunk no switchport nonegotiate no spanning-tree portfast trunk

Using this command: ansible-playbook napalm_install_merge.yml -e config_file='config_merge_file.txt'

  1. State of Cisco after napalm_install_merge execution:

! interface GigabitEthernet0/6 switchport mode trunk !

Why only switchport mode trunk remains?

ktbyers commented 3 years ago

Have you looked at the CLI when you execute those configuration changes manually and does it work properly if you do it manually?

What is the default switchport mode config for this device? Is it switchport mode access? Have you tried using that instead of the no operation.

NAPALM just copies the file into running using a merge operation.