
- name: Adding in epel-release repo for RHEL8
  ansible.builtin.shell:
    cmd: |
       subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms
       yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
  when: ansible_distribution_major_version == '8'

- name: Ensure that existing packages are up-to-date
  yum: update_cache=yes state=latest
  
- name: Install prerequisites
  yum: name={{ item }} update_cache=yes state=latest
  loop: [
    # 'epel-release',
    'subversion', 'gcc', 'gcc-c++', 'make', 'wget',
    'perl-Devel-Peek', 'perl-Net-Ping',
    
    # As well as using 'unzip', the greenstone3 compile sequence currently uses
    # 'zip' in a handful of places, such as:
    #     <gsdl3srchome>/gli/makejar.sh
    'zip', 'unzip',

    # Choosing to install the latest (for Redhat forked) ImageMagick,
    # rather than work with the one included as a Greenstone3
    # extension, as that latter is getting a bit old 'GraphicsMagick',
    #'GraphicsMagick', 'ghostscript',
    'ImageMagick', 'ghostscript',
    
    
    # The following needed for WebSwing on a headless server
    #'libxrender1', 'libxtst6', 'libxi6',
    'xorg-x11-server-Xvfb',

    # The following are nice to have in general
    'mlocate', 'emacs-nox' 
    ]
