Automatically uninstall software when changing OUs with WAPT

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
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
Baki
Messages: 2
Registration: July 19, 2023 - 09:25

July 24, 2023 - 2:35 PM

Hello everyone,

I need some information regarding a configuration I want to set up with WAPT.

Here's an example to better explain:

I have two PCs:
"PC_RH" in the OU "OU_RH"
and "PC_ACCUEIL" in the OU "OU_ACCUEIL".

For "OU_RH", I created a unit package that installs 7-Zip and VLC.
For "OU_ACCUEIL", I created a unit package that installs Firefox and VS Code.

Thanks to these unit packages, the software installs automatically on both PCs.

Now, let's imagine I swap the two PCs in the OU: the "Accueil" PC ends up in "OU_RH" and the "RH" PC in "OU_ACCUEIL".

This will then install the remaining software on the PCs, so they will end up with a total of four programs: 7-Zip, VLC, Firefox, and VS Code.
My question is: is there a way to automatically uninstall the software that was required in the old OU?

The "OU=...." package is indeed deleted and replaced by the new one, but the software it contained remains installed.

Thank you in advance for your advice and help. :D

WAPT version: 2.3
Server OS: Windows Server 2019
Administration machine OS: Windows 10
User avatar
dcardon
WAPT Expert
Messages: 1932
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

July 24, 2023 - 4:46 PM

Hi Antoine,

WAPT works on the principle of "the packages I need must be installed" (at a minimum).

So if there are more, it's not a problem for the WAPT agent. In fact, it's possible to install packages manually via the command line with `wapt-get install`, or through self-service, or through a dependency on another package (or group of packages).

Therefore, to perform this type of cleanup, you would need to check the origin of the installation and verify that the package wasn't installed as a dependency on the OU to allow for a Debian-style "autoremove". We already have an internal ticket for this, but it's not planned for a future release.

Alternatively, you could create a package that forces the uninstallation of packages that aren't inherited from the OU if needed.

Best regards,

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
Locked