Hello everyone,
I am working on the topic of providing Icinga2 via a suitable deployment variant in our environment. However, the choice of options is very limited and for Windows it seems to be the best method to use the icinga2 powershell module.
However, there are some problems that prevent automated deployment.
My current source code looks like this:
#Configure Icinga2 Agent with Powershell-Module
$VarAgentName = [System.Net.Dns]::Resolve($null).HostName
I would like to specify the agent FQDN directly as a value.
Unfortunately, this does not work as it then enters the variable name instead of the value in the config files after installation.
2nd problem, how can I best handle the step with the ticket authentication? I know that you either verify the agent with a ticket during installation or authenticate the agent later on the master. In both cases, however, a manual step is necessary on the master, which I would like to avoid.
If you have any suggestions, please post them.
Additional Information:
Our icinga Environemnt a master → agent Infrastructure. We dont use satelites.
Many thanks for your both answers. @moreamazingnick
Thanks for the tip with the Abostroph. Without the Abostroph it has now written the correct value in the Configs.
As you said, i just tested the Icinga Installation with IMC via. Powershell-Framework and it works pretty well in my environment. Thanks for your help.
@rivad
When I use your script and adjust the parameters key, URL and CA server I get a series of error messages that the script cannot be executed correctly. We also do not have icinga Director.
Can the script be used in our environment at all?
Were deploying our Infrastructure via. Terraform & SaltStack.
The icinga Installation (for Windows VM’s) beginns after Terraform-Code has been applied.
If I have to generate a ticket on the master and specify this in the script during the agent installation, then this contradicts an automated installation, as manual intervention is necessary before the installation, which is exactly what I want to prevent.
I could build an SSH connection to the master into my script, which creates the ticket on the master before the agent installation and transfers it to the installation, but that would probably not be the cleanest solution.
I don’t know SaltStack but I doubt, it will be difficult to fire a REST call to the Icinga2 API to get the ticket to then later insert it into the IwF install command.