4. Roles
Last updated
- name: Node.Js - Get script
get_url:
url: "http://deb.nodesource.com/setup_6.x"
dest: "{{ var_node }}/nodejs.sh"
- name: Node.Js - Set exec perm to script
file:
path: "{{ var_node }}/nodejs.sh"
mode: "u+x"
- name: Node.Js - Exec install script
shell: "http://deb.nodesource.com/setup_6.x"
- name: Node.Js - Remove install script
file:
path: "{{ var_node }}/nodejs.sh"
state: absent
- name: Node.Js - Install Node.js
apt: name={{ item }} state=present update_cache=yes
with_items:
- build-essential
- nodejs
- name: Install NPM
apt:
name: npm
state: present
- name: Node.js | Install bower and gulp globally
npm: name={{ item }} state=present global=yes
with_items:
- bower
- gulp- hosts: all
become: true
vars:
# needed for node installation
ansible_become_pass: aziz
var_node: /tmp
roles:
- nodejs