Для установки версии узла 6.x эти команды:анзибль установить Node.js версии 6
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
теперь, как именно я могу сделать это в анзибль? любые идеи здесь?
это то, что у меня было до сих пор, но она устанавливает старую версию
---
- name: Ensure Ubuntu Distro is Supported
get_url:
url='https://deb.nodesource.com/node/dists/"{{ ansible_distribution_release }}"/Release'
dest=/dev/null
register: distrosupported
- name: Remove Old Chris Lea PPA
apt_repository:
repo='ppa:chris-lea/node.js'
state=absent
when: distrosupported|success
ignore_errors: yes
- name: Remove Old Chris Lea Sources
sudo: yes
file:
path='/etc/apt/sources.list.d/chris-lea-node_js-"{{ ansible_distribution_release }}".list'
state=absent
when: distrosupported|success
ignore_errors: yes
- name: Add Nodesource Keys
sudo: yes
apt_key:
url=https://deb.nodesource.com/gpgkey/nodesource.gpg.key
state=present
- name: Add Nodesource Apt Sources List Deb
sudo: yes
apt_repository:
repo='deb https://deb.nodesource.com/node "{{ ansible_distribution_release }}" main'
state=present
when: distrosupported|success
- name: Add Nodesource Apt Sources List Deb Src
sudo: yes
apt_repository:
repo='deb-src https://deb.nodesource.com/node "{{ ansible_distribution_release }}" main'
state=present
when: distrosupported|success
- name: Install NodeJS
sudo: yes
apt: pkg=nodejs state=latest update_cache=true
when: distrosupported|success
- debug: msg="{{npm_pkgs}}"
- name: install global npm packages
sudo: yes
npm: name={{item}} global=yes state=latest
with_items: "{{npm_pkgs}}"
добавил свой старый и текущий код –
Так что же случилось с тем, что вы уже пробовали? – ydaetskcoR
шахта устанавливает версию узла 0.1, я хочу версию 6. Я узел docs вы делаете это следующим образом: curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y nodejs –