WAPT Update/Upgrade Package for Linux Machines

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
Maggle
Messages: 7
Registration: March 20, 2024 - 2:22 PM

March 20, 2024 - 3:48 PM

Good morning,

I've been using WAPT for a short time, mainly on Windows machines using Tranquil It packages, no custom packages.

I'm trying to create a package to automatically update Debian machines. So, something very simple: `apt update` followed by `apt upgrade -y`

So I installed the agent etc. and produced the following very simple code:

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *

def install():
    print("Installation de : %s" % control.package)

    # Exécute apt update
    print("Exécution de apt update...")
    run('apt', 'update')

    # Exécute apt upgrade
    print("Exécution de apt upgrade...")
    run('apt', 'upgrade', '-y')

def uninstall():
    print("Désinstallation de : %s" % control.package)
    

I don't even know if my code is correct and I can't find a chapter in the WAPT 2.4 documentation for creating packages for Linux.

And then I put this package in my repository and I can't deploy it on my Debian machine.
I push it into the "dependencies" section on my Linux machine, just as I would with a package on a Windows machine
WAPT_linux.png
WAPT_linux.png (101.42 KB) Viewed 5867 times

I'm missing some prerequisites, my code is incorrect?
I don't think I have any certificate or signature issues since my wapt-get.ini file looks like this:

Code: Select all

[global]
repo_url = https://serveurwapt.mondomain.xd/wapt
wapt_server = https://serveurwapt.mondomaine.xd
use_hostpackages = True
use_kerberos = False
verify_cert = False

I don't know if you would know where my problem lies?

Thank you in advance!
User avatar
dcardon
WAPT Expert
Messages: 1930
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

March 22, 2024 - 09:52

Hi Mathieu,

For the package code, the `run` command launches the contents in a local shell, so you simply need to write the line

Code: Select all

run('apt update')
run('apt upgrade -y')
That said, from a conceptual point of view, the WAPT package should be as self-contained as possible. However, it's a bit complicated in this case. We're currently looking into making the WAPT server also a proxy cache for deb/rpm files, allowing us to pre-download deb/rpm updates into a cache before installation. Indeed, with the increasing complexity of networks (802.1x over Ethernet, Wi-Fi connections, VPN connections, etc.), we can never be certain that the source files will be available when the installation is scheduled.

Regarding the package deployment, your signing certificate must be properly deployed on the machine. Could you please verify that your public certificate is indeed located in /opt/wapt/ssl?

For your information, it is possible to retrieve the command line to automatically configure the agent under Linux from the waptconsole interface:
"Tools" / "Edit agent dynamic configurations" / "Right-click on Default" / "Copy installation command"

After copying the line to your line, you can run the registration. The configuration (URL/repo, certificate, etc.) will be set up automatically.

For your information, in the latest 2.5 we have greatly simplified the deployment of Linux OS with WADS, with the configuration and joining of the machine to the domain.

Sincerely,

Denis

PS: We are very interested in desktop Linux use cases, so if you have any (along with any associated problems), please feel free to report them to us!
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
Patosse
Messages: 1
Registration: May 27, 2024 - 1:55 p.m.

August 30, 2024 - 4:05 PM

Hello,

I've just discovered this post and it's of great interest to me. We're currently using the latest version 2.5 of WAPT, and after installing the Windows updates (like Mathieu), we'd like to start updating Linux (mainly Red Hat).

Can we use this post as a guide (*) or is there perhaps another method for updating our servers?


(*) I changed `apt` to `yum` in the package, but the command doesn't work :(

. Thanks in advance.
Answer