~/.ssh/id_rsa.pub not found error while installing capistrano as ansible playbook

匿名 (未验证) 提交于 2019-12-03 01:48:02

问题:

I try to install https://github.com/roots/bedrock-ansible to get a bedrock deployment (http://roots.io/wordpress-stack/) running.

When I run "vagrant up", after some time I get the error:

TASK: [capistrano-setup | Setup deploy group] *********************************  skipping: [default]  TASK: [capistrano-setup | Setup deploy user] **********************************  skipping: [default]  TASK: [capistrano-setup | Adding public key to server] ************************  fatal: [default] => could not locate file in lookup: ~/.ssh/id_rsa.pub  FATAL: all hosts have already failed -- aborting  PLAY RECAP ********************************************************************             to retry, use: --limit @/Users/johannes/site.retry  default                    : ok=46   changed=16   unreachable=1    failed=0     Ansible failed to complete successfully. Any error output should be visible above. Please fix these errors and try again. 

I do not have a clou how i can fix this. Do you have an idea?

回答1:

It seems the role is trying to find your local public key. It should be in the location in the error message '~/.ssh/id_rsa.pub', but it's not. So either you don't have one, or you keep it in another location.

If you're not familiar with generating SSH keys you probably don't have one. I personally like the GitHub help page for this: https://help.github.com/articles/generating-ssh-keys/ (you only have to perform steps 1 and 2).

If you do have SSH keys, but in a different location, the capistrano-install role in bedrock uses some variables:

deploy_user: deploy deploy_keys:   - "~/.ssh/id_rsa.pub" 

So you can set (multiple) public key files in the deploy_keys list and they will be added to the deploy_user's authorized keys.

All this is needed because Capistrano will use the deploy user to connect to the remote server later. http://blakesmith.me/2010/02/08/understanding-public-key-private-key-concepts.html



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!