Configure hostname
This example explains how to change the default OnSphere stack hostname by creating a stack.cfg configuration file.
Create a
stack.cfgfile underroot/configuration/to declare a custom hostname.The file applies to
osp-web,osp-configuration-dispatcherandosp-keycloakmodules.Add the hostname to
/etc/hostswhen no DNS routing is available.
git checkout origin/osp-alarms-configuration .
git checkout origin/osp-web-configuration .
git checkout origin/example-set-hostname .
Configuration structure
Steps
1. Create the stack.cfg file
Create the stack.cfg file and set the host name accordingly.
Warning
Be sure to check for duplicated stack.cfg before creating another.
/root/configuration/stack.cfg
{
"moduleId": ["modules.configuration-dispatcher.main", "modules.web.web-1", "modules.keycloak.keycloak-1"],
"hostname": "example-stack-1.onsphere.local"
}
1. Deploy and test
If the hostname is not routed by your DNS, you can update the local configuration on Linux. This is done by adding the following line to /etc/hosts
[local-ip] stack-1.onsphere.local stack-1.onsphere.local