Procurei resposta no forim mas nenhuma realmente me ajudou. Não estou conseguindo acesso a maquina pelo ansible. da o seguinte erro:
$ ansible-playbook provisioning.yml -u vagrant -i hosts --private-key .vagrant/machines/wordpress/virtualbox/private_keyprovisioning
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:14tsAq32yUL/HKuS99TrBz0NlQ8vJsk81lQJQMi5/e4.\r\nPlease contact your system administrator.\r\nAdd correct host key in /home/reis/.ssh/known_hosts to get rid of this message.\r\nOffending ECDSA key in /home/reis/.ssh/known_hosts:1\r\n remove with:\r\n ssh-keygen -f "/home/reis/.ssh/known_hosts" -R "172.17.177.40"\r\nECDSA host key for 172.17.177.40 has changed and you have requested strict checking.\r\nHost key verification failed.", "unreachable": true}
reis@reis:~/AmbienteDevOps/ansible$ vagrant ssh-config Host wordpress HostName 127.0.0.1 User vagrant Port 2222 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile /home/reis/AmbienteDevOps/ansible/.vagrant/machines/wordpress/virtualbox/private_key IdentitiesOnly yes LogLevel FATAL
é uma falha com ssh do vagrant, mas não consigo resolver.
reis@reis:/AmbienteDevOps/ansible$ vagrant -v
Vagrant 2.2.6
reis@reis:/AmbienteDevOps/ansible$ ansible --version
ansible 2.9.6
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/reis/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0]
arquivos: VagrantFile Vagrant.configure("2") do |config| config.vm.box = "ubuntu/trusty64"
config.vm.provider"Virtualbox"do |vb| vb.memory = 1024 end
config.vm.define "wordpress" do |wp| wp.vm.network "private_network", ip: "172.17.177.40"
end
end
host [wordpress] 172.17.177.40
provisioning.yml
- hosts: all
tasks:
- name: 'Instala o PHP5' apt: name: php5 state: latest become: yes
- name: 'Instala o Apache2' apt: name: apache2 state: latest become: yes
- name: 'Instala o modphp' apt: name: libapache2-mod-php5 state: latest become: yes