Can't disable Ansible's host key checking

前端 未结 2 861
暗喜
暗喜 2021-02-02 13:39

I\'m using Ansible 1.5.4 to provision my Vagrant 1.4.3 box on Ubuntu 14.04 LTS.

I\'m getting the following error message in verbose mode:

相关标签:
2条回答
  • 2021-02-02 14:27

    Probably not your problem, but worth a shot: I was stalled on this, until I realized I added

    host_key_checking = False

    under a session that was not [defaults]. Once I actually moved it to under [defaults], changed host keys did not stop anything anymore.

    0 讨论(0)
  • 2021-02-02 14:33

    You'll need to set it via the Vagrantfile of the project. When the Vagrant Ansible provisioner makes the call to ansible-playbook it always sets the value of the ANSIBLE_HOST_KEY_CHECKING environment variable.

    Ansible itself takes the value of the environment variable if present. Therefore Vagrant will override the value used in your ansible.cfg.

    Therefore you just need something like:

    machine.vm.provision :ansible do |ansible|
      ansible.host_key_checking = false
      # etc.
    end
    
    0 讨论(0)
提交回复
热议问题