Skip to content

Instantly share code, notes, and snippets.

@brahimmachkouri
Last active February 19, 2022 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brahimmachkouri/134470619058c60e78e5c1338a0782e1 to your computer and use it in GitHub Desktop.
Save brahimmachkouri/134470619058c60e78e5c1338a0782e1 to your computer and use it in GitHub Desktop.
Ansible playbook to install nodejs 14
---
- name: ilovenode
hosts: dev
become: yes
gather_facts: no
tasks:
- name: Run the equivalent of "apt-get update" as a separate step
apt:
update_cache: yes
- name: Download node installer
get_url:
url=https://deb.nodesource.com/setup_14.x
dest=/tmp/setup_14.x
mode=0440
- name: Install node
command: /bin/bash /tmp/setup_14.x
- name: Install required packages
apt:
name: ['git', 'curl', 'wget', 'nginx', 'nodejs']
state: present
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment