I am very new to ansible. I have managed to install it and set up the ec2.py file via the git and set up the IAM root user. but my question is I already have a ec2 instance online that uses a .pem file that amazon has created. i use windows and have created the relative .ppk file when i try to ssh into that ec2 instance from another ec2 instance I see that via cd ~/.ssh/ the files authorized_keys and known_hosts are created but when i run ssh [email protected].... I get a permission denied (puplickey) I examined the contents of the authorized_keys file and the ppk and pem file and it seems that the public key is stored in the authorized_keys file correctly and the user is correct. Am I correct in thinking that I need to copy the private key into this file?(although I don't really want to) or is it because I need a passphrase? and in relation to ansible How do I utilise this key to manage the host in the same VPC?
Edit (extra): I found out that the authorized_keys file is the file that contains the public key and fingerprint. when i edited the file i was no longer able to access the EC2 instance and it kept asking for a password and saying that the fingerprint had changed. so I guess that's why its best practice to create a ssh-key on the ansible system and then import into AWS