Closed juju4 closed 8 years ago
The line erroring is inside kitchen-ansible
: Find.find('../../roles')
That sounds like a folder you need to create.
Thanks for the quick up.
This line comes from .kitchen.yml roles_path and was needed for kitchen-vagrant testing. so not same behavior here. If I remove it, got
Transferring files to <default-ubuntu-1404>
D TIMING: scp async upload (Kitchen::Transport::Ssh)
D TIMING: scp async upload (Kitchen::Transport::Ssh) took (0m2.02s)
D Transfer complete
D sudo -E bash -c '[ -d /etc/ansible ] || mkdir /etc/ansible' && sudo -E cp /tmp/kitchen/ansible.cfg /etc/ansible && sudo -E
cp -r /tmp/kitchen/group_va
rs /etc/ansible/. && sudo -E cp -r /tmp/kitchen/host_vars /etc/ansible/.
D [SSH] kitchen@localhost<{:user_known_hosts_file=>"/dev/null", :paranoid=>false, :port=>32772, :compression=>false, :compres
sion_level=>0, :keepalive=>
true, :keepalive_interval=>60, :timeout=>15, :keys_only=>true, :keys=>["/var/lib/jenkins/workspace/test-git-ansible/.kitchen/docke
r_id_rsa"], :auth_methods=>["publickey"], :password=>"kitchen", :user=>"kitchen"}> (sudo -E bash -c '[ -d /etc/ansible ] || mkdir
/etc/ansible' && sudo -E cp /tmp/kitchen/ansible.cfg /etc/ansible && sudo -E cp -r /tmp/kitchen/group_vars /etc/ansible/. && sudo
-E cp -r /tmp/kitchen/host_vars /etc/ansible/.)
D Setting roles_path inside VM to /tmp/kitchen/roles
D Setting roles_path inside VM to /tmp/kitchen/roles
D
D Going to invoke ansible-playbook with: ANSIBLE_ROLES_PATH=/tmp/kitchen/roles sudo -E -s ansible-playbook -i /tmp/kitchen/h
osts -c ssh -M /tmp/kitchen/modules /tmp/kitchen/default.yml
D [SSH] kitchen@localhost<{:user_known_hosts_file=>"/dev/null", :paranoid=>false, :port=>32772, :compression=>false, :compres
sion_level=>0, :keepalive=>true, :keepalive_interval=>60, :timeout=>15, :keys_only=>true, :keys=>["/var/lib/jenkins/workspace/test
-git-ansible/.kitchen/docker_id_rsa"], :auth_methods=>["publickey"], :password=>"kitchen", :user=>"kitchen"}> (ANSIBLE_ROLES_PATH=
/tmp/kitchen/roles sudo -E -s ansible-playbook -i /tmp/kitchen/hosts -c ssh -M /tmp/kitchen/modules /tmp/kitchen/default
.yml)
ERROR! the role 'adduser' was not found in /tmp/kitchen/roles:/tmp/kitchen:/tmp/kitchen/roles
The error appears to have been in '/tmp/kitchen/default.yml': line 6, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
roles:
- adduser
^ here
D Cleaning up local sandbox in /tmp/default-ubuntu-1404-sandbox-20160726-23323-zjikhm
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>> Converge failed on instance <default-ubuntu-1404>. Please see .kitchen/logs/default-ubuntu-1404.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
I can find /tmp/kitchen/roles on host. If I log into docker container with ssh, I find /tmp/kitchen/roles but role name as jenkins job name (which is mapped to /var/lib/jenkins/workspace/job_name) and not real role name
If I remove roles_path and use correct ansible role name as jenkins job name, it fails when doing scp
$ GEM_HOME=/home/vagrant/.gem/ruby/2.0.0 PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/vagrant/.gem/ruby/2.0
.0/bin kitchen test -l debug default-ubuntu-1404
[...]
Preparing to unpack .../chef_12.12.15-1_amd64.deb ...
Unpacking chef (12.12.15-1) ...
Setting up chef (12.12.15-1) ...
Thank you for installing Chef!
D sudo -E rm -rf /tmp/kitchen/modules /tmp/kitchen/roles /tmp/kitchen/group_vars /tmp/kitchen/host_vars; mkdir -p /tmp/kitche
n
D [SSH] kitchen@localhost<{:user_known_hosts_file=>"/dev/null", :paranoid=>false, :port=>32774, :compression=>false, :compres
sion_level=>0, :keepalive=>true, :keepalive_interval=>60, :timeout=>15, :keys_only=>true, :keys=>["/var/lib/jenkins/workspace/addu
ser/.kitchen/docker_id_rsa"], :auth_methods=>["publickey"], :password=>"kitchen", :user=>"kitchen"}> (sudo -E rm -rf /tmp/kitchen/
modules /tmp/kitchen/roles /tmp/kitchen/group_vars /tmp/kitchen/host_vars; mkdir -p /tmp/kitchen)
Transferring files to <default-ubuntu-1404>
D TIMING: scp async upload (Kitchen::Transport::Ssh)
D Cleaning up local sandbox in /tmp/default-ubuntu-1404-sandbox-20160726-2424-lbbjyx
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>> Converge failed on instance <default-ubuntu-1404>. Please see .kitchen/logs/default-ubuntu-1404.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
D ------Exception-------
D Class: Kitchen::ActionFailed
D Message: 1 actions failed.
>>>>>> Converge failed on instance <default-ubuntu-1404>. Please see .kitchen/logs/default-ubuntu-1404.log for more details
D ----------------------
D ------Backtrace-------
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/command.rb:187:in `report_errors'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/command.rb:178:in `run_action'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/command/test.rb:45:in `block in call'
D /usr/lib/ruby/2.0.0/benchmark.rb:281:in `measure'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/command/test.rb:41:in `call'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/cli.rb:56:in `perform'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/cli.rb:231:in `test'
D /home/vagrant/.gem/ruby/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
D /home/vagrant/.gem/ruby/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/cli.rb:325:in `invoke_task'
D /home/vagrant/.gem/ruby/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
D /home/vagrant/.gem/ruby/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/bin/kitchen:13:in `block in <top (required)>'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/errors.rb:174:in `with_friendly_errors'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/bin/kitchen:13:in `<top (required)>'
D /home/vagrant/.gem/ruby/2.0.0/bin/kitchen:23:in `load'
D /home/vagrant/.gem/ruby/2.0.0/bin/kitchen:23:in `<main>'
D ----End Backtrace-----
D -Composite Exception--
D Class: Kitchen::InstanceFailure
D Message: Converge failed on instance <default-ubuntu-1404>. Please see .kitchen/logs/default-ubuntu-1404.log for more deta
ils
D ----------------------
D ------Backtrace-------
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/driver/ssh_base.rb:88:in `rescue in converge'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/driver/ssh_base.rb:91:in `converge'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:565:in `legacy_ssh_base_converge'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:371:in `block in converge_action'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:513:in `call'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:513:in `synchronize_or_call'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:478:in `block in action'
D /usr/lib/ruby/2.0.0/benchmark.rb:281:in `measure'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:477:in `action'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:369:in `converge_action'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:348:in `block in transition_to'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:347:in `each'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:347:in `transition_to'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:160:in `verify'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:189:in `block in test'
D /usr/lib/ruby/2.0.0/benchmark.rb:281:in `measure'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:185:in `test'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/command.rb:201:in `public_send'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/command.rb:201:in `run_action_in_thread'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/command.rb:173:in `block (2 levels) in run_action'
D ----End Backtrace-----
D ---Nested Exception---
D Class: Kitchen::ActionFailed
D Message: SCP upload failed (open failed (1))
D ----------------------
D ------Backtrace-------
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/driver/ssh_base.rb:88:in `rescue in converge'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/driver/ssh_base.rb:91:in `converge'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:565:in `legacy_ssh_base_converge'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:371:in `block in converge_action'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:513:in `call'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:513:in `synchronize_or_call'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:478:in `block in action'
D /usr/lib/ruby/2.0.0/benchmark.rb:281:in `measure'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:477:in `action'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:369:in `converge_action'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:348:in `block in transition_to'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:347:in `each'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:347:in `transition_to'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:160:in `verify'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:189:in `block in test'
D /usr/lib/ruby/2.0.0/benchmark.rb:281:in `measure'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:185:in `test'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/command.rb:201:in `public_send'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/command.rb:201:in `run_action_in_thread'
D /home/vagrant/.gem/ruby/2.0.0/gems/test-kitchen-1.10.2/lib/kitchen/command.rb:173:in `block (2 levels) in run_action'
D ----End Backtrace-----
jenkins@default-ubuntu-1404:~/workspace/adduser$ ssh -p 32774 kitchen@127.0.0.1
The authenticity of host '[127.0.0.1]:32774 ([127.0.0.1]:32774)' can't be established.
ECDSA key fingerprint is e7:1d:dc:24:6a:0e:24:28:57:a6:75:7f:49:ae:35:d4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[127.0.0.1]:32774' (ECDSA) to the list of known hosts.
kitchen@127.0.0.1's password:
Last login: Tue Jul 26 10:14:14 2016 from 172.17.0.1
kitchen@d292033fa99f:~$ ls /tmp/kitchen/
ansible.cfg callback_plugins default.yml group_vars host_vars library lookup_plugins modules spec
I managed to get it work with following changes to my original kitchen config
perl -pi -e "s@name: vagrant@name: docker\n use_sudo: false@;s@roles_path: ../../roles@roles_path: ../@;" .kitchen.yml
I'm not sure if there is consistency rules for kitchen plugin but else a warning in documentation/FAQ might be useful.
Thanks
Hello,
I'm trying to use kitchen-docker for ansible testing instead of kitchen-vagrant(+virtualbox)
Doing the test on ubuntu14.04 VM and ansible role https://github.com/juju4/ansible-adduser just switched to docker
kitchen diagnose all is fine but running test fails with above message. I would suppose kitchen-docker is not ending in same current directory than kitchen-vagrant and that's why ansible is not executing.
not sure if I need to add other instructions or if a bug. Hints to debug?
maybe similar to https://github.com/test-kitchen/test-kitchen/issues/699 https://github.com/test-kitchen/test-kitchen/issues/723
Thanks