mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
always install packages - skip npm install when already run
This commit is contained in:
parent
f311b4a75f
commit
f3ff239157
1 changed files with 10 additions and 7 deletions
|
@ -28,23 +28,26 @@
|
||||||
when: internet_available and not is_debuntu
|
when: internet_available and not is_debuntu
|
||||||
|
|
||||||
# attempting to reinstall npn is broken on raspbian 9
|
# attempting to reinstall npn is broken on raspbian 9
|
||||||
- name: check for npm already installed
|
- name: check for sugarizer already installed
|
||||||
stat: path={{ sugarizer_location }}/sugarizer/server/node_modules
|
stat: path={{ sugarizer_location }}/sugarizer/server/node_modules
|
||||||
register: npm
|
register: npm
|
||||||
|
|
||||||
- name: set a flag to abort second attempt to install
|
- name: set a flag to abort second attempt to install
|
||||||
set_fact:
|
set_fact:
|
||||||
npm_exists: True
|
npm_exists: True
|
||||||
when: npm.stat.exists is defined and npm.stat.exists
|
when: npm.stat.exists is defined and npm.stat.exists
|
||||||
|
|
||||||
- name: Set up apt sources on is_debuntu
|
- name: Set up apt sources on is_debuntu
|
||||||
shell: curl -sL https://deb.nodesource.com/setup_6.x | bash -
|
shell: curl -sL https://deb.nodesource.com/setup_6.x | bash -
|
||||||
when: internet_available and is_debuntu and not npm_exists
|
when: internet_available and is_debuntu
|
||||||
|
|
||||||
- name: Actually get it installed on is_debuntu
|
- name: Actually get it installed on is_debuntu
|
||||||
package: name=nodejs
|
package: name={{ item }}
|
||||||
state=present
|
state=present
|
||||||
when: internet_available and is_debuntu and not npm_exists
|
with_items:
|
||||||
|
- nodejs
|
||||||
|
- npm
|
||||||
|
when: internet_available and is_debuntu
|
||||||
|
|
||||||
- name: Create systemd files and copy our ini file
|
- name: Create systemd files and copy our ini file
|
||||||
template: src={{ item.src }}
|
template: src={{ item.src }}
|
||||||
|
@ -67,13 +70,13 @@
|
||||||
args:
|
args:
|
||||||
chdir: "{{ sugarizer_location }}/sugarizer/server"
|
chdir: "{{ sugarizer_location }}/sugarizer/server"
|
||||||
creates: "{{ sugarizer_location }}/sugarizer/server/node_modules"
|
creates: "{{ sugarizer_location }}/sugarizer/server/node_modules"
|
||||||
when: not is_F18
|
when: not is_F18 and not npm_exists
|
||||||
|
|
||||||
- name: Create the express framework for node.js - F18
|
- name: Create the express framework for node.js - F18
|
||||||
shell: npm install
|
shell: npm install
|
||||||
args:
|
args:
|
||||||
chdir: "{{ sugarizer_location }}/sugarizer/server"
|
chdir: "{{ sugarizer_location }}/sugarizer/server"
|
||||||
when: is_F18
|
when: is_F18 and not npm_exists
|
||||||
|
|
||||||
- name: enable services - All
|
- name: enable services - All
|
||||||
service: name={{ item.name }}
|
service: name={{ item.name }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue