Added conditional repo config to pve-subscribe
This commit introduces a new inventory host variable: pve_enterprise=False If set to True, apt sources and environment on the target is configured for subscribed operation. If set to False annoying "subscribe me" popups are disabled and apt sources are configured to the no-subscription repositorys. The default value is False. Proxmox's default state after installation is similar to pve_enterprise=True. This Role must be called before first apt call.
This commit is contained in:
parent
e916da0667
commit
17eac6723b
1
roles/pve-subscribe/files/pve-enterprise.list
Normal file
1
roles/pve-subscribe/files/pve-enterprise.list
Normal file
@ -0,0 +1 @@
|
|||||||
|
deb https://enterprise.proxmox.com/debian/pve stretch pve-enterprise
|
1
roles/pve-subscribe/files/pve-no-subscription.list
Normal file
1
roles/pve-subscribe/files/pve-no-subscription.list
Normal file
@ -0,0 +1 @@
|
|||||||
|
deb http://download.proxmox.com/debian stretch pve-no-subscription
|
17
roles/pve-subscribe/tasks/enterprise.yml
Normal file
17
roles/pve-subscribe/tasks/enterprise.yml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Unset no-subscription repo
|
||||||
|
file: path=/etc/apt/sources.list.d/pve-no-subscription.list state=absent
|
||||||
|
|
||||||
|
- name: Configuring enterprise repo
|
||||||
|
copy: src=pve-enterprise.list dest=/etc/apt/sources.list.d/pve-enterprise.list
|
||||||
|
|
||||||
|
- name: Removing previously installed pve-subscribe hook for cron
|
||||||
|
cron: name=pve-subscribe special_time=reboot job=/etc/cron.d/pve-subscribe state=absent
|
||||||
|
|
||||||
|
- name: Removing previously installed pve-subscribe hook for apt
|
||||||
|
file: path=/etc/apt/apt.conf.d/99pve-subscribe state=absent
|
||||||
|
|
||||||
|
- name: Removing previously installed pve-subscribe script
|
||||||
|
file: path=/usr/local/bin/pve-subscribe state=absent
|
||||||
|
|
@ -1,10 +1,9 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: Installing pve-subscribe script
|
- name: Configuring pve for unsubscribed operation
|
||||||
copy: src=pve-subscribe dest=/usr/local/bin/pve-subscribe mode=0755 owner=root
|
import_tasks: no-subscription.yml
|
||||||
|
when: pve_enterprise | default(False) != True
|
||||||
|
|
||||||
- name: Configuring cron to run pve-subscribe hook after reboot
|
- name: Configuring pve for licensed operation
|
||||||
cron: name=pve-subscribe special_time=reboot job=/etc/cron.d/pve-subscribe
|
import_tasks: enterprise.yml
|
||||||
|
when: pve_enterprise | default(False) == True
|
||||||
- name: Configuring apt to run pve-subscribe hook
|
|
||||||
copy: src=apt-pve-subscribe dest=/etc/apt/apt.conf.d/99pve-subscribe mode=0644
|
|
||||||
|
16
roles/pve-subscribe/tasks/no-subscription.yml
Normal file
16
roles/pve-subscribe/tasks/no-subscription.yml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Unset enterprise repo
|
||||||
|
file: path=/etc/apt/sources.list.d/pve-enterprise.list state=absent
|
||||||
|
|
||||||
|
- name: Configuring no-subscription repo
|
||||||
|
copy: src=pve-no-subscription.list dest=/etc/apt/sources.list.d/pve-no-subscription.list
|
||||||
|
|
||||||
|
- 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
|
Loading…
Reference in New Issue
Block a user