diff --git a/files/pve-remove-nag.sh b/files/pve-remove-nag.sh new file mode 100644 index 0000000..519e3b2 --- /dev/null +++ b/files/pve-remove-nag.sh @@ -0,0 +1,46 @@ +#!/bin/sh +# source: https://github.com/community-scripts/ProxmoxVE/blob/main/tools/pve/post-pve-install.sh +# Commit c464b95 + +WEB_JS=/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js +if [ -s "$WEB_JS" ] && ! grep -q NoMoreNagging "$WEB_JS"; then + echo "Patching Web UI nag..." + sed -i \ + -e "/data\.status/ s/!//" \ + -e "/data\.status/ s/active/NoMoreNagging/" \ + "$WEB_JS" +fi + +MOBILE_TPL=/usr/share/pve-yew-mobile-gui/index.html.tpl +MARKER="" +if [ -f "$MOBILE_TPL" ] && ! grep -q "$MARKER" "$MOBILE_TPL"; then + echo "Patching Mobile UI nag..." + cat <<'EOF' >> "$MOBILE_TPL" + + +EOF +fi diff --git a/tasks/subscription.yml b/tasks/subscription.yml index ba8750e..9ad5f35 100644 --- a/tasks/subscription.yml +++ b/tasks/subscription.yml @@ -12,60 +12,13 @@ path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js register: proxmoxlib_js -- name: Install pve-remove-nag script +- name: subscription | Install pve-remove-nag script ansible.builtin.copy: + src: pve-remove-nag.sh dest: /usr/local/bin/pve-remove-nag.sh owner: root group: root mode: "0755" - content: | - #!/bin/sh - # source: https://github.com/community-scripts/ProxmoxVE/blob/main/tools/pve/post-pve-install.sh - # Commit c464b95 - WEB_JS=/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js - if [ -s "$WEB_JS" ] && ! grep -q NoMoreNagging "$WEB_JS"; then - echo "Patching Web UI nag..." - sed -i -e "/data\.status/ s/!//" -e "/data\.status/ s/active/NoMoreNagging/" "$WEB_JS" - fi - - MOBILE_TPL=/usr/share/pve-yew-mobile-gui/index.html.tpl - MARKER="" - if [ -f "$MOBILE_TPL" ] && ! grep -q "$MARKER" "$MOBILE_TPL"; then - echo "Patching Mobile UI nag..." - printf "%s\n" \ - "$MARKER" \ - "" \ - "" >> "$MOBILE_TPL" - fi when: proxmoxlib_js.stat.exists - name: Install APT post-invoke hook for nag removal