zuul-jobs/roles/install-nodejs/tasks/distros/install_Fedora.yaml

33 lines
1.1 KiB
YAML

- name: Install Nodesource repository (Fedora < 29)
package:
name: "https://rpm.nodesource.com/pub_{{ node_version }}.x/fc/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/nodesource-release-fc{{ ansible_distribution_major_version }}-1.noarch.rpm"
state: present
when:
- ansible_distribution_major_version < 29
become: yes
- name: Fail installation if node version < 11 (Fedora >= 29)
fail:
msg: Fedora 29 and later only support NodeJS >= 11.x
when:
- ansible_distribution_major_version >= 29
- node_version < 11
- name: Install Nodesource repository (Fedora >= 29)
package:
name: "https://rpm.nodesource.com/pub_{{ node_version }}.x/fc/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/nodesource-release-fc{{ ansible_distribution_major_version }}-1.noarch.rpm"
state: present
when:
- ansible_distribution_major_version >= 29
- node_version >= 11
become: yes
- name: Install NodeJS
package:
name: "nodejs"
state: latest
become: yes
tags:
# Ignore ANSIBLE0010: We really want latest version
- skip_ansible_lint