ansible-roles/nodejs/tasks/main.yml

66 lines
1.2 KiB
YAML
Raw Normal View History

---
- name: APT https transport is enabled
apt:
name: apt-transport-https
state: present
tags:
- system
- packages
- nodejs
- name: Look for legacy apt keyring
stat:
path: /etc/apt/trusted.gpg
register: _trusted_gpg_keyring
tags:
- system
- packages
- nodejs
2021-05-06 11:33:19 +02:00
- name: NodeJS embedded GPG key is absent
apt_key:
id: "68576280"
keyring: /etc/apt/trusted.gpg
state: absent
when: _trusted_gpg_keyring.stat.exists
tags:
- system
- packages
- nodejs
- name: NodeJS GPG key is installed
copy:
src: nodesource.asc
dest: /etc/apt/trusted.gpg.d/nodesource.asc
2021-05-26 13:47:34 +02:00
mode: "0644"
owner: root
group: root
tags:
- system
- packages
- nodejs
2018-04-06 09:19:36 +02:00
- name: NodeJS sources list ({{ nodejs_apt_version }}) is available
apt_repository:
2017-03-17 09:55:39 +01:00
repo: "deb https://deb.nodesource.com/{{ nodejs_apt_version }} {{ ansible_distribution_release }} main"
filename: nodesource
update_cache: yes
state: present
tags:
- system
- packages
- nodejs
2018-04-06 09:19:36 +02:00
- name: NodeJS is installed
apt:
name: nodejs
state: present
update_cache: yes
tags:
- packages
- nodejs
2018-04-06 09:19:36 +02:00
- include: yarn.yml
when: nodejs_install_yarn | bool