linux - vagrant/ansible nginx 版本错误

标签 linux nginx vagrant

拥有 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/

相关文章:

angular - 带有用于 https 域的 NGINX proxy_pass 的 Webpack Dev Server 原因:net::ERR_CONNECTION_CLOSED

chef-infra - Vagrant 和 Knife Solo(或任何其他非 Vagrant Chef Env)的最佳常用工作流程?

bash - 是否可以通过 shell 脚本向 vagrant ssh 发送多个命令?

nginx - 运行 service start/stop/restart nginx 命令时调用 openresty 的 nginx.conf 文件

linux - 命令终止时 GNU screen 关闭窗口

php - 显示 tmp 目录中的图像

linux - Linux如何提取syscall的第六个参数?

nginx - X-Frame-Options header 不是公认的指令

vagrant - 如何设置vagrant环境变量VAGRANT_DEFAULT_PROVIDER?

python - 我无法在 Windows 10 的 cmd 中或在 kali linux 的终端中运行 .py 文件