Closed avidsapp closed 5 years ago
Yes, but this has nothing to do with containerized-wordpress-project
but with your SSH config, add StrictHostKeyChecking no
to be part of your ~/.ssh/config
file to get rid of this error.
Ok. I did that and I'm certain I have the right .pem and permissions. I'm now getting this error:
fatal: [domain.name]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ubuntu@domain.name: Permission denied (publickey).\r\n", "unreachable": true}
Ok, I'm sorry but this has nothing to do with containerized-wordpress-project
as it solely concerns your SSH config and local setup.
I'd advise you to read one of these:
In my initial issue message, I mentioned I was able to ssh in just fine so that wasn't the issue. I use a unique ssh config set up. In order to get your automagic ansible solution running, the key dir path must be defined in the hosts file:
[aws-wp] domain.name ansible_ssh_private_key_file=path/to/privatekey
Also, the playbook is failing when rebooting the server, but works upon a second pass. The error:
TASK [AdnanHodzic.system-upgrade : Wait for server to come back up after reboot] **************************************************************** fatal: [domain.name -> localhost]: FAILED! => {"changed": false, "module_stderr": "sudo: a password is required\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
Okay, thanks for bringing that to my attention, as I have multiple SSH keys and I never had to use ansible_ssh_private_key_file
. However, next time I'm making changes I'll re-evaluate it and if necessary add it to code.
Regarding server reboot after upgrade, I've noticed that this had tendency to fail. I've also added this to my ToDo list when it comes to containerized-wordpress
project and will address it in next version iteration.
Again, thanks and I apologize for the misunderstanding.
No worries. I'm still new to Ansible so I was troubleshooting why it wasn't working for me. My SSH keys aren't located in /Users/.../.ssh/ so that is why ansible_ssh_private_key_file
path is probably necessary for my use case and may not be worth merging into yours
I keep getting the following error:
UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@ WARNING: POSSIBLE DNS SPOOFING DETECTED! @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nThe ECDSA host key for... Add correct host key in /Users/.../.ssh/known_hosts to get rid of this message.
Even after
ssh-keygen -R domainoripaddress
it still spit back this error. I had it working before and I can ssh into the box just fine. Any ideas?