ansible-collections / arista.eos

Ansible Network Collection for Arista EOS
GNU General Public License v3.0
82 stars 69 forks source link

arista.eos.eos_acls `log: false` treated as `log: true` #470

Open bewing opened 11 months ago

bewing commented 11 months ago
SUMMARY

Placing log: false in an ACE results in the log statement being present in the config.

ISSUE TYPE
COMPONENT NAME

arista.eos.eos_acls

ANSIBLE VERSION
$ ansible --version
ansible [core 2.15.5]
  config file = /home/bewing/.ansible.cfg
  configured module search path = ['/home/bewing/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /export/home/bewing/.pyenv/versions/3.9.18/lib/python3.9/site-packages/ansible
  ansible collection location = /export/home/bewing/.ansible/collections:/usr/share/ansible/collections
  executable location = /export/home/bewing/.pyenv/versions/3.9.18/bin/ansible
  python version = 3.9.18 (main, Oct 19 2023, 17:02:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] (/home/bewing/.pyenv/versions/3.9.18/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
$ ansible-galaxy collection list arista.eos

# /export/home/bewing/.ansible/collections/ansible_collections
Collection Version
---------- -------
arista.eos 6.1.2
CONFIGURATION
$ ansible-config dump --only-changed
OS / ENVIRONMENT
STEPS TO REPRODUCE
---
- name: example acl
  arista.eos.eos_acls:
    config:
    - afi: ipv4
      acls:
      - name: test-acls
        aces:
        - sequence: 10
          grant: allow
          destination:
            any: true
          source:
            any: true
          protocol: ip
          log: false
EXPECTED RESULTS
ip access-list test-acls
  seq 10 permit ip any any
ACTUAL RESULTS
ip access-list test-acls
  seq 10 permit ip any any log

root cause: https://github.com/ansible-collections/arista.eos/blob/eb7f54865bb3c0f0e66c97f1ef6e0eeacb8c7360/plugins/module_utils/network/eos/config/acls/acls.py#L585-L586

suggest changing to

if ace.get("log", False):
    command = command + " log"
bewing commented 11 months ago

this appears to be a pattern for most of the bools in the ACE as well