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
|
dest: /etc/apt/preferences.d/00-nodesource.pref
|
||||||
become: yes
|
become: yes
|
||||||
|
|
||||||
- name: Add nodesource repository key
|
- name: Add all repositories
|
||||||
apt_key:
|
include_role:
|
||||||
url: "https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
|
name: ensure-package-repositories
|
||||||
become: yes
|
vars:
|
||||||
|
repositories_keys:
|
||||||
- name: Add nodesource apt source repository
|
- url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
|
||||||
apt_repository:
|
repositories_list:
|
||||||
repo: "deb-src https://deb.nodesource.com/node_{{ node_version }}.x {{ ansible_distribution_release }} main"
|
- repo: deb-src https://deb.nodesource.com/node_{{ node_version }}.x {{ ansible_distribution_release }} main
|
||||||
state: present
|
- repo: deb https://deb.nodesource.com/node_{{ node_version }}.x {{ ansible_distribution_release }} main
|
||||||
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
|
|
||||||
|
|
||||||
# Use template so that we can easily update this in the future to be able to
|
# Use template so that we can easily update this in the future to be able to
|
||||||
# use a mirror location.
|
# use a mirror location.
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
description: Test the ensure-nodejs role
|
description: Test the ensure-nodejs role
|
||||||
files:
|
files:
|
||||||
- roles/ensure-nodejs/.*
|
- roles/ensure-nodejs/.*
|
||||||
|
- roles/ensure-package-repositories/.*
|
||||||
run: test-playbooks/simple-role-test.yaml
|
run: test-playbooks/simple-role-test.yaml
|
||||||
vars:
|
vars:
|
||||||
role_name: ensure-nodejs
|
role_name: ensure-nodejs
|
||||||
|
Loading…
Reference in New Issue
Block a user