From 5aa6eca32f5f166b419a17489b38e5a8c55b27ef Mon Sep 17 00:00:00 2001 From: Ian Carrico Date: Wed, 20 Aug 2014 18:21:52 -0500 Subject: [PATCH 1/5] Add NPM to tasks that can be ran --- defaults/main.yml | 3 +++ tasks/main.yml | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 9643b90..6c55732 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,2 +1,5 @@ --- # defaults file for nodejs + +npm_packages: + - not_really_a_package diff --git a/tasks/main.yml b/tasks/main.yml index be037d3..f3c4210 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -19,3 +19,8 @@ - name: Install NodeJS apt: pkg=nodejs state=installed update_cache=yes + +- name: Install npm packages + npm: name={{ item }} global=yes state=present + with_items: npm_packages + when: item != 'not_really_a_package' From eb89769337cc8edfe6a9609da181484938c47df4 Mon Sep 17 00:00:00 2001 From: Ian Carrico Date: Wed, 20 Aug 2014 18:22:22 -0500 Subject: [PATCH 2/5] Move around spacing so that the meta/main.yml is read properly --- meta/main.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index abc7e18..6824604 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -7,13 +7,13 @@ galaxy_info: min_ansible_version: 1.2 platforms: - - name: Ubuntu - versions: - - precise - - trusty + - name: Ubuntu + versions: + - precise + - trusty categories: - - development - - networking - - packaging - - web -dependencies: [] + - development + - networking + - packaging + - web +dependencies: [] From bec021d0fea1992e5d33f307be6fbc6f94948641 Mon Sep 17 00:00:00 2001 From: Ian Carrico Date: Wed, 20 Aug 2014 18:23:06 -0500 Subject: [PATCH 3/5] Add in directions to install npm packages to the readme --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c05b1a8..c48a39c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This is an ansible role which installs configures the nodesource apt repository Currently this role supports the following operating systems and releases. -* Ubuntu +* Ubuntu * precise * trusty @@ -26,6 +26,16 @@ Then configure it as follows: - nodesource.nodejs ``` +## NPM Packages + +Add in packages to the npm_packages variable to install npm packages. + +```yaml +npm_packages: + - bower + - coffee-script +``` + ## Testing To test this role using docker. @@ -40,4 +50,4 @@ MIT # Author Information -Mark Wolfe \ No newline at end of file +Mark Wolfe From 8187f594c9246b7e8e0874e98a14ebd3a8efd94c Mon Sep 17 00:00:00 2001 From: Ian Carrico Date: Sun, 24 Aug 2014 19:00:02 -0500 Subject: [PATCH 4/5] Use an empty array for node modules --- defaults/main.yml | 2 +- tasks/main.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 6c55732..af62840 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,5 @@ --- # defaults file for nodejs -npm_packages: +npm_packages: [] - not_really_a_package diff --git a/tasks/main.yml b/tasks/main.yml index f3c4210..33bef3c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -23,4 +23,3 @@ - name: Install npm packages npm: name={{ item }} global=yes state=present with_items: npm_packages - when: item != 'not_really_a_package' From e73c8da274df0cfbc532ee8f77c0c1e8ed0ea14b Mon Sep 17 00:00:00 2001 From: Ian Carrico Date: Thu, 4 Sep 2014 15:38:33 -0500 Subject: [PATCH 5/5] Minor bug in the yaml --- defaults/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index af62840..5aefeb5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,4 +2,3 @@ # defaults file for nodejs npm_packages: [] - - not_really_a_package