I\'m using puppet to configure servers. I want to print current machine (node) name in *.erb template. There is hostname variable, but this holds puppetmaster hostname.
Do note though, this is the hostname rather than the node name (which you originally asked for). In 99% of cases, these will be the same. AFAIK there isn't a way to get the actual node name in templates (and if there is, I'd love to hear it).