neillturner / kitchen-ansible

Ansible Provisioner for Test Kitchen
Other
350 stars 134 forks source link

kitchen-ansible not working with latest test-kitchen #302

Closed b00ga closed 5 years ago

b00ga commented 5 years ago

Just went to install test-kitchen w/ kitchen-ansible on a new Mac to update an internal test-kitchen repo that uses Ansible. When running kitchen list, I'm getting:

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ClientError
>>>>>> Message: Could not load the 'ansible_playbook' provisioner from the load path. Did you mean: chef_apply, chef_base, chef_solo, chef_zero, dummy, shell ? Please ensure that your provisioner is installed as a gem or included in your Gemfile if using Bundler.
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

This was on macOS Mojave with ruby 2.4 from Macports. gem install was giving me test-kitchen 2.0. Also tried with Macports ruby 2.3.

To sanity check that this wasn't a Mac specific or Macports specific issue, I tested on some Linuxen to confirm. Ubuntu 16.04 (comes with Ruby: ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]), I'm seeing the same issue.

I have some CentOS 7 VMs with newer ruby via the ruby-build project (https://github.com/rbenv/ruby-build). I tried building the latest ruby for 2.2 -> 2.6. You have to run a really old version of test-kitchen to install against 2.2, but that old version with latest kitchen-vagrant/kitchen-ansible works. 2.3 -> 2.6 throw the same error above.

Here are the combinations I tested on CentOS7/ruby-build

ruby 2.2.10p489 (2018-03-28 revision 63023) [x86_64-linux]
Gem is version 2.4.5.5
Test Kitchen version 1.6.0
kitchen-vagrant (1.5.1)
kitchen-ansible (0.49.1)
ruby 2.3.8p459 (2018-10-18 revision 65136) [x86_64-linux]
Gem is version 2.5.2.3
Test Kitchen version 2.0.0
kitchen-vagrant (1.5.1)
kitchen-ansible (0.49.1)
ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-linux]
Gem is version 2.6.14.3
Test Kitchen version 2.0.0
kitchen-vagrant (1.5.1)
kitchen-ansible (0.49.1)
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]
Gem is version 2.7.6.2
Test Kitchen version 2.0.0
kitchen-vagrant (1.5.1)
kitchen-ansible (0.49.1)
ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-linux]
Gem is version 3.0.3
Test Kitchen version 2.0.0
kitchen-vagrant (1.5.1)
kitchen-ansible (0.49.1)
b00ga commented 5 years ago

Apparently installing kitchen-vagrant pulls in the latest (2.0.0) test-kitchen. After either a gem install test-kitchen kitchen-vagrant kitchen-ansible or only a gem install kitchen-vagrant kitchen-ansible, I get two test-kitchens:

$ gem list --local --quiet test-kitchen
test-kitchen (2.0.0, 1.24.0)

I've performed a gem uninstall test-kitchen -v 2.0.0, and my kitchen list commands don't throw errors now. Will test if kitchen-vagrant is still working shortly.

b00ga commented 5 years ago

Did some test runs, and removing test-kitchen 2.0 to fallback on 1.24 is a viable workaround for me so far.

neillturner commented 5 years ago

I will test against test-kitchen 2.0 and check i'm working.

neillturner commented 5 years ago

fixed in version 0.50.0