{"action":"created","issue":{"url":"https://api.github.com/repos/enovance/config-tools/issues/16","labels_url":"https://api.github.com/repos/enovance/config-tools/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/enovance/config-tools/issues/16/comments","events_url":"https://api.github.com/repos/enovance/config-tools/issues/16/events","html_url":"https://github.com/enovance/config-tools/issues/16","id":45861719,"number":16,"title":"Remote rspec if jenkins ssh key if not present also on root.","user":{"login":"gaelL","id":2479183,"avatar_url":"https://avatars.githubusercontent.com/u/2479183?v=3","gravatar_id":"","url":"https://api.github.com/users/gaelL","html_url":"https://github.com/gaelL","followers_url":"https://api.github.com/users/gaelL/followers","following_url":"https://api.github.com/users/gaelL/following{/other_user}","gists_url":"https://api.github.com/users/gaelL/gists{/gist_id}","starred_url":"https://api.github.com/users/gaelL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaelL/subscriptions","organizations_url":"https://api.github.com/users/gaelL/orgs","repos_url":"https://api.github.com/users/gaelL/repos","events_url":"https://api.github.com/users/gaelL/events{/privacy}","received_events_url":"https://api.github.com/users/gaelL/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/enovance/config-tools/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-10-15T12:46:18Z","updated_at":"2015-01-20T13:44:00Z","closed_at":null,"body":"When i launch the puppet job with jenkins (configure.sh), it seems to have mainly 2 remote action on each nodes : \r\n\r\n  * ssh -> launch puppet agent\r\n  * launch remote serverspec\r\n\r\nMy jenkins ssh key is different from root ssh key (on the install-server). The first step ssh works fine (note : the ssh key is forced with a `-i`) :\r\n\r\n\r\n```\r\n+ ssh -oBatchMode=yes -oCheckHostIP=no -oHashKnownHosts=no -oStrictHostKeyChecking=no -oPreferredAuthentications=publickey -oChallengeResponseAuthentication=no -oKbdInteractiveDevices=no -oConnectTimeout=3 -oUserKnownHostsFile=/dev/null -i /var/lib/jenkins/.ssh/id_rsa jenkins@node1 sudo -i puppet agent --onetime --verbose --no-daemonize --no-usecacheonfailure --no-splay --show_diff\r\n+ tee /var/lib/jenkins/jobs/puppet/workspace/node1.step1.try2.log\r\nWarning: Permanently added 'node1' (ECDSA) to the list of known hosts.\r\nstdin: is not a tty\r\nInfo: Retrieving pluginfacts\r\nInfo: Retrieving plugin\r\nInfo: Loading facts\r\nInfo: Caching catalog for node1\r\nInfo: Applying configuration version '1413367490'\r\nNotice: /Stage[main]/Ceph::Conf/Concat::Fragment[ceph-mon-8e0a133f.conf]/File[/var/lib/puppet/concat/_etc_ceph_ceph.conf/fragments/50_ceph-mon-8e0a133f.conf]/ensure: created\r\n.....\r\n```\r\n\r\nThe second step (serverspec) fail :\r\n```\r\nnode1:\r\n/usr/bin/ruby -S rspec spec/base/base_spec.rb spec/cache/cache_spec.rb spec/database/database_spec.rb spec/logging_agent/logging_agent_spec.rb spec/messaging/messaging_spec.rb spec/storage_controller/storage_controller_spec.rb -t ~host:node1\r\n/usr/local/share/gems/gems/net-ssh-2.9.1/lib/net/ssh.rb:219:in `start': Authentication failed for user jenkins@node1 (Net::SSH::AuthenticationFailed)\r\n\tfrom /etc/serverspec/spec/spec_helper.rb:17:in `block in <top (required)>'\r\n\tfrom /usr/local/share/gems/gems/rspec-core-2.14.8/lib/rspec/core.rb:120:in `configure'\r\n\tfrom /etc/serverspec/spec/spec_helper.rb:12:in `<top (required)>'\r\n\tfrom /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:53:in `require'\r\n\tfrom /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:53:in `require'\r\n\tfrom /etc/serverspec/spec/tests/base/base_spec.rb:1:in `<top (required)>'\r\n\tfrom /etc/serverspec/spec/base/base_spec.rb:1:in `require_relative'\r\n\tfrom /etc/serverspec/spec/base/base_spec.rb:1:in `<top (required)>'\r\n\tfrom /usr/local/share/gems/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `load'\r\n\tfrom /usr/local/share/gems/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'\r\n\tfrom /usr/local/share/gems/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `each'\r\n\tfrom /usr/local/share/gems/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `load_spec_files'\r\n\tfrom /usr/local/share/gems/gems/rspec-core-2.14.8/lib/rspec/core/command_line.rb:22:in `run'\r\n\tfrom /usr/local/share/gems/gems/rspec-core-2.14.8/lib/rspec/core/runner.rb:80:in `run'\r\n\tfrom /usr/local/share/gems/gems/rspec-core-2.14.8/lib/rspec/core/runner.rb:17:in `block in autorun'\r\n/usr/bin/ruby -S rspec spec/base/base_spec.rb spec/cache/cache_spec.rb spec/database/database_spec.rb spec/logging_agent/logging_agent_spec.rb spec/messaging/messaging_spec.rb spec/storage_controller/storage_controller_spec.rb -t ~host:node1 failed\r\n```\r\n\r\nI was looking on the CI (test4) and found that : \r\n```\r\nmd5sum /root/.ssh/id_rsa /var/lib/jenkins/.ssh/id_rsa\r\nb480ab2541273544a96098ee9d3d3509  /root/.ssh/id_rsa\r\nb480ab2541273544a96098ee9d3d3509  /var/lib/jenkins/.ssh/id_rsa\r\n```\r\n\r\nSo i tried to copy my jenkins key in root user :\r\n```cp /var/lib/jenkins/.ssh/id_rsa /root/.ssh/```\r\n\r\nAnd it's work for me."},"comment":{"url":"https://api.github.com/repos/enovance/config-tools/issues/comments/70654647","html_url":"https://github.com/enovance/config-tools/issues/16#issuecomment-70654647","issue_url":"https://api.github.com/repos/enovance/config-tools/issues/16","id":70654647,"user":{"login":"nhicher","id":5470230,"avatar_url":"https://avatars.githubusercontent.com/u/5470230?v=3","gravatar_id":"","url":"https://api.github.com/users/nhicher","html_url":"https://github.com/nhicher","followers_url":"https://api.github.com/users/nhicher/followers","following_url":"https://api.github.com/users/nhicher/following{/other_user}","gists_url":"https://api.github.com/users/nhicher/gists{/gist_id}","starred_url":"https://api.github.com/users/nhicher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhicher/subscriptions","organizations_url":"https://api.github.com/users/nhicher/orgs","repos_url":"https://api.github.com/users/nhicher/repos","events_url":"https://api.github.com/users/nhicher/events{/privacy}","received_events_url":"https://api.github.com/users/nhicher/received_events","type":"User","site_admin":false},"created_at":"2015-01-20T13:43:59Z","updated_at":"2015-01-20T13:43:59Z","body":"Hello,\n\nI think is not really an issue. You just need to use the same key for \nroot and jenkins user. You can use cloud-init to add the key on your \nservers.\n\nNico\n\nOn 01/20/2015 05:16 AM, Guits wrote:\n> i'm currently deploying with spinalstack I.1.3.0 release, i'm having the same issue, is there any update ?\n>\n> ---\n> Reply to this email directly or view it on GitHub:\n> https://github.com/enovance/config-tools/issues/16#issuecomment-70632031\n>"}}