---
- hosts: pfservers
  name: Configure Packetfence VM
  become: True

  tasks:
    - name: Install Cypress dependencies on debian
      community.general.make:
        chdir: /usr/local/pf/t/html/pfappserver
        target: install-debian
        file: /usr/local/pf/t/html/pfappserver/Makefile
      become: yes
      when: ansible_facts['os_family'] == "Debian"
      tags: cypress

    - name: Install Cypress dependencies on el8
      community.general.make:
        chdir: /usr/local/pf/t/html/pfappserver
        target: install-rhel
        file: /usr/local/pf/t/html/pfappserver/Makefile
      become: yes
      when: ansible_facts['os_family'] == "RedHat"

    - name: Install Cypress
      community.general.make:
        chdir: /usr/local/pf/t/html/pfappserver
        target: install
        file: /usr/local/pf/t/html/pfappserver/Makefile
      become: true
      tags: cypress
