Ansible SSH forwarding doesn't seem to work with Vagrant

前端 未结 6 1293
Happy的楠姐
Happy的楠姐 2021-01-31 04:17

OK, strange question. I have SSH forwarding working with Vagrant. But I\'m trying to get it working when using Ansible as a Vagrant provisioner.

I found out exactly what

6条回答
  •  离开以前
    2021-01-31 04:45

    The key difference appears to be the UserKnownHostFile setting. Even with StrictHostKeyChecking turned off, ssh quietly disables certain features including agent forwarding when there is a conflicting entry in the known hosts file (these conflicts are common for vagrant since multiple VMs may have the same address at different times). It works for me if I point UserKnownHostFile to /dev/null:

    config.vm.provision "ansible" do |ansible|
      ansible.playbook = "playbook.yml"
    
      ansible.raw_ssh_args = ['-o UserKnownHostsFile=/dev/null']
    end
    

提交回复
热议问题