1

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'
Ilyas Patel
  • 400
  • 2
  • 11
  • 27
  • This particular problem doesn't seem to have anything to do with ansible so you may want to remove the ansible tag. – Rob H Jan 01 '18 at 22:36
  • 1
    Any particular reason you are using an ubuntu image? Why not use an image that offers you a recent version of Ruby explicitly? – Hubert Grzeskowiak Jan 01 '18 at 23:47
  • @HubertGrzeskowiak Thanks, I've changed - name: ubuntu/xenial64 under platforms and this seems to have worked. I'll do some further research before putting an answer here as I don't really know what xenial64 is. – Ilyas Patel Jan 02 '18 at 10:35
  • 1
    Trusty and xenial are aliases for certain Ubuntu versions. You can either use a newer Ubuntu version or an image specially for ruby, as you probably don't care about which Linux distribution is used anyways. – Hubert Grzeskowiak Jan 02 '18 at 10:44
  • 1
    https://app.vagrantup.com/boxes/search?utf8=%E2%9C%93&sort=downloads&provider=&q=ruby here take any small one that offers what you need – Hubert Grzeskowiak Jan 02 '18 at 10:47

1 Answers1

0

Thanks to Hubert above, I changed

this

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

to

platforms:
  - name: ubuntu/xenial64
Ilyas Patel
  • 400
  • 2
  • 11
  • 27