diff --git a/.gitignore b/.gitignore index b482e5e..285807f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ __pycache__ site.retry *.pyc +hosts.debug diff --git a/roles/pve-subscribe/files/apt-pve-subscribe b/roles/pve-subscribe/files/apt-pve-subscribe new file mode 100644 index 0000000..a205229 --- /dev/null +++ b/roles/pve-subscribe/files/apt-pve-subscribe @@ -0,0 +1 @@ +DPkg::Post-Invoke { "/usr/local/bin/pve-subscribe"; }; diff --git a/roles/pve-subscribe/files/pve-subscribe b/roles/pve-subscribe/files/pve-subscribe new file mode 100755 index 0000000..ca9fc45 --- /dev/null +++ b/roles/pve-subscribe/files/pve-subscribe @@ -0,0 +1,5 @@ +#!/bin/bash +# Disable annoying license dialog +# by Sprinter +# +sed -i.bak 's/NotFound/Active/g' /usr/share/perl5/PVE/API2/Subscription.pm && systemctl restart pveproxy.service diff --git a/roles/pve-subscribe/tasks/main.yml b/roles/pve-subscribe/tasks/main.yml new file mode 100644 index 0000000..babad5b --- /dev/null +++ b/roles/pve-subscribe/tasks/main.yml @@ -0,0 +1,10 @@ +--- + +- name: Installing pve-subscribe script + copy: src=pve-subscribe dest=/usr/local/bin/pve-subscribe mode=0755 owner=root + +- name: Configuring cron to run pve-subscribe hook after reboot + cron: name=pve-subscribe special_time=reboot job=/etc/cron.d/pve-subscribe + +- name: Configuring apt to run pve-subscribe hook + copy: src=apt-pve-subscribe dest=/etc/apt/apt.conf.d/99pve-subscribe mode=0644 diff --git a/site.yml b/site.yml index 2bfbdcb..261b373 100644 --- a/site.yml +++ b/site.yml @@ -4,3 +4,4 @@ hosts: all roles: - vmhost + - pve-subscribe