vyos / vyos.vyos

Ansible Network Collection for VyOS
GNU General Public License v3.0
70 stars 64 forks source link

BGP neighbor password set incorrectly #304

Closed rfranks-securenet closed 1 year ago

rfranks-securenet commented 1 year ago
SUMMARY

When adding a BGP neighbor password the password is set to the address of the neighbor.

I believe this is due to https://github.com/ansible-collections/vyos.vyos/blob/d181df0cc702cbafb8a9cd640b2eeb6cc3b9a962/plugins/module_utils/network/vyos/rm_templates/bgp_global.py#L876 setting the password to {{ neighbor.address }} rather than {{ neighbor.password }}

ISSUE TYPE
COMPONENT NAME

bgp_global

ANSIBLE VERSION
ansible [core 2.14.2]
  config file = None
  configured module search path = ['/home/rfranks/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/rfranks/.venv/lib/python3.9/site-packages/ansible
  ansible collection location = /home/rfranks/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/rfranks/.venv/bin/ansible
  python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] (/home/rfranks/.venv/bin/python3)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
 /home/rfranks/.ansible/collections/ansible_collections
Collection Version
---------- -------
vyos.vyos  4.0.1  

# /home/rfranks/.venv/lib/python3.9/site-packages/ansible_collections
Collection Version
---------- -------
vyos.vyos  4.0.0
CONFIGURATION
CONFIG_FILE() = None
OS / ENVIRONMENT

VyOS 1.3-rolling-202001081700

STEPS TO REPRODUCE

Try to roll out a BGP neighbor configuration with password. The password will be set to whatever is in the address field.

- hosts: all

  tasks:
    - name: Test bgp
      vyos.vyos.vyos_bgp_global:
        config:
          as_number: "65000"
          neighbor:
            - address: "10.20.30.40"
              remote_as: "65001"
              password: "password"
        state: merged
EXPECTED RESULTS

password is set to "password"

ACTUAL RESULTS

password is set to 10.20.30.40