diff --git a/roles/repo_nodejs/defaults/main.yml b/roles/repo_nodejs/defaults/main.yml index 77ade19..546b9a2 100644 --- a/roles/repo_nodejs/defaults/main.yml +++ b/roles/repo_nodejs/defaults/main.yml @@ -1,3 +1,3 @@ --- -nodejs_major_version: 12 +nodejs_major_version: 13 diff --git a/roles/repo_nodejs/tasks/main.yml b/roles/repo_nodejs/tasks/main.yml index 72f77d0..dce11b2 100644 --- a/roles/repo_nodejs/tasks/main.yml +++ b/roles/repo_nodejs/tasks/main.yml @@ -1,10 +1,6 @@ --- - name: Configure NodeJS repository - yum_repository: - name: nodejs - description: Node.js Packages for Enterprise Linux - baseurl: https://rpm.nodesource.com/pub_{{ nodejs_major_version }}.x/el/7/$basearch - gpgcheck: True - gpgkey: https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL + template: src=nodejs.repo.j2 dest=/etc/yum.repos.d/nodejs.repo + tags: repo diff --git a/roles/repo_nodejs/templates/nodejs.repo.j2 b/roles/repo_nodejs/templates/nodejs.repo.j2 new file mode 100644 index 0000000..538c8ec --- /dev/null +++ b/roles/repo_nodejs/templates/nodejs.repo.j2 @@ -0,0 +1,11 @@ +[nodejs] +baseurl = https://rpm.nodesource.com/pub_{{ nodejs_major_version }}.x/el/{{ ansible_distribution_major_version }}/$basearch +gpgcheck = 1 +gpgkey = https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL +name = Node.js Packages for Enterprise Linux +{% if ansible_os_family == 'RedHat' and ansible_distribution_major_version is version('8', '>=') %} +# Workaround a bug in dnf which would make the default module mask +module_hotfixes = true +{% endif %} + +