-
Notifications
You must be signed in to change notification settings - Fork 271
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
run foreman in a container #1164
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,4 +55,24 @@ class { 'foreman': | |
|
||
it_behaves_like 'the foreman application', { expected_login_url_path: '/users/extlogin' } | ||
end | ||
|
||
# needs to happen after GSSAPI, something is wrong with its cleanup | ||
context 'in a Container' do | ||
before(:context) { purge_foreman } | ||
describe 'in a Container' do | ||
it_behaves_like 'an idempotent resource' do | ||
let(:manifest) do | ||
<<~PUPPET | ||
class { 'foreman': | ||
deployment_mode => 'container', | ||
db_host => 'localhost', | ||
db_manage_rake => false, | ||
Comment on lines
+68
to
+69
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if these two could be made more "dynamic"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean? That There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, same for host (there is not really a socket in the container) |
||
} | ||
PUPPET | ||
end | ||
end | ||
|
||
it_behaves_like 'the foreman application', { deployment_mode: 'container' } | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one was tricky. Apache (or
foreman::config::apache
) doesn't add a trailing slash to the backend, which then tries to access things likehttp://localhost:3000users/login
, obviously failingThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use systemd socket activation with podman containers. I've used that myself with gunicorn to avoid needing to deal with a firewall (and instead deal with SELinux). Any reason you don't use that now?
See https://github.com/containers/podman/blob/main/docs/tutorials/socket_activation.md#socket-activation-of-containers for more info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh cool. I didn't try that (yet), but I also think that the above is a legit bug in our current deployment if for some reason users do not want sockets.
also lol @ "and instead deal with SELinux" ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite possible that there's a bug there