Juniper / puppet-netdev-stdlib-junos

Junos specific Provider code for "netdev_stdlib". Netdev is a vendor-neutral network abstraction framework developed by Juniper Networks and contributed freely to the DevOps community.
Apache License 2.0
25 stars 14 forks source link

Diffing when managing multiple vlans is broken #15

Closed b1naryth1ef closed 9 years ago

b1naryth1ef commented 9 years ago

When managing more than a single vlan, e.g.:

netdev_vlan { "testvlan":
  vlan_id => 300,
  description => "This is a test.  Delete me."
}

netdev_vlan { "testvlan2":
  vlan_id => 5,
  description => "This is a test.  Delete me."
}

The diffing text displayed is incorrect when adding or removing more vlans, e.g. when adding testvlan2 you see the following on the first apply:

Notice: Compiled catalog for **************** in environment production in 2.86 seconds
Notice: /Stage[main]/Main/Node[****************]/Netdev_vlan[testvlan2]/vlan_id: vlan_id changed '300' to '5'
Notice: JUNOS:

[edit vlans]
+   testvlan2 {
+       vlan-id 5;
+   }

Notice: JUNOS: OK: COMMIT success!

After the initial apply the following happens on each subsequent run (without changes to the puppet code):

Notice: Compiled catalog for **************** in environment production in 2.83 seconds
Notice: /Stage[main]/Main/Node[****************]/Netdev_vlan[testvlan2]/vlan_id: vlan_id changed '300' to '5'
Error: JUNOS: Unmanaged VLAN interface:
Notice: JUNOS:

Notice: JUNOS: OK: COMMIT success!

Even though this causes a commit, no change is actually applied.

The expected behavior in both cases is correctly identifying that a new vlan is created, and not attempting to recreate/change a vlan subsequent to the apply.

ganeshrn commented 9 years ago

Please upgrade netdev_stdlib_junos module to latest version and check if you are still seeing this issue.

#puppet module upgrade juniper-netdev_stdlib_junos --version 2.0.1 
b1naryth1ef commented 9 years ago

Fixed, thanks!