Add an alias to a host template (which can be imported)

Hi,

I was wondering if it’s possible to add some sort of alias to a host, so either the name of the host or the alias can be used inside an import inside another host definition?

If not, what would be the best way to go about this, do you think?

Thank you,

Will.

Why would you import a host into another host definition?

I can understand importing a host template and you can call those anything
you like, but I don’t follow importing a host itself.

Can you give an example of what you would like to be able to do?

Antony.

Sorry, I do mean giving an alias to a host template! I got my terminology wrong there.

Eg I have a host template my-template and I want to give it the alias my-template-dev, so I can use the import my-template with some hosts and my-template-dev with some other hosts.

template Host “my-template-dev” { import “my-template” }

That’s all you need to do.

Antony.

1 Like