---
  - name: Create exemONE Agent Directory
    ansible.builtin.file:
      path: "{{ EXEM_HOME }}"
      state: directory
      mode: '0755'

  - name: Copy rsync install rpm OS - 7
    ansible.builtin.copy:
      src: "{{ role_path }}/files/rpm/rhel7.rpm"
      dest: "{{ EXEM_HOME }}/rhel7.rpm"
      mode: '0755'
    when: ansible_distribution_major_version == '7'

  - name: install rsync os version 7
    ansible.builtin.shell: "yum localinstall -y {{ EXEM_HOME }}/rhel7.rpm"
    when: ansible_distribution_major_version == '7'

  - name: Copy rsync install rpm OS - 8
    ansible.builtin.copy:
      src: "{{ role_path }}/files/rpm/rhel8.rpm"
      dest: "{{ EXEM_HOME }}/rhel8.rpm"
      mode: '0755'
    when: ansible_distribution_major_version == '8'

  - name: install rsync os version 8
    ansible.builtin.shell: "yum localinstall -y {{ EXEM_HOME }}/rhel8.rpm"
    when: ansible_distribution_major_version == '8'

  - name: Copy rsync install rpm OS - 9
    ansible.builtin.copy:
      src: "{{ role_path }}/files/rpm/rhel9.rpm"
      dest: "{{ EXEM_HOME }}/rhel9.rpm"
      mode: '0755'
    when: ansible_distribution_major_version == '9'

  - name: install rsync os version 9
    ansible.builtin.shell: "yum localinstall -y {{ EXEM_HOME }}/rhel9.rpm"
    when: ansible_distribution_major_version == '9'