Comments (7)
The main problem with that is that the module capable of doing quite more than installing the Agent. Determining on when to throw an exception is not that simple, as it could be intendened to simply write configuration or installing the NSClient++, without touching the Icinga 2 Agent at all.
I will try to figure something out for this.
from icinga2-powershell-module.
Maybe you could add a "NoAgentInstallation" flag? I'd suggest the negated form to not break backwards compatibility.
from icinga2-powershell-module.
That way you could check wether not installing is what the user wanted or if it just was an error.
from icinga2-powershell-module.
Maybe you could implement PowerShell's Common Parameters (https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.core/about/about_commonparameters) or more specifically the -ErrorAction
Parameter and decide whether to cancel the setup with exit code 1 or continue when encountering an error based on it's setting.
The official ErrorAction behaviours are
Continue
Ignore
Inquire
SilentlyContinue
Stop
Suspend
from icinga2-powershell-module.
Made some additional changes and reverted the exception output in case the installation failed.
Reason: The download URL is defined by default and is not a valid check-source, -InstallAgentVersion
can be left without content, as users might not wish to install the Agent but to configure it.
The -ErrorAction
argument is not a proper solution, as on which state I'm going to throw an error or not?
I suggest a solution like from @widhalmt would be required, adding an additional argument by default to throw an error in case the Agent can not be installed. Still I'm not happy with that, is it will increase the complexity of the module.
In case the Agent version is not configured, the script will now write a warning:
Warning: Icinga 2 Agent will not be installed. Argument -InstallAgentVersion is not defined.
from icinga2-powershell-module.
Another possible solution: Remove default configured -DownloadUrl
value. In that case printing an exception in case the -InstallAgentVersion
argument is not set would be valid, because the second required argument is not defined.
from icinga2-powershell-module.
Re-considered this issue and discussed it internally. I will update the documentation to make clear -InstallAgentVersion
is required to be defined in order to install the Icinga 2 Agent. I will however not throw an error or exit the Script with Exit Code 1, as this could be intended from user side. Warnings are however printed and visible within the logfile if enabled (or the console itself)
from icinga2-powershell-module.
Related Issues (20)
- NSCP installation fails for $NSClientDirectory containing whitespaces
- Handle deprecated --key argument for Icinga 2 save-cert CLI command
- Icinga2AgentModule not found
- Parameter -DownloadUrl is overwriten by empty Director setting HOT 2
- Module doesn't work with new Version 2.10.0 HOT 3
- parameterizable mainlog feature HOT 2
- Host of EndpointsConfig is set to 1 when parameter is not specified HOT 4
- Add options for self-register details HOT 11
- Script recognized workgroup as domain HOT 15
- SelfService API: Make PowerShell Args prior to API
- Deprecate PowerShell Version 2 HOT 1
- Make results of -DumpIcingaConfig available as object HOT 11
- Installation fails in various ways when host already exists in icinga HOT 14
- Problems in combination with NSClient++ HOT 2
- Prefer Agent Name Argument over FetchName / Fetch FQDN Argument
- Global Zones not set with default values
- Global Zone global-templates is missing in defaults
- Add http timeout as a parameter HOT 1
- Do not set display_name property HOT 1
- NoReboot Flag for additional Bundled MSI installers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from icinga2-powershell-module.