拥有 Vagrantfile:
...
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise64"
config.vm.box_url = "https://atlas.hashicorp.com/hashicorp/boxes/precise64"
config.vm.hostname = vm_hostname
config.vm.boot_timeout = 720
...
尝试使用 *.yml 安装 nginx:
- name: Install Nginx
become: yes
apt: pkg=nginx state=latest
在有 VM 的结果中,输入“nginx -v”给出了“1.1.19”,这是非常过时的(ppa:ngins/stable 截至日期有 1.12 作为稳定版)
请帮助安装最新版本的 nginx )
最佳答案
您使用的是一个非常旧的盒子(我什至会说已弃用,因为 hashicorp 已将这些盒子重建为 ubuntu/precise64 - 您使用的盒子已经 3 年没有更新了(检查 https://atlas.hashicorp.com/hashicorp/boxes/precise64 ))
所以你可以试试
config.vm.box = "ubuntu/precise64"
但是请注意 ubuntu 12.04 作为 ubuntu 版本已经很老了,你应该看看使用更新的版本,你可以使用
- ubuntu/trusty64 : 它是 ubuntu 14.04
- ubuntu/xenial64:它的 ubuntu 16.04(这个盒子过去有一些问题,不确定是否一切都已修复)
关于linux - vagrant/ansible nginx 版本错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44083278/