2oppin 2oppin -4 years ago 122
Linux Question

vagrant/ansible wrong version of nginx

Having 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
...


Trying to insall nginx with *.yml:

- name: Install Nginx
become: yes
apt: pkg=nginx state=latest


In a result having VM, typing "nginx -v" gives "1.1.19" which is extremely outdated (ppa:ngins/stable as of date have 1.12 as a stable)

Please help to install latest version of nginx )

Answer Source

You're using a pretty old box (I would even say deprecated as hashicorp has rebuilt the boxes as [ubuntu/precise64](https://atlas.hashicorp.com/ubuntu/boxes/precise64 - the box you're using has not been updated for 3 years (check https://atlas.hashicorp.com/hashicorp/boxes/precise64))

so you can try with

config.vm.box = "ubuntu/precise64"

but note ubuntu 12.04 is quite old as ubuntu release, you should look to use a more recent version, you can use

  • ubuntu/trusty64 : its ubuntu 14.04
  • ubuntu/xenial64 : its ubuntu 16.04 (this box had some issues in the past, not sure everything was fixed)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download