-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from mtpereira/alternatives
Alternatives
- Loading branch information
Showing
6 changed files
with
34 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[defaults] | ||
roles_path = ~/roles/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
- src: ANXS.build-essential | ||
version: master | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,4 @@ | |
force: yes | ||
|
||
- include: update_path.yml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
# file: nodejs/tasks/update_path.yml | ||
|
||
- name: node.js | update_path | Add the node.js binary to the system path | ||
lineinfile: "dest={{item.dest}} regexp={{item.regexp}} line={{item.line}} state={{item.state}}" | ||
with_items: | ||
- { dest: "/etc/profile", regexp: "^NODE_HOME=/usr/local/nodejs/default", line: "NODE_HOME=/usr/local/nodejs/default", state: "present" } | ||
- { dest: "/etc/profile", regexp: "^PATH=.*NODE_HOME.*", line: "PATH=$PATH:$NODE_HOME/bin", state: "present" } | ||
- name: node.js | Add the node installation path to the system path | ||
lineinfile: | ||
dest: /etc/profile | ||
regexp: '^NODE_HOME={{ nodejs_directory }}/default' | ||
line: 'NODE_HOME={{ nodejs_directory }}/default' | ||
state: present | ||
|
||
- name: node.js | update_path | Inform the system where node is located and set this one as the default | ||
shell: "{{item}}" | ||
with_items: | ||
- 'update-alternatives --install "/usr/bin/node" "node" "/usr/local/nodejs/default/bin/node" 1' | ||
- 'update-alternatives --set node /usr/local/nodejs/default/bin/node' | ||
- name: mode.js | Add the node binary path to the system path | ||
lineinfile: | ||
dest: /etc/profile | ||
regexp: '^PATH=.*NODE_HOME.*' | ||
line: 'PATH=$PATH:$NODE_HOME/bin' | ||
state: present | ||
|
||
- name: node.js | update_path | Inform the system where npm is located and set this one as the default | ||
shell: "{{item}}" | ||
- name: node.js | Inform the system where the binaries are located and set as the default | ||
alternatives: | ||
name: "{{ item }}" | ||
path: "{{ nodejs_directory }}/default/bin/{{ item }}" | ||
link: "/usr/bin/{{ item }}" | ||
with_items: | ||
- 'update-alternatives --install "/usr/bin/npm" "npm" "/usr/local/nodejs/default/bin/npm" 1' | ||
- 'update-alternatives --set npm /usr/local/nodejs/default/bin/npm' | ||
- node | ||
- npm | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
- hosts: all | ||
sudo: True | ||
vars_files: | ||
- 'defaults/main.yml' | ||
tasks: | ||
- include: 'tasks/main.yml' | ||
sudo: yes | ||
|
||
roles: | ||
- . | ||
|