Ersetze mgrote.pve-nag-buster --> ironicbadger.proxmox-nag-removal (#12)

This commit is contained in:
Quotengrote 2020-08-24 20:07:39 +02:00 committed by GitHub
parent 2bbdd26728
commit 9b23b70793
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 59 additions and 53 deletions

View file

@ -1,7 +1,7 @@
--- ---
- hosts: virt - hosts: virt
roles: roles:
- { role: mgrote.pve_nag-buster, tags: "nag-buster" } - { role: ironicbadger.proxmox-nag-removal, tags: "nag", become: yes }
- { role: mgrote.apcupsd, tags: "apcupsd" } - { role: mgrote.apcupsd, tags: "apcupsd" }
- { role: mgrote.smart, tags: "smart" } - { role: mgrote.smart, tags: "smart" }
- { role: mgrote.zfs_tools, tags: "zfs_tools" } - { role: mgrote.zfs_tools, tags: "zfs_tools" }

View file

@ -0,0 +1,5 @@
# ironicbadger/ansible-role-proxmox-nag-removal
This role removes the obnoxious Proxmox 'please subscribe' dialog box from a non subscribed server. It will also by default ensure that the enterprise repos are disabled.
Tested and working with Proxmo 5.4-4.

View file

@ -0,0 +1,4 @@
---
remove_nag: True
remove_enterprise_repo: True

View file

@ -0,0 +1,6 @@
---
- name: restart pveproxy
service:
name: pveproxy
state: restarted

View file

@ -0,0 +1,14 @@
---
galaxy_info:
author: Alex Kretzschmar
description: Removes Proxmox nag screen
issue_tracker_url: https://github.com/ironicbadger/ansible-role-proxmox-nag-removal/issues
license: GPLv2
min_ansible_version: 2.7
platforms:
- name: Debian
versions:
- all
categories:
- system
- web

View file

@ -0,0 +1,9 @@
---
- name: removes subscription nag box
include: remove-nag.yml
when: remove_nag
- name: remove enterprise repos
include: remove-enterprise-repo.yml
when: remove_enterprise_repo

View file

@ -0,0 +1,6 @@
---
- name: Ensure enterprise repo file is not present
file:
path: /etc/apt/sources.list.d/pve-enterprise.list
state: absent

View file

@ -0,0 +1,14 @@
---
- name: backup up original file
copy:
remote_src: True
src: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
dest: "/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js.bak-{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
- name: modify line which performs license check
replace:
path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
regexp: "data.status \\!== \\'Active\\'"
replace: "false"
notify: restart pveproxy

View file

@ -1,11 +0,0 @@
## mgrote.pve_nag-buster
### Beschreibung
Laedt das Script "pve_nag-buster" gerunter und fuehrt es aus.
### Funktioniert auf
- [x] ProxMox 6.1
### Variablen
##### Bei jedem Lauf Update durchführen?
pve_nag_buster_update: false

View file

@ -1 +0,0 @@
pve_nag_buster_update: false

View file

@ -1,40 +0,0 @@
- name: check if updates should be applied
become: yes
stat:
path: "/root/pve-nag-buster/is_installed"
register: "is_installed"
# - name: dbug
# debug:
# msg: "{{ is_installed }}"
# - set_fact: is_installed.stat.exists = false
# when: pve_nag_buster_update == true
- name: create "/root/pve-nag-buster"
become: yes
file:
path: /root/pve-nag-buster
state: directory
when: (not is_installed.stat.exists) or (pve_nag_buster_update)
- name: download nag-buster-script
become: yes
get_url:
url: https://raw.githubusercontent.com/foundObjects/pve-nag-buster/master/install.sh
dest: /root/pve-nag-buster/install.sh
mode: 775
when: (not is_installed.stat.exists) or (pve_nag_buster_update)
- name: execute script
become: yes
command: /root/pve-nag-buster/install.sh
when: (not is_installed.stat.exists) or (pve_nag_buster_update)
- name: touch "update"
become: yes
file:
path: /root/pve-nag-buster/is_installed
state: touch
access_time: preserve
modification_time: preserve