netenglabs / suzieq

Using network observability to operate and design healthier networks
https://www.stardustsystems.net/
Apache License 2.0
791 stars 105 forks source link

[Bug]: Ansible inventory source requires ansible_user fact instead of using auths #867

Open kingfetty opened 1 year ago

kingfetty commented 1 year ago

Suzieq version

0.20.1

Install Type

hand deployed python

Python version

3.9

Impacted component

sq-poller

Steps to Reproduce

Create ansible based inventory source Specify credentials using auths section of suzieq inventory file Do not have ansible_user configured within the ansible inventory file Attempt to run poller against inventory it will fail stating Username is not configured despite it being configured in the Auths section

Expected Behavior

It will use the ansible_user fact if it exists, if not it will use the Auths setting

Observed Behavior

it only works with ansible_user fact defined

Screenshots

Additional Context

kingfetty commented 1 year ago

Suggestion:

suzieq > poller > controller > source > ansible.py

# Get user if any
ansible_user = None
if 'ansible_user' in entry:
    ansible_user = entry['ansible_user']
ddutt commented 1 year ago

Thanks, makes sense. Will fix for next release