Configure hostname

Prerequisites

Modules

git checkout origin/osp-web-configuration .

Description

Note

The complete example can be checkout out with git checkout origin/example-set-hostname .

In this tutorial you will learn how to change the default hostname (stack-1.onsphere.local).

The hostname must be updated in all modules that use it, see the documentation for details.

Configuration structure

@startuml
skinparam backgroundColor transparent
package "root/configuration/" {
    [stack.cfg] as conf
}

    node web as "osp-web"
    node dispatcher as "osp-configuration-dispatcher"
    node keycloak as "osp-keycloak"

conf -[#dodgerblue]-> web :<size:11><color:#dodgerblue>**moduleId**
conf -[#dodgerblue]-> dispatcher :<size:11><color:#dodgerblue>**moduleId**
conf -[#dodgerblue]-> keycloak :<size:11><color:#dodgerblue>**moduleId**
@enduml

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