Closed rodrigo-albuquerque closed 4 years ago
Is this because we're using exclusively only existing interface facts and not considering that loopback interfaces wouldn't be there? https://github.com/ansible-collections/cisco.ios/blob/master/plugins/module_utils/network/ios/config/l3_interfaces/l3_interfaces.py#L131
I think you should be using ios_interfaces
for creating/deleting interfaces...
@rodrigo-albuquerque yes that's expected behavior from ios_l3_interfaces
resource module, for configuring any new/non-existing interface ios_interfaces
resource module shall be used and it's working as expected.
Thus, closing the respective issue.
@rodrigo-albuquerque @mihudec I have confirmed the behavior internally and yes, a user should be able to configure L3 params even for non-existing interfaces as well. I have updated the PR #99 to fix the respective behavior from L3 interfaces end and with the fix, L3 params will be configured even for non-existing interfaces. Plz, ignore the earlier comment.
@rodrigo-albuquerque you can check and verify the PR if it fixes the issue you've observed wrt to ios_l3_interfaces
module.
SUMMARY
When state is set to merged AND loopback interface doesn't exist, new loopback interface is not created. This is not the case when interface exists.
ISSUE TYPE
COMPONENT NAME
ios_l3_interfaces module
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Cisco IOS Software, 7200 Software (C7200-ADVENTERPRISEK9-M), Version 15.1(4)M4, RELEASE SOFTWARE (fc1)
STEPS TO REPRODUCE
Just try to configure loopback interface that doesn't exist:
YAML file:
loopback here is set to 1.1.1.1 in hosts_vars.
EXPECTED RESULTS
Loopback interface is created and address 1.1.1.1/32 is assigned
ACTUAL RESULTS
No config change:
However, if I create a loopback interface first it works:
Now if I run playbook again:
Interface is correctly configured: