Modifying the machine package control file

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
Answer
Carla Scardigli
Messages: 6
Registration: Apr 30, 2024 - 08:22

April 30, 2024 - 08:42

Good morning,

I would like to be able to modify the "control" file of the machine package within a WAPT package.
For now, I am able to display it.
Here is the code that displays it:

Code: Select all

def install():

    w = common.Wapt()
    package  = PackageEntry(w.host_uuid)
    # Récupère les fichiers control de tous les paquets présent sur la machine
    package_version = package.get("package_uuid")
    l = w.list()
    # Parcours ces fichiers
    for elt in l:
    # Si le nom du paquet est celui du paquet machine on l'affiche
        if elt["package"] == w.host_uuid:
            print(elt)
       
This code displays all the contents of the "control" file in the machine package.

I tried this:

Code: Select all

elt["depends"] = None
This code displays the "control" file with the "depends" section empty, but this change is not saved.

I also couldn't find where this file is stored on the machine.

Do you have any idea how to do it?
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

April 30, 2024 - 11:01

Hello,

I don't understand what you're trying to do.

It seems you want to modify a machine package in WAPT.install.

However, the machine that will install the package doesn't have the private key needed to sign it (fortunately), and the machine doesn't have access to upload packages (fortunately).

In my opinion, there's probably something we can suggest, but you'd need to explain the exact context and purpose of what you want to do.
Carla Scardigli
Messages: 6
Registration: Apr 30, 2024 - 08:22

May 3, 2024 - 12:05

Good morning,

This request is related to the following request: viewtopic.php?t=3833

We would like it so that when a packet has successfully passed through the machine (Status OK) a code removes the dependency from the machine package.
The script that would perform this deletion could be added to the audit (For example)
Because we manage a fairly large number of packages and it is unnecessary to have dozens of dependent packages.

Our idea was therefore to remove this package (its name) from the "depends"of the file"control" from the machine package (package name = uuid)

We have this in the control file of the machine package:

Code: Select all

depends           : un_paquet
After the code has executed, we would like to have this:

Code: Select all

depends           :
(part "depends" empty)

As explained previously, we have a code that allows us todisplay this file "control"but we are unable to change it.".

How can we do it?

Do you have any other ideas for removing this dependency?
User avatar
dcardon
WAPT Expert
Messages: 1932
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

May 3, 2024 - 3:33 PM

Hello Carla,

the machine package must be signed, so a signing key is required to modify the machine package's control file. The machine doesn't have a key, so it can't modify the control file because it can't be signed (or uploaded), and therefore the modified package will be useless.

Modifying the machine package can be done at the admin console level (which has a signing key) or with an automated script on the server, preferably using a key that isn't code-signing.

That said, could you clarify your needs? Having the package remain assigned to the machine allows for automatic application updates or reinstallation if it was accidentally deleted. Do you want to remove all dependencies from a machine package, or just a package that isn't intended to remain there?

Sincerely,

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
Carla Scardigli
Messages: 6
Registration: Apr 30, 2024 - 08:22

May 6, 2024 - 08:13

Hello,

Accidental uninstallation is virtually impossible in our processes.
We need to be able to remove all dependencies of the `machine` package. When we clean our repository, packages dependent on the `machine` package return an error.

Thank you for helping us find a solution.

Sincerely,
Answer