Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying username to record #493

Closed
phemmer opened this issue Jun 28, 2023 · 4 comments · Fixed by #496
Closed

Allow specifying username to record #493

phemmer opened this issue Jun 28, 2023 · 4 comments · Fixed by #496
Labels
enhancement plugins Related to the Ansible plugins
Milestone

Comments

@phemmer
Copy link
Contributor

phemmer commented Jun 28, 2023

What is the idea ?

Currently ARA pulls the username from the OS user the process is running as. In my setup, ansible is run via CI jobs, and also from a container, so the user is always recorded as "root", which is not useful. The CI (GitLab) provides a variable which indicates the user who triggered the job, and I would like to be able to use this variable to populate the recorded user.

It seems like this change should be simple enough by adding a new option and using the value if set, otherwise falling back to the current behavior. I'd be willing to submit a PR if you agree, and have an idea on what the option should be named.

 

On a side note, host name also suffers from the same issue, as it gets the name of the container. However this is not important to me, but it may be important to others.

@akire0ne
Copy link

+1

This is also something we are looking for.

@dmsimard
Copy link
Contributor

This is fair enough and I agree that the implementations for the controller hostname and username are similar in nature.

If we do one, we might as well do the other as well for similar reasons.

We currently have ARA_RECORD_USER and ARA_RECORD_CONTROLLER (here), I suppose if we have something like ARA_RECORD_USER_NAME and ARA_RECORD_CONTROLLER_NAME (or something to that effect) we can use those instead of trying to automatically recover them.

It makes sense to me and I can review a PR for something like that :)

@hille721
Copy link
Contributor

hille721 commented Jul 6, 2023

Was already missing this feature as well!

For user there is currently the workaround to set LOGNAME, I'm doing that already in my CI pipelines, but for the hostname there is no such dirty fix (setting HOSTNAME doesn't work).

Thanks for taking care of it!

@dmsimard
Copy link
Contributor

Just chiming in to mention I haven't forgotten about this but my focus and (limited) time has been spent elsewhere, sorry.

It will be included before the next release of ara goes out for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement plugins Related to the Ansible plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants