Search code examples
vagranttest-kitchen

Vagrant ubuntu/trusty64 contains old version of Ruby which causes test-kitchen to fail


I'm trying to learn Ansible with Vagrant (Ubuntu/trusty64) and I'm trying to use test-kitchen to assert my setup.

The problem I am having is the Vagrant machine has an old version of Ruby (1.9.1) and therefore one of the dependencies (busser) fails to run. The error I am receiving is:

-----> Installing Busser (busser)
Fetching: thor-0.19.0.gem (100%)
Fetching: busser-0.7.1.gem (100%)
       Successfully installed thor-0.19.0
       Successfully installed busser-0.7.1
       2 gems installed

-----> Installing Busser plugin: busser-serverspec
   /usr/lib/ruby/1.9.1/rubygems/installer.rb:390:in 
'ensure_required_ruby_version_met': rake requires Ruby version >= 2.0.0. 
(Gem::InstallError)

When I run the command 'bundle exec kitchen test' vagrant is downloading the basebox from https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/20171208.0.0/providers/virtualbox.box


This is my Gemfile followed by my kitchenfile.yml file.

source 'https://rubygems.org'
gem 'test-kitchen', '~> 1.19.2'
gem 'kitchen-ansible', '~> 0.48.1'
gem 'kitchen-vagrant', '~> 1.2.1'
gem 'serverspec', '~> 2.41.3'

driver:
  name: vagrant

provisioner:
  name: ansible_playbook
  playbook: playbook.yml
  hosts: all
  require_chef_for_busser: false
  require_ruby_for_busser: true

platforms:
  - name: ubuntu
    driver_config:
      box: "ubuntu/trusty64"

suites:
  - name: default

verifier:
  ruby_bindir: '/usr/bin'

Solution

  • Thanks to Hubert above, I changed

    this

    platforms:
      - name: ubuntu
        driver_config:
          box: "ubuntu/trusty64"
    

    to

    platforms:
      - name: ubuntu/xenial64