You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When diffing ACLs using the session configuration such as ansible_XXXXXXXX the diff is not representative of the change it will make. The module is still in the ACL sub command and that change is written to the session config after the module exits. The module is issuing the show session-config diffs command while still in ACL sub-command, hence why the last command (TESTACL6) is does not appear in the diff.
test(s2)#conf session ansible
test(s2)(config-s-ansible)#
test(s2)(config-s-ansible)#
test(s2)(config-s-ansible)#ip access-list TESTACL1
test(s2)(config-s-ansible-acl-TESTACL1)# 10 permit tcp any any eq microsoft-ds
test(s2)(config-s-ansible-acl-TESTACL1)#ip access-list TESTACL2
test(s2)(config-s-ansible-acl-TESTACL2)# 10 permit tcp any any eq microsoft-ds
test(s2)(config-s-ansible-acl-TESTACL2)#ip access-list TESTACL3
test(s2)(config-s-ansible-acl-TESTACL3)# 10 permit tcp any any eq microsoft-ds
test(s2)(config-s-ansible-acl-TESTACL3)#ip access-list TESTACL4
test(s2)(config-s-ansible-acl-TESTACL4)# 10 permit tcp any any eq microsoft-ds
test(s2)(config-s-ansible-acl-TESTACL4)#ip access-list TESTACL5
test(s2)(config-s-ansible-acl-TESTACL5)# 10 permit tcp any any eq microsoft-ds
test(s2)(config-s-ansible-acl-TESTACL5)#ip access-list TESTACL6
test(s2)(config-s-ansible-acl-TESTACL6)# 10 permit tcp any any eq microsoft-ds
test(s2)(config-s-ansible-acl-TESTACL6)#show session-config diffs
--- system:/running-config
+++ session:/ansible-session-config
@@ -2989,6 +2989,21 @@
420 deny tcp any any eq 3268
430 permit ip any any
!
+ip access-list TESTACL1
+ 10 permit tcp any any eq microsoft-ds
+!
+ip access-list TESTACL2
+ 10 permit tcp any any eq microsoft-ds
+!
+ip access-list TESTACL3
+ 10 permit tcp any any eq microsoft-ds
+!
+ip access-list TESTACL4
+ 10 permit tcp any any eq microsoft-ds
+!
+ip access-list TESTACL5
+ 10 permit tcp any any eq microsoft-ds
+!
ip access-list VIDEO_RTP
5 permit udp any any eq 8801 dscp 32
10 remark Pexip Audio/Video RTP
test(s2)(config-s-ansible-acl-TESTACL6)#show session-config | inc TESTACL6
test(s2)(config-s-ansible-acl-TESTACL6)#exit
test(s2)(config-s-ansible)#show session-config | inc TESTACL6
ip access-list TESTACL6
test(s2)(config-s-ansible)#
The switch provides configuration modes for creating and modifying ACLs. The command that enters an ACL configuration mode specifies the name of the list that the mode modifies. The switch saves the list to the running configuration when the configuration mode is exited.
Add a return to the config session before sending the diff command. This ensures sub-commands are written to the session config before the diff command is sent. self.send_command("configure session %s" % session)
The text was updated successfully, but these errors were encountered:
@Random6554 I'm not sure if it's an Ansible bug, because you're missing an exit after:
ip access-list TESTACL6
10 permit tcp any any eq microsoft-ds
->
ip access-list TESTACL6
10 permit tcp any any eq microsoft-ds
exit
ACLs will be written into the config (session-config, running-config) after you exit the ACL edit mode. After the exit the show session-config diffs will return the expected result. That's normal behavior in Arista EOS (and that differs to Cisco IOS). That's an EOS feature, so you're able to complete the changes of your ACL before it will be written once into the config.
The exit command is optional if you enter a command to change the config node, e.g. you're in ip access-list TESTACL5 and you're entering ip access-list TESTACL6. Internally the commands exit and afterwards ip access-list TESTACL6 will be executed. At the end it's good practice to always execute an exit so the config node will be written into the config.
SUMMARY
When diffing ACLs using the session configuration such as ansible_XXXXXXXX the diff is not representative of the change it will make. The module is still in the ACL sub command and that change is written to the session config after the module exits. The module is issuing the
show session-config diffs
command while still in ACL sub-command, hence why the last command (TESTACL6) is does not appear in the diff.https://www.arista.com/en/um-eos/eos-acls-and-route-maps#xx1148961
Creating and Modifying Lists
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
The diff should show TESTACL6 as a change/diff
ACTUAL RESULTS
Potential Fix
arista.eos/plugins/cliconf/eos.py
Line 251 in 8fc41fc
Add a return to the config session before sending the diff command. This ensures sub-commands are written to the session config before the diff command is sent.
self.send_command("configure session %s" % session)
The text was updated successfully, but these errors were encountered: