ensure-nodejs: refactor to use ensure-package-repositories
This patch refactors ensure-nodejs to use the new generic role to allow it to be cross-platform in the future. Change-Id: I859b6b3e33bc22ad4f99828e921ac2ed35a49252
This commit is contained in:
parent
e4345c217e
commit
7ea6d11981
@ -15,23 +15,15 @@
|
||||
dest: /etc/apt/preferences.d/00-nodesource.pref
|
||||
become: yes
|
||||
|
||||
- name: Add nodesource repository key
|
||||
apt_key:
|
||||
url: "https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
|
||||
become: yes
|
||||
|
||||
- name: Add nodesource apt source repository
|
||||
apt_repository:
|
||||
repo: "deb-src https://deb.nodesource.com/node_{{ node_version }}.x {{ ansible_distribution_release }} main"
|
||||
state: present
|
||||
become: yes
|
||||
|
||||
- name: Add nodesource apt repository
|
||||
apt_repository:
|
||||
repo: "deb https://deb.nodesource.com/node_{{ node_version }}.x {{ ansible_distribution_release }} main"
|
||||
state: present
|
||||
update_cache: yes
|
||||
become: yes
|
||||
- name: Add all repositories
|
||||
include_role:
|
||||
name: ensure-package-repositories
|
||||
vars:
|
||||
repositories_keys:
|
||||
- url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
|
||||
repositories_list:
|
||||
- repo: deb-src https://deb.nodesource.com/node_{{ node_version }}.x {{ ansible_distribution_release }} main
|
||||
- repo: deb https://deb.nodesource.com/node_{{ node_version }}.x {{ ansible_distribution_release }} main
|
||||
|
||||
# Use template so that we can easily update this in the future to be able to
|
||||
# use a mirror location.
|
||||
|
@ -3,6 +3,7 @@
|
||||
description: Test the ensure-nodejs role
|
||||
files:
|
||||
- roles/ensure-nodejs/.*
|
||||
- roles/ensure-package-repositories/.*
|
||||
run: test-playbooks/simple-role-test.yaml
|
||||
vars:
|
||||
role_name: ensure-nodejs
|
||||
|
Loading…
Reference in New Issue
Block a user