Macro expansion

From NComputing Knowledge Base
Jump to: navigation, search

Macro expansion refers to NoTouch OS replacing certain "macros" with actual values that are determined at runtime. Several configuration parameters, no matter if being set in the local configuration or via NoTouch Center, support these macros.

This functionality allows for dynamic configuration values. Potential use cases are:

  • Certificate file name convention
  • Architecture-specific extension download URLs
  • Kiosk-type per-machine login based on MAC address
  • Customize values such as DHCP vendor class id, SNMP location

Note: Due to the compilation and caching of templates, it is discouraged to use values that can change at runtime, such as IP address or host name, unless of course you can be sure that these values do not change. Rely on machine-specific attributes that don't change instead, like MAC address.

Macro Explanation Example(s)
%%hostname%% DNS host name, lower case ntd000c29e11703
%%HOSTNAME%% DNS host name, upper case NTD000C29E11703
%%friendlyname%% Self-assigned device friendly name LakeTahoe
%%HWADDR%% MAC address, all caps, no separator 000C29E11703
%%hwaddr%% MAC address, lower case, no separator 000c29e11703
%%HWADDR-%% MAC address, all caps, using - as separator 00-0C-29-E1-17-03
%%hwaddr-%% MAC address, lower case, using - as separator 00-0c-29-e1-17-03
%%HWADDR:%% MAC address, all caps, using : as separator 00:0C:29:E1:17:03
%%hwaddr:%% MAC address, lower case, using : as separator 00:0c:29:e1:17:03
%%HWADDR_%% MAC address, all caps, using _ as separator 00_0C_29_E1_17_03
%%hwaddr_%% MAC address, lower case, using _ as separator 00_0c_29_e1_17_03
%%ipaddr%% IP address
%%serialnr%% Serial number (DMI or SoC) CZA3TC45B
%%arch%% Software architecture amd64, armhf, i386, arm64
%%visArch%% Alternative %%arch%% designations x64, armhf, i386, arm64
%%imageClass%% OS Image class EEs, WSH
%%imageKernel%% Kernel designator k418
%%archBits%% Number of bits 64, 32
%%kernelArch%% Kernel software architecture amd64, armhf, i386, arm64
%%kernelArchBits%% Kernel bits 64, 32
%%imagename%% Full NoTouch image name 3.1.1-EEs-k418-x64-190118
%%hwModel%% Hardware model NComputing RX-HDX