# -*- mode: yaml; indent-tabs-mode: nil; tab-width: 2; coding: utf-8-unix -*-
---

# from BOX
toxcore_system_users: "{{ base_system_users }}"
toxcore_standard_users: "{{ base_standard_users }}"

toxcore_etc_initd_libvirt_name: libvirtd

toxcore_kmods_in_host:
  - "{{ 'kvm' if ( ( 'qemu' in TOXCORE_FEATURES or 'libvirt' in TOXCORE_FEATURES ) and 'virtualbox' not in TOXCORE_FEATURES ) else '' }}"
  - "{{ 'qxl' if ( 'qemu' in TOXCORE_FEATURES or 'libvirt' in TOXCORE_FEATURES ) else '' }}"
  - "{{ 'nbd' if ( 'qemu' in TOXCORE_FEATURES or 'libvirt' in TOXCORE_FEATURES ) else '' }}"

toxcore_kmods_not_in_host:
  # I'm not sure kvm should be missing anymore 5+
  # FixMe: how do these conflict? qemu libvirt
  - "{{ 'kvm' if 'virtualbox' in TOXCORE_FEATURES else '' }}"

toxcore_gpg_keys_system:

  # 
  - uid: "9BAD8B9BBD1CBDEDE3443292900F3C4971086004"
    primary: "9BAD8B9BBD1CBDEDE3443292900F3C4971086004"
    name: "Harald Hoyer <harald@hoyer.xyz>"
    key: "4BC0896FB5693595"
    fingerprint: "9BAD 8B9B BD1C BDED E344  3292 900F 3C49 7108 6004"
    uri: "https://harald.hoyer.xyz/files/gpg-key.txt"
    html: https://harald.hoyer.xyz/impressum/

toxcore_services_started:
  - "{{ toxcore_libvirt_services_host if 'libvirt' in TOXCORE_FEATURES and ansible_virtualization_role|replace('NA', 'host') == 'host' else [] }}"
  - "{{ toxcore_libvirt_services_guest if 'libvirt' in TOXCORE_FEATURES and ansible_virtualization_role|replace('NA', 'host') != 'host' else [] }}"
  # not on Gentoo 5
  #?  - "{{ 'docker'   if 'docker'  in TOXCORE_FEATURES else '' }}"

toxcore_services_enabled_host: "{{toxcore_services_started}}"

toxcore_services_enabled_guest:
  - qemu-quest-agent
  
toxcore_services_stopped:
  - "{{ toxcore_libvirt_services if 'libvirt' not in TOXCORE_FEATURES else [] }}"

