[pve-devel] [PATCH installer v2 16/17] fix #5536: post-hook: add utility for sending notifications after auto-install

Aaron Lauterer a.lauterer at proxmox.com
Tue Jul 23 16:57:10 CEST 2024


There are quite a few preparation changes in other sub-crates 
(auto-installer, installer-common).
I've only gotten through them for now and haven't looked at the actual 
post-hook crate stuff.

Wouldn't it be nicer to split the preparation patches into their own 
commit? It would make the patch smaller and the history would be a bit 
clearer as we don't mix adding the post-hook crate with all the 
preparation that is needed.

I plan to look at the actual post-hook stuff tomorrow

On  2024-07-18  15:49, Christoph Heiss wrote:
> This utility can be called with the low-level install config after a
> successful installation to send a notification via a HTTP POST request,
> if the user has configured an endpoint for that in the answer file.
> 
> Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
> ---
> Changes v1 -> v2:
>    * squash implementation and unit tests into one patch
>    * simplify udev property retrieving by introducing proper helpers on
>      `UdevInfo` itself
>    * rename Answer::from_reader() -> Answer::try_from_reader to better
>      reflect it returns a Result<>
>    * improved error message in some places
>    * added new fields; now includes ISO version, SecureBoot state, CPU
>      and DMI info
>    * product information was split into separate fields
>    * boot mode information was split into separate fields
>    * product version is now retrieved from the package using dpkg-query
>      directly
>    * kernel version was split into separate fields, retrieving version
>      string from the image directly
>    * all disks and NICs are now included, a field indicates whether they
>      are boot disk or management interface, respectively
>    * move with_chroot() invocation out of PostHookInfo::gather()
> 
> Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
> ---
>   Cargo.toml                                    |   1 +
>   Makefile                                      |   8 +-
>   debian/install                                |   1 +
>   proxmox-auto-installer/src/answer.rs          |  16 +-
>   .../src/bin/proxmox-auto-installer.rs         |  13 +-
>   proxmox-auto-installer/src/udevinfo.rs        |   8 +-
>   .../src/fetch_plugins/http.rs                 |   2 +-
>   proxmox-installer-common/src/http.rs          |   6 +-
>   proxmox-installer-common/src/options.rs       |   5 +
>   proxmox-installer-common/src/setup.rs         |   2 +-
>   proxmox-installer-common/src/utils.rs         |   2 +
>   proxmox-post-hook/Cargo.toml                  |  18 +
>   proxmox-post-hook/src/main.rs                 | 784 ++++++++++++++++++
>   13 files changed, 843 insertions(+), 23 deletions(-)
>   create mode 100644 proxmox-post-hook/Cargo.toml
>   create mode 100644 proxmox-post-hook/src/main.rs
> 




More information about the pve-devel mailing list