External variables to a package

Share your tips or issues concerning the WAPT Console or WAPT Agent here
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
dani
Messages: 11
Registration: Nov 29, 2018 - 09:38

November 29, 2018 - 09:57

Hello everyone :-)

I'm currently evaluating WAPT to replace a custom-built solution (based on WPKG). First off, kudos to the developers, WAPT is incredibly well-designed!

I do have a small challenge, on which I am still thinking about the best solution (so I am including everyone in this discussion because I think it is a problem that can impact other people).

The challenge is: how to use variables within a package without hardcoding their values ​​into the package itself. Let me explain with an example:

I have several sites to manage, each with its own network range. Each site has a Zabbix proxy for monitoring site elements. Now, I want to create a package to deploy the Zabbix agent. Except that
  • For each site, I need to specify the IP address of the proxy that will be able to query the agent (and open the port in the firewall for that IP address)
  • I would prefer not to have to maintain a separate package for each site
Therefore, I would need to be able to create a generic "zabbixagent" package that uses a variable from elsewhere in the setup.

Ideally (meaning: a small NFR) ;-) It would be necessary to be able to define key=value pairs in group or host type packages that could override variables of the same name in a package; this would allow for a very simple approach :-)

But from what I've read, that's not possible yet. So I'm looking for another way.

I thought about creating a variables-site1 package that would drop a JSON file onto the machines containing site-specific values, and other packages could then read this JSON file to populate their variables. However, I have a timing issue: this variables-siteXXX package absolutely must be deployed first. And I can't make it a dependency of my zabbixagent package because the name will be different for each site.

Therefore, my only remaining option is to manually install the variables-siteXXX package on each machine, at the same time as installing the agent

Does anyone have a better idea? What solution do you use for this problem, which must be quite common?

Note: I'm currently evaluating WAPT, so I'm using the community version. It's possible the enterprise version adds features for this, but I haven't seen anything in the documentation that comes close...

Note 2: I hesitated between the Packages section and the Usage section; you can move this message if you deem it necessary :-)
Locked