Vagrant 中的语法错误
Syntax error in Vagrant
我的 Vagrantfile 中有这段代码,可以使用 Ansible 来配置我的虚拟机:
Vagrant.configure("2") do |config|
config.vm.box = "geerlingguy/centos7"
config.vm.provision "ansible" do |ansible|
ansible.playbook = "playbook.yml"
end
但现在我得到这个错误:
> There is a syntax error in the following Vagrantfile. The syntax error
> message is reproduced below for convenience:
>
> /Users/vagrant/Vagrantfile:5: syntax error, unexpected
> end-of-input, expecting keyword_end
有人可以帮我弄清楚为什么会出现此错误吗?
谢谢!
您的 "config.vm.provision "ansible“do |ansible|”似乎缺少 "end" 关键字做声明。我认为以下更改应该有效。
Vagrant.configure("2") do |config|
config.vm.box = "geerlingguy/centos7"
config.vm.provision "ansible" do |ansible|
ansible.playbook = "playbook.yml"
end
end