Ao tentar executar o comando no host remoto:
ansible node_wordpress -u vagrant --private-key /vagrant/.vagrant/machines/node_wordpress/virtualbox/private_key -i /vagrant/hosts -m shell -a 'echo Hello World'
Retornou o seguinte erro:
The authenticity of host '192.168.0.101 (192.168.0.101)' can't be established.
ECDSA key fingerprint is SHA256:{***********}.
Are you sure you want to continue connecting (yes/no)? yes
192.168.0.101 | FAILED! => {
"changed": false,
"module_stderr": "Shared connection to 192.168.0.101 closed.\r\n",
"module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n",
"msg": "MODULE FAILURE",
"rc": 127
}
Arquivo vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 1
end
config.vm.define "control_node" do |control_node|
control_node.vm.provider "virtualbox" do |v|
v.name = "alura-ansible-control-node"
end
control_node.vm.network "public_network", ip: "192.168.0.100", bridge: "wlp2s0"
control_node.vm.hostname = "control-node"
control_node.vm.provision "shell", path: "script_control_node.sh"
end
config.vm.define "node_wordpress" do |wordpress|
wordpress.vm.provider "virtualbox" do |v|
v.name = "alura-ansible-node-wordpress"
end
wordpress.vm.network "public_network", ip: "192.168.0.101", bridge: "wlp2s0"
wordpress.vm.hostname = "node-wordpress"
end
end
Arquivo hosts
[node_wordpress]
192.168.0.101