tasks:
- name: Update APT cache
- apt:
+ ansible.builtin.package:
update_cache: yes
when: ansible_distribution == 'Ubuntu'
become: true
- - rpm_key:
+ - name: Install GPG certs
+ ansible.builtin.rpm_key:
state: present
key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8
when: ansible_os_family == 'RedHat'
become: true
- name: Install EPEL repository
- yum:
+ ansible.builtin.yum:
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
state: present
when: ansible_os_family == 'RedHat'
become: true
- name: Install yum-plugin-versionlock
- yum:
+ ansible.builtin.yum:
name:
- yum-plugin-versionlock
when: ansible_os_family == 'RedHat'
become: true
- name: Install mock
- yum:
+ ansible.builtin.yum:
name:
- mock-2.17-1.el7
state: present
become: true
- name: Lock mock-core-configs version$
- command: yum versionlock mock
+ 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
- yum:
+ 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:
---
- name: Load operating-system specific variables
- include_vars: "{{ item }}"
+ ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
# Required for direct install of parallel package from linuxsoft.cern.ch
-- rpm_key:
+- 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'
become: true
- name: Install LF Recommended Tools on RedHat
- yum:
+ ansible.builtin.yum:
name: "{{ lf_recommended_tools_packages }}"
state: present
when: ansible_os_family == 'RedHat'
- name: Install LF Recommended Tools on Debian
# Note: apt module requires state: 'fixed' not in dnf or yum modules
- apt:
+ ansible.builtin.package:
name: "{{ lf_recommended_tools_packages }}"
state: fixed
when: ansible_os_family == 'Debian'
become: true
- name: Install fedora-packager
- yum: name=fedora-packager state=present
+ ansible.builtin.yum:
+ name:
+ - fedora-packager
+ state: present
when: ansible_os_family == 'RedHat'
become: true
- name: Install PlantUML
+ become: true
block:
- name: Create /opt/plantuml install directory
- file:
+ ansible.builtin.file:
path: /opt/plantuml
state: directory
mode: 0755
- name: Fetch PlantUML
- get_url:
+ ansible.builtin.get_url:
url: https://sourceforge.net/projects/plantuml/files/plantuml.jar/download
- validate_certs: no
+ validate_certs: false
dest: /opt/plantuml/plantuml.jar
mode: 0644
register: result
retries: 3
delay: 30
- name: Install PlantUML executable script
- copy:
+ ansible.builtin.copy:
content: |
#!/bin/sh
exec java -jar /opt/plantuml/plantuml.jar "$@"
dest: /usr/local/bin/plantuml
mode: 0755
- become: true
- name: Add NodeSource repository/NodeJS
vars:
nodejs_version: "16.x"
block:
- name: Add NodeSource repository/NodeJS under RedHat/CentOS
+ become: true
when: ansible_facts['os_family'] == 'RedHat'
block:
- name: Set up the Nodesource RPM directory.
- set_fact:
+ ansible.builtin.set_fact:
nodejs_rhel_rpm_dir: "pub_{{ nodejs_version }}"
- name: Import Nodesource RPM key
- rpm_key:
+ ansible.builtin.rpm_key:
key:
https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL
state: present
- name: Add Nodesource repositories for Node.js (CentOS 7+).
- yum:
+ ansible.builtin.yum:
name:
"https://rpm.nodesource.com/{{ nodejs_rhel_rpm_dir }}/el/\
{{ ansible_distribution_major_version }}/\
register: node_repo
- name: Update package cache if repo was added.
- yum: update_cache=yes
+ ansible.builtin.yum: update_cache=yes
when: node_repo is changed
tags: ["skip_ansible_lint"]
- name: Ensure Node.js AppStream module is disabled (CentOS 8+).
- ansible.builtin.command: yum module disable -y nodejs
+ 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
- name: Ensure Node.js and npm are installed.
- yum:
+ ansible.builtin.yum:
name: "nodejs-{{ nodejs_version | regex_replace('x', '') }}*"
state: present
- become: true
- name: Add NodeSource repository/NodeJS under Ubuntu
+ become: true
when: ansible_facts['distribution'] == 'Ubuntu'
block:
- name: Import the NodeSource GPG key into apt
- apt_key:
+ ansible.builtin.apt_key:
url: "https://keyserver.ubuntu.com/pks/lookup?\
op=get&fingerprint=on&search=0x1655A0AB68576280"
id: "68576280"
state: present
- name: Add NodeSource deb repository
- apt_repository:
+ ansible.builtin.apt_repository:
repo: "deb https://deb.nodesource.com/node_{{ nodejs_version }} \
{{ ansible_distribution_release }} main"
state: present
- name: Add NodeSource deb-src repository
- apt_repository:
+ ansible.builtin.apt_repository:
repo: "deb-src \
https://deb.nodesource.com/node_{{ nodejs_version }} \
{{ ansible_distribution_release }} main"
state: present
- name: Install Node.js
- apt:
+ ansible.builtin.package:
pkg:
- nodejs
state: present
update_cache: true
- become: true