- name: jitsimeet | adjust limits
  blockinfile:
    path: "/etc/systemd/system.conf"
    block: |
      DefaultLimitNOFILE=65000
      DefaultLimitNPROC=65000
      DefaultTasksMax=65000

- block:
  - name: jitsimeet | reload systemd
    systemd:
      daemon_reload: true
    when: preinstalled == false or preinstalled is not defined

  - name: jitsimeet | import GPG key
    apt_key:
      url: "https://download.jitsi.org/jitsi-key.gpg.key"
      state: present # not required. choices: absent;present. Ensures that the key is present (added) or absent (revoked).
    when: preinstalled == false or preinstalled is not defined

  - name: jitsimeet | add repository
    lineinfile:
      path: "/etc/apt/sources.list.d/jitsi-stable.list"
      line: "deb https://download.jitsi.org stable/"
      create: True
      backup: True
    notify: apt_update
    when: preinstalled == false or preinstalled is not defined

  - name: jitsimeet | flush handlers
    meta: flush_handlers

  - name: jitsimeet | add debconf-utils package
    package:
      name: debconf-utils
      state: latest
    when: preinstalled == false or preinstalled is not defined