theforeman / puppet-foreman

Puppet module for Foreman
GNU General Public License v3.0
104 stars 271 forks source link

Fixes #36037 - Manage Redis service for Redis cache #1109

Closed ekohl closed 1 year ago

ekohl commented 1 year ago

This automatically manages Redis when the cache store type is set to Redis, but no URLs have been provided. It's assumed that when a URL is provided that the service is managed in another way.

This ignores the edge case where the user wants to run it on localhost, but with a different database than 0.

Currently a draft since it doesn't have tests and I haven't verified it yet. The end goal of this is that we can set up Redis caching by default. File based caching is just not the right fit for large deployments, even if it's stored in tmpfs.

ekohl commented 1 year ago

In https://bugzilla.redhat.com/show_bug.cgi?id=2165092#c4 it was confirmed this works.

evgeni commented 1 year ago

Won't this clash with the redis service for pulpcore (in the setups with pulp)?

ekohl commented 1 year ago

There we use DB 8 (https://github.com/theforeman/puppet-pulpcore/blob/ef0762aacb44d455fd1e2f06725f92c1ed63b896/manifests/init.pp#L221) so using DB 0 shouldn't clash. Dynflow uses DB 6 (by default): https://github.com/theforeman/puppet-foreman/blob/f68bb4a183f3c8907147d8d465d74b6ca37a9930/manifests/config.pp#L14

evgeni commented 1 year ago

Okay, this just sounds like magic numbers to me, but I guess that's OK for now? :)

ekohl commented 1 year ago

They certainly are magic. Perhaps it's something we should document, but not sure how/where.

ekohl commented 1 year ago

Now you made me file an issue to monitor the cache. But here are at least some basic tests.

ekohl commented 1 year ago

@evgeni enough tests now?

ekohl commented 1 year ago

Patches welcome? ;)