vh-ansible/roles/pve-subscribe/tasks/main.yml
Jan-Jonas Sämann 8c9ce3ded4 Fail role/pve-subscribe on incompatible target
Allow role/pve-subscribe to fail on incompatible target without failing
the entire playbook run. This allows the playbook to easely setup the
environment against non-proxmox targets.
2020-05-10 19:47:42 +02:00

20 lines
527 B
YAML

---
- block:
- name: Protect non-pve systems
fail:
msg: 'Target system is not instance of Proxmox'
when: ansible_facts.cmdline.BOOT_IMAGE.find('-pve') == -1 or
ansible_virtualization_role != "host" # Catches lxc guests on pve kernel
- name: Configuring pve for unsubscribed operation
import_tasks: no-subscription.yml
when: not pve_subscription_key
- name: Configuring pve for licensed operation
import_tasks: enterprise.yml
when: pve_subscription_key
rescue:
- meta: noop