Boa noite! Estou tentando rodar o primeiro playbook dentro da minha VM, porém recebo o erro abaixo:
israel@DESKTOP-0CKJ5KQ:/home$ ansible-playbook -i /mnt/c/ansible_wordpress/ubuntu/configs/ansible/hosts /mnt/c/ansible_w
ordpress/ubuntu/configs/ansible/playbook.yml
PLAY [all] *************************************************************************************************************
TASK [Gathering Facts] *************************************************************************************************
fatal: [172.17.177.40]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nIT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\r\nSomeone could be eavesdropping on you right now (man-in-the-middle attack)!\r\nIt is also possible that a host key has just been changed.\r\nThe fingerprint for the ECDSA key sent by the remote host is\nSHA256:sGzVXWHfMI/I10ivgmsYJg9wr85iVXB4c5ZZQNk2stI.\r\nPlease contact your system administrator.\r\nAdd correct host key in /home/israel/.ssh/known_hosts to get rid of this message.\r\nOffending ECDSA key in /home/israel/.ssh/known_hosts:1\r\n remove with:\r\n ssh-keygen -f \"/home/israel/.ssh/known_hosts\" -R \"172.17.177.40\"\r\nChallenge/response authentication is disabled to avoid man-in-the-middle attacks.\r\nLoad key \"/home/vagrant_id_rsa\": Permission denied\r\nisrael@172.17.177.40: Permission denied (publickey,password).", "unreachable": true}
PLAY RECAP *************************************************************************************************************
172.17.177.40 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
Como sou usuário de windows eu estou utilizando o ubuntu como subsystem com o Ansible instalado nele, e subi uma VM através do vagrant para rodar o wordpress. Fiz o processo de geração das chaves e através do vagrantfile coloquei o conteúdo da chave pública para o authorized keys, e mesmo assim o erro permanece. Já tentei a exclusão do know_hosts também, porém sem sucesso. Segue abaixo o Vagrantfile e o arquivo hosts
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty32"
config.vm.define "wordpress" do |wordpress|
wordpress.vm.network "private_network", ip: "172.17.177.40"
wordpress.vm.provision "shell",
inline: "cat /vagrant/ssh-keys/vagrant_id_rsa.pub >> .ssh/authorized_keys"
end
config.vm.provider "virtualbox" do |v|
v.memory = 1024
end
end
[wordpress]
172.17.177.40
[wordpress:vars]
ansible_user=root
ansible_ssh_private_key_file=/home/vagrant_id_rsa
ansible_python_interpreter=/usr/bin/python2
ansible_ssh_common_args='-o StrictHostKeyChecking=no'