I want to install package.json using ansible, I'm using the example from the docs, only thing different from this is that I'm using npm not nvm so the tasks look like this
- name: npm install (manual)
npm:
path:"{{ project_path }}"
executable: /usr/bin/npm
{{ project_path }}
is path to package.json
file, basically it's /srv/example.com/
.
The result of this tasks is
TASK [angular : npm install (manual)] ******************************************
task path: /srv/example.com/orchestration/ansible/roles/angular/tasks/main.yml:16
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/packaging/language/npm.py
<default> ESTABLISH LOCAL CONNECTION FOR USER: vagrant
<default> EXEC /bin/sh -c 'echo ~ && sleep 0'
<default> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/vagrant/.ansible/tmp/ansible-tmp-1540437954.12-74081721294328 `" && echo ansible-tmp-1540437954.12-74081721294328="` echo /home/vagrant/.ansible/tmp/ansible-tmp-1540437954.12-74081721294328 `" ) && sleep 0'
<default> PUT /tmp/tmpkx6E4h TO /home/vagrant/.ansible/tmp/ansible-tmp-1540437954.12-74081721294328/npm.py
<default> EXEC /bin/sh -c 'chmod u+x /home/vagrant/.ansible/tmp/ansible-tmp-1540437954.12-74081721294328/ /home/vagrant/.ansible/tmp/ansible-tmp-1540437954.12-74081721294328/npm.py && sleep 0'
<default> EXEC /bin/sh -c 'sudo -H -S -n -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-anopitzukaokwawzhqmxqjfzoxjtozxh; /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1540437954.12-74081721294328/npm.py; rm -rf "/home/vagrant/.ansible/tmp/ansible-tmp-1540437954.12-74081721294328/" > /dev/null 2>&1'"'"' && sleep 0'
ok: [default] => {
"changed": false,
"invocation": {
"module_args": {
"executable": "/usr/bin/npm",
"global": false,
"ignore_scripts": false,
"name": null,
"path": "/srv/example.com/",
"production": false,
"registry": null,
"state": "present",
"version": null
}
}
}
It does not do anything, why? How can I install my package.json
, can someone please help me understand how to overcome this, thanks.