public class SetHostnameCustomizer extends BasicMachineLocationCustomizer
The customizer can be configured with a hard-coded hostname, or with a freemarker template whose value (after substitutions) will be used for the hostname.
Modifier and Type | Field and Description |
---|---|
static ConfigKey<java.lang.String> |
FIXED_DOMAIN |
static ConfigKey<java.lang.String> |
FIXED_HOSTNAME |
static ConfigKey<java.lang.String> |
HOSTNAME_TEMPLATE |
static ConfigKey<java.lang.String> |
LOCAL_HOSTNAME |
static ConfigKey<java.lang.String> |
LOCAL_IP |
static org.slf4j.Logger |
log |
static ConfigKey<<any>> |
MACHINE_FILTER |
Constructor and Description |
---|
SetHostnameCustomizer(ConfigBag config) |
Modifier and Type | Method and Description |
---|---|
void |
customize(MachineLocation machine)
Override to configure the given machine once it has been created (prior to any use).
|
java.lang.String |
setLocalHostname(SshMachineLocation machine)
Sets the machine's hostname to the value controlled by fixed_hostname and hostname_template.
|
java.lang.String |
setLocalHostname(SshMachineLocation machine,
java.lang.String hostName,
java.lang.String domainFixed)
Sets the machine's hostname to the given value, ensuring /etc/hosts and /etc/sysconfig/network are both
correctly updated.
|
preRelease
public static final org.slf4j.Logger log
public static final ConfigKey<java.lang.String> FIXED_HOSTNAME
public static final ConfigKey<java.lang.String> FIXED_DOMAIN
public static final ConfigKey<java.lang.String> HOSTNAME_TEMPLATE
public static final ConfigKey<java.lang.String> LOCAL_HOSTNAME
public static final ConfigKey<java.lang.String> LOCAL_IP
public static final ConfigKey<<any>> MACHINE_FILTER
public SetHostnameCustomizer(ConfigBag config)
public void customize(MachineLocation machine)
MachineLocationCustomizer
customize
in interface MachineLocationCustomizer
customize
in class BasicMachineLocationCustomizer
public java.lang.String setLocalHostname(SshMachineLocation machine)
public java.lang.String setLocalHostname(SshMachineLocation machine, java.lang.String hostName, java.lang.String domainFixed)