suzieq icon indicating copy to clipboard operation
suzieq copied to clipboard

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

Open kingfetty opened this issue 1 year ago • 2 comments

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 avatar Mar 16 '23 20:03 kingfetty

Suggestion:

suzieq > poller > controller > source > ansible.py

# Get user if any
ansible_user = None
if 'ansible_user' in entry:
    ansible_user = entry['ansible_user']

kingfetty avatar Mar 16 '23 20:03 kingfetty

Thanks, makes sense. Will fix for next release

ddutt avatar Mar 16 '23 20:03 ddutt