Ich verstehe nicht, warum ansible ist eine alte Version von NodeJS Installation, obwohl ich es eingestellt neueste zu installieren:ansible: Kraft Installation neueste NodeJS Paket
- name: NodeJS => Install NodeJS
apt:
pkg: "{{ item }}"
state: latest
force: yes
update_cache: yes
with_items:
- nodejs
- npm
become: yes
- name: NodeJS => Create link symlink for node
become: yes
file:
src: /usr/bin/nodejs
dest: /usr/bin/node
state: link
Für die aktuellen Versionen Ich habe jetzt:
$ node -v
v0.10.25
$ npm -v
1.3.10
aktualisiert Lösung
ich tat dies schließlich in meiner Aufgabe/main.yml
---
- name: Ensure apt-transport-https is installed.
apt: name=apt-transport-https state=present
- name: Add Nodesource apt key.
become: yes
apt_key:
url: https://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search=0x1655A0AB68576280
id: "68576280"
state: present
- name: Add NodeSource repositories for Node.js.
become: yes
apt_repository:
repo: "{{ item }}"
state: present
with_items:
- "deb https://deb.nodesource.com/node_{{ params['nodejs'].version }} {{ ansible_distribution_release }} main"
# - "deb-src https://deb.nodesource.com/node_{{ params['nodejs'].version }} {{ ansible_distribution_release }} main"
register: node_repo
- name: Update apt cache if repo was added.
become: yes
apt: update_cache=yes
when: node_repo.changed
- name: Ensure Node.js and npm are installed.
become: yes
apt: "name=nodejs={{ params['nodejs'].version|regex_replace('x', '') }}* state=present"
ansible wird das Neueste aus dem Repo nehmen, was ist Ihre Vagrant Box? –
config.vm.box = "ubuntu/trusty64" – numediaweb