0
如果我有Vagrantfile與ansible規定:流浪漢與ansible錯誤
Vagrant.configure(2) do |config|
config.vm.box = 'hashicorp/precise32'
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.provision :ansible do |ansible|
ansible.playbook = "playbook.yml"
ansible.inventory_path = "hosts"
ansible.limit = 'all'
ansible.sudo = true
end
end
我的hosts文件很簡單:
[local]
web ansible_connection=local
和playbook.yml是:
---
- hosts: local
sudo: true
remote_user: vagrant
tasks:
- name: update apt cache
apt: update_cache=yes
- name: install apache
apt: name=apache2 state=present
當我開始與流浪漢流浪起來我有錯誤:
failed: [web] => {"failed": true, "parsed": false}
[sudo via ansible, key=daxgehmwoinwalgbzunaiovnrpajwbmj] password:
什麼問題?
嗯看起來像它是要求sudo密碼..你有沒有在你的XML文件配置? – ryekayo
向sudoers添加'vagrnt' – Kashyap
什麼是sudoers? –