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

Ensure Configure Cloud Connector runs as root #791

Closed

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Jan 4, 2023

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.

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.
@ShimShtein
Copy link
Member

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

@adamruzicka
Copy link
Contributor

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
Copy link
Member Author

ekohl commented Jan 16, 2023

My reasoning was that there are 3 cases:

  • Runs as root: currently safe, in my version also safe
  • Runs as non-root, but has passwordless sudo: currently broken, fixed with this version
  • Runs as non-root without sudo: currently broken, also broken in this version but at least with a clear description. It should also fail at the very start instead of possibly somewhere in between

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.

@ekohl ekohl marked this pull request as ready for review September 6, 2023 13:15
@ShimShtein
Copy link
Member

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

@ekohl
Copy link
Member Author

ekohl commented Oct 17, 2023

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: #848

@ekohl ekohl closed this Oct 17, 2023
@ekohl ekohl deleted the run-cloud-connector-setup-as-root branch November 27, 2023 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants