Templates Outside of Director

Hi There,

I have some host templates created manually outside of director. Is it possible to assign those templates to hosts created with the director?

Thanks,
Ken

I ask because the Director API is generating an error when it send the “import” array with the host template name.

Might I ask why you are defining templates outside of the director?
Using both the director and the config files is not recommended.

Not sure if this works:
But have you tried running the Kickstart wizard before using the templates?

Thanks for the reply. I did run the Kickstart before doing anything.

The idea was to add my host and timeperiod templates by manually creating them, there are only 4 total.
Then allow my IPAM system to add and remove hosts using the Director’s API.

I seem to be able to add service configs manually and map them to Director API created hosts using custom vars easily enough. Seems odd that I can’t do the same with templates.

Why not simply create the templates with the Director?
Seems overly complicated to me what you are trying to achive with the “manual” config files.

Where did you put the config files with the templates?
Is that folder included when starting icinga?

Does icinga2 daemon -C list any problems?
Can you finde your templates via the icinga cli?

Hello there!

I’m sorry if I am not really posting a proper solution to your issue here, but I do agree with log1c here.
It is best practice to only use one kind of template creation (either director or manual), as there will be conflicts along the way a lot, if you just mix and match.
As in, there will most likely be more issues, even if you get this specific problem solved.

So my advice would also be to just define those templates in the director, if it’s your main source of config already :slight_smile:

Have a nice day!
Feu