hostname-1.4.0
2 minute read
KOSI Plugin hostname Version 1.4.0
Summary
The hostname plugin enables you to :
- print the current hostname of the machine and save it to an internal storage
- set the hostname to your desired name permenently.
- read the hostname from the storage to set your hostname permenently.
Keys
Depending on which operating mode you use, you have to set one of the following keys.
Key | Description | |
---|---|---|
get | - | Set this key to the name of variable in which you want the current hostname to be saved. This variable is accessible until the end of your kosi session. |
set | - | Set this key to your desired name which should be set as hostname. |
setVar | - | Set this key to the name of the variable in the internal storage in which you have saved the desired hostname. |
sudo | true / false | If it is true the Plugin will be executed with sudo privileges. |
sudoPassword | - | If you use sudo, sudoPassword will be mandatory. |
Examples
Example 1 - get hostname
languageversion = "0.1.0";
apiversion = "kubernative/kubeops/kosi/user/v3";
name = "kosi-example-packagev3";
description = "kosi-example-package";
version = "0.1.0";
docs = "docs.tgz";
logo = "logo.png";
files =
{
input="template.yaml";
}
containers =
{
example=["docker.io", "nginx", "latest"];
}
install
{
containerd(get='"oldHostname"';sudo='"true"';sudoPassword='"Drowssap"');
}
Example 2 - set hostname
languageversion = "0.1.0";
apiversion = "kubernative/kubeops/kosi/user/v3";
name = "kosi-example-packagev3";
description = "kosi-example-package";
version = "0.1.0";
docs = "docs.tgz";
logo = "logo.png";
files =
{
input="template.yaml";
}
containers =
{
example=["docker.io", "nginx", "latest"];
}
install
{
containerd(set='"master"';sudo='"true"';sudoPassword='"Drowssap"');
}
Example 3 - use internal variable to set hostname
languageversion = "0.1.0";
apiversion = "kubernative/kubeops/kosi/user/v3";
name = "kosi-example-packagev3";
description = "kosi-example-package";
version = "0.1.0";
docs = "docs.tgz";
logo = "logo.png";
files =
{
input="template.yaml";
}
containers =
{
example=["docker.io", "nginx", "latest"];
}
install
{
hostname(setVar='"oldHostname"';sudo='"true"';sudoPassword='"Drowssap"');
}