Allow omnibus-gitlab to set announce_ip to a hostname dynamically
See: #1650 (comment 904917987).
Currently the only way to enable hostnames in redis is by setting redis['announce_ip']
. However, this would need to be set uniquely per redis instance. Which we have no easy way of doing and also don't really want -- as we'd rather have generic chef roles without instance-specific logic or hardcoded hostnames.
Instead, we should have a boolean that allows us to turn this on or off. And then dynamically infer the hostname from hostname -f
.
We could either do this at reconfigure time, writing the hostname into redis.conf
. Pro: Intuitive, discoverable, we know when this change is applied. Con: Hostnames in config files are brittle and can easily get messed up.
Alternatively, we could modify the runit script to shell out to hostname -f
and inject the config value. This is harder to discover, but safer as it adapts to the hostname in case it changes.