theforeman / foreman_rh_cloud

a plugin to Foreman that generates and uploads reports to the Red Hat cloud
GNU General Public License v3.0
6 stars 32 forks source link

Ensure Configure Cloud Connector runs as root #791

Closed ekohl closed 1 year ago

ekohl commented 1 year ago

When a user has set the REX user as non-root, this task fails. Setting become to true means it will attempt to use sudo, which allows it to work in more cases.

Complete untested, just as an example of what I think could help.

ShimShtein commented 1 year ago

@adamruzicka this looks good to me, but does it need some REX configuration in order to work?

adamruzicka commented 1 year ago

That depends on how the machine is set up. If sudo is configured to be used without password, then this should work just fine, otherwise it will just fail unless the user provides a password when triggering the job.

ekohl commented 1 year ago

My reasoning was that there are 3 cases:

So it should all stay at least the same, or be better for the user. That said: this came up in a team discussion and I thought this would clearly show what I meant rather than trying to describe it. I haven't looked at the actual source code and what it really does.

ShimShtein commented 1 year ago

@ekohl can you please change the target branch to foreman_3_9? I'll merge it for the next foreman version.

ekohl commented 1 year ago

I'd strongly advise against the current model of changing default branches. It's really disruptive to contributors. Git doesn't update the HEAD ref when you pull so tools like hub aren't aware of it and continue to submit PRs against an older default branch. Changing the base branch on PRs is also very noisy and generally confuses GitHub Actions. So I'm closing this and opening a new one: https://github.com/theforeman/foreman_rh_cloud/pull/848