ansible-roles/nodejs/tasks/main.yml
Jérémy Lecour 7d08b0a30a
All checks were successful
continuous-integration/drone/push Build is passing
rename the tasks for embedded GPG keys
2021-05-06 11:33:19 +02:00

61 lines
1.1 KiB
YAML

---
- name: APT https transport is enabled
apt:
name: apt-transport-https
state: present
tags:
- system
- packages
- nodejs
- name: Look for /etc/apt/trusted.gpg
stat:
path: /etc/apt/trusted.gpg
register: apt_trusted_gpg
tags:
- system
- packages
- nodejs
- name: NodeJS embedded GPG key is absent
apt_key:
id: "68576280"
state: absent
when: apt_trusted_gpg.stat.exists
tags:
- system
- packages
- nodejs
- name: NodeJS GPG key is installed
copy:
src: nodesource.asc
dest: /etc/apt/trusted.gpg.d/nodesource.asc
tags:
- system
- packages
- nodejs
- name: NodeJS sources list ({{ nodejs_apt_version }}) is available
apt_repository:
repo: "deb https://deb.nodesource.com/{{ nodejs_apt_version }} {{ ansible_distribution_release }} main"
filename: nodesource
update_cache: yes
state: present
tags:
- system
- packages
- nodejs
- name: NodeJS is installed
apt:
name: nodejs
state: present
tags:
- packages
- nodejs
- include: yarn.yml
when: nodejs_install_yarn