-1
我創建了一個Vagrant vm(Ubuntu)並安裝了Ansible。我可以ping我的本地主機,這意味着我的虛擬主機。我寫了一本劇本來安裝nodejs。通過Ansible安裝nodejs playbook
---
- hosts: node #it contains localhost
gather_facts: no
tasks:
- name: install node.js
shell: apt-get install nodejs
sudo: yes
當我運行手冊時,狀態顯示成功。據我的理解,它應該在我的虛擬機中安裝nodejs和npm。但是,如果輸入node -v
,則表明它尚未安裝。
[email protected]:/vagrant_data$ ansible-playbook ping.yml
PLAY [node] *******************************************************************
TASK: [install node.js] *******************************************************
changed: [localhost]
PLAY RECAP ********************************************************************
localhost : ok=1 changed=1 unreachable=0 failed=0
[email protected]:/vagrant_data$ node -v
The program 'node' can be found in the following packages:
* node
* nodejs-legacy
Ask your administrator to install one of them
我在做什麼錯在這裏?