diff --git a/proxmox_no_nag/files/86pve-no-nag b/proxmox_no_nag/files/86pve-no-nag new file mode 100644 index 0000000..5fb3058 --- /dev/null +++ b/proxmox_no_nag/files/86pve-no-nag @@ -0,0 +1 @@ +DPkg::Post-Invoke { "/usr/local/sbin/pve-no-nag"; }; diff --git a/proxmox_no_nag/files/pve-no-nag b/proxmox_no_nag/files/pve-no-nag new file mode 100644 index 0000000..5c26384 --- /dev/null +++ b/proxmox_no_nag/files/pve-no-nag @@ -0,0 +1,7 @@ +#!/bin/sh +# Disables the "No valid subscription" dialog of the Proxmox web UI. Called by the apt hook +# 86pve-no-nag, because every proxmox-widget-toolkit update restores the file. Without a match +# (changed upstream code) the dialog returns and nothing breaks. +f=/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js +[ -f "$f" ] && sed -i 's/checked_command: function (orig_cmd) {$/& orig_cmd(); return;/' "$f" +exit 0 diff --git a/proxmox_no_nag/tasks/main.yml b/proxmox_no_nag/tasks/main.yml new file mode 100644 index 0000000..a147595 --- /dev/null +++ b/proxmox_no_nag/tasks/main.yml @@ -0,0 +1,15 @@ +- name: Install the subscription nag remover + copy: + src: pve-no-nag + dest: /usr/local/sbin/pve-no-nag + mode: "0755" + +- name: Run it after every dpkg run + copy: + src: 86pve-no-nag + dest: /etc/apt/apt.conf.d/86pve-no-nag + mode: "0644" + +- name: Remove the subscription nag + command: /usr/local/sbin/pve-no-nag + changed_when: false