icinga-powershell-framework
icinga-powershell-framework copied to clipboard
Can't use private IcingaRepository
Hello,
When we try to install icinga for windows with a private repo of Icinga, the installation still try to use the default repository.
Can you help us with this process ?
Expected Behavior
Install Icinga with our private repository. Following the documentation of Automated installation with InstallCommand and own IcingaRepository
Current Behavior
When trying to install Icinga for Windows in offline mode, it still try to download from the internet.
Steps to Reproduce (for bugs)
- Create a sync repository on a windows server with ;
Sync-IcingaRepository `
-Name 'Icinga Stable Local' `
-Path 'E:\Repo_icinga\icinga_stable' `
-RemotePath '\\WINSERVER\Repo_icinga\icinga_stable' `
-Source 'https://packages.icinga.com/IcingaForWindows/stable'
And make sure it's enable:
Enable-IcingaRepository -Name 'Icinga Stable Local'
-
Set the permission of the shared folder Repo_icinga
-
Create a powershell script based on the one on the installation page:
[Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11';
$ProgressPreference = 'SilentlyContinue';
[string]$ScriptFile = 'C:\Users\Public\IcingaForWindows.ps1';
Invoke-WebRequest `
-UseBasicParsing `
-Uri '\\WINSERVER\Repo_icinga\IcingaForWindows.ps1' `
-OutFile $ScriptFile;
& $ScriptFile `
-ModuleDirectory 'C:\Program Files\WindowsPowerShell\Modules\' `
-InstallCommand '{"IfW-DirectorSelfServiceKey":{"Values":["AAAAABBBBCCCCCDDDDD"]},"IfW-DirectorUrl":{"Values":["http://ICINGA_SERVER/icingaweb2/director"]}}' `
-IcingaRepository '\\WINSERVER\Repo_icinga\icinga_stable\ifw.repo.json';
- On another server we execute the script.
It download and launch correctly the IcingaForWindows.ps1.
But then try to download on the internet:
Context
We have a bunch of server without internet connection and therefore can't be added to our monitoring system.
Thank you for your help.
Your Environment
- PowerShell Version used : 5.1
- Operating System and version: Windows server 2016
- Latest version of Icinga as of today (10/02)
Hello,
thank you for the issue. The problem is, that Icinga for Windows will default to the Icinga Stable
repository by default, which refers to packages.icinga.com
.
To use your custom repository during installation, you will have to tell the IMC installer to override the default repository with your own.
In general it is recommended to have some sort of "deployment" host which has Icinga for Windows running which is then used to manually get through the Icinga Management Console installation process and then update all entries (including advanced at the end) as required.
To get your script run working, you have to update the json
string of your -InstallCommand
to include the override of the repository:
"IfW-StableRepository":{"Values":["\\\\WINSERVER\\Repo_icinga\\icinga_stable\\ifw.repo.json"]}
It will then look like this:
& $ScriptFile `
-ModuleDirectory 'C:\Program Files\WindowsPowerShell\Modules\' `
-InstallCommand '{"IfW-StableRepository":{"Values":["\\\\WINSERVER\\Repo_icinga\\icinga_stable\\ifw.repo.json"]},"IfW-DirectorSelfServiceKey":{"Values":["AAAAABBBBCCCCCDDDDD"]},"IfW-DirectorUrl":{"Values":["http://ICINGA_SERVER/icingaweb2/director"]}}' `
-IcingaRepository '\\WINSERVER\Repo_icinga\icinga_stable\ifw.repo.json';
It works perfectly with the -InstallCommand
.
Thank you very much for your help !
In general it is recommended to have some sort of "deployment" host which has Icinga for Windows running which is then used to manually get through the Icinga Management Console installation process and then update all entries (including advanced at the end) as required.
I didn't find documentation about your recommended deployment solution for Icinga (maybe i'm missing something or don't understand the documentation). We have installed IcingaForWindows on the WINSERVER (which is our deployment server). What should we have done instead of our previous script ?
It is in general just helpful to run the entire installation configuration once manually to get started. But this is something we might need to make clearer. I will leave this ticket open for documentation updates.
Personally, I have Icinga for Windows installed on my regular workspace and just run the configuration I require there, deploying that to the other machines. Makes my life a lot easier 😄
btw, if you have your own repository or your own mirror repository. That json file still have an hardcoded url to use packages.icinga.com url that will be used at least for the kickstart installation :(
Yes, the path is hardcoded within the JSON and gets replaced by using Sync-IcingaRepository
.
If you are using Linux commands or move it manually, you have to update it yourself. Otherwise, there is no way of Windows to know, where to download the files from.
How about adding a parameter to the installation script to set the initial download url? would make it a lot easier with non windows synced repos
I would rather have a proper Linux clone script that does everything for you instead of additional arguments that modify the behavior of the installer and might cause different problems.
Would be better, but what if you dont have access to the repo clone script? But thanks for your insights, have now an idea which balls to kick to get it working :)
Is there a way to directly tell the script where the msi file is located on a local fileshare? I mean the self service api has a flag for that?! --> Installation Source: Use a local file or Networkshare.
I thought this would be set through the directo self service api, but it seems like the script ignores that...