tasks:
- name: Update APT cache
ansible.builtin.package:
- update_cache: yes
- when: ansible_distribution == 'Ubuntu'
+ update_cache: true
+ when: ansible_facts['distribution'] == 'Ubuntu'
become: true
- - name: Install GPG certs
- ansible.builtin.rpm_key:
+ - name: Install EPEL for CentOS/RHEL 9+
+ ansible.builtin.dnf:
+ name: epel-release
state: present
- key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8
- when: ansible_os_family == 'RedHat'
+ when: ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] is version('9', '>=')
become: true
- - name: Install EPEL repository
+ - name: Install EPEL for CentOS/RHEL 8
ansible.builtin.yum:
- name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
+ name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_facts['distribution_major_version'] }}.noarch.rpm
state: present
- when: ansible_os_family == 'RedHat'
+ disable_gpg_check: true
+ when: ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '8'
become: true
- - name: Install yum-plugin-versionlock
- ansible.builtin.yum:
- name:
- - yum-plugin-versionlock
- when: ansible_os_family == 'RedHat'
- become: true
-
- - name: Install mock
- ansible.builtin.yum:
- name:
- - mock-2.17-1.el7
- state: present
- when:
- - ansible_os_family == 'RedHat' and ansible_distribution_major_version == "7"
- become: true
-
- - name: Lock mock-core-configs version$
- ansible.builtin.command: yum versionlock mock
- when:
- - ansible_os_family == 'RedHat' and ansible_distribution_major_version == "7"
- become: true
-
- - name: Install mock-core-configs from remote repo
- ansible.builtin.yum:
- name: https://rpmfind.net/linux/epel/testing/7/aarch64/Packages/m/mock-core-configs-31.6-1.el7.noarch.rpm
- state: present
- when:
- - ansible_os_family == 'RedHat' and ansible_distribution_major_version == "7"
+ - name: Replace curl-minimal with curl on CentOS 9+
+ ansible.builtin.shell: |
+ dnf remove -y curl-minimal && dnf install -y curl
+ when: ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] is version('9', '>=')
become: true
+ changed_when: true
- name: Load operating-system specific variables
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml"
- - "{{ ansible_distribution }}.yaml"
- - "{{ ansible_os_family }}.yaml"
+ - files:
+ - "{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yaml"
+ - "{{ ansible_facts['distribution'] }}.yaml"
+ - "{{ ansible_facts['os_family'] }}.yaml"
+ paths:
+ - "vars"
# Required for direct install of parallel package from linuxsoft.cern.ch
- name: Install RPM GPG certs
ansible.builtin.rpm_key:
state: present
key: https://linuxsoft.cern.ch/cern/centos/7/os/x86_64/RPM-GPG-KEY-cern
- when: ansible_os_family == 'RedHat'
+ when: ansible_facts['os_family'] == 'RedHat'
become: true
- name: Install LF Recommended Tools on RedHat
ansible.builtin.yum:
name: "{{ lf_recommended_tools_packages }}"
state: present
- when: ansible_os_family == 'RedHat'
+ when: ansible_facts['os_family'] == 'RedHat'
become: true
- name: Install pre-packages on Debian
state: present
when:
- ansible_facts['distribution'] == 'Ubuntu'
- - ansible_distribution_major_version | int >= 24
+ - ansible_facts['distribution_major_version'] | int >= 24
become: true
- name: Install LF Recommended Tools on Debian
ansible.builtin.package:
name: "{{ lf_recommended_tools_packages }}"
state: fixed
- when: ansible_os_family == 'Debian'
+ when: ansible_facts['os_family'] == 'Debian'
become: true
- name: Install fedora-packager
name:
- fedora-packager
state: present
- when: ansible_os_family == 'RedHat'
+ when: ansible_facts['os_family'] == 'RedHat'
become: true
- name: Install PlantUML
ansible.builtin.yum:
name:
"https://rpm.nodesource.com/{{ nodejs_rhel_rpm_dir }}/el/\
- {{ ansible_distribution_major_version }}/\
- {{ ansible_architecture }}/nodesource-release-el\
- {{ ansible_distribution_major_version }}-1.noarch.rpm"
+ {{ ansible_facts['distribution_major_version'] }}/\
+ {{ ansible_facts['architecture'] }}/nodesource-release-el\
+ {{ ansible_facts['distribution_major_version'] }}-1.noarch.rpm"
state: present
when:
- - ansible_distribution_major_version | int >= 7
- - ansible_distribution_major_version | int <= 8
+ - ansible_facts['distribution_major_version'] | int >= 7
+ - ansible_facts['distribution_major_version'] | int <= 8
register: node_repo
- name: Update package cache if repo was added.
ansible.builtin.command: yum module disable -y nodejs # noqa command-instead-of-module
register: module_disable
changed_when: "'Nothing to do.' not in module_disable.stdout"
- when: ansible_distribution_major_version | int >= 8
+ when: ansible_facts['distribution_major_version'] | int >= 8
- name: Ensure Node.js and npm are installed.
ansible.builtin.yum: