How to set host_key_checking=false in ansible inventory file?

前端 未结 6 585
清歌不尽
清歌不尽 2020-12-12 12:10

I would like to use ansible-playbook command instead of \'vagrant provision\'. However setting host_key_checking=false in the ho

6条回答
  •  甜味超标
    2020-12-12 12:57

    I could not use:

    ansible_ssh_common_args='-o StrictHostKeyChecking=no'
    

    in inventory file. It seems ansible does not consider this option in my case (ansible 2.0.1.0 from pip in ubuntu 14.04)

    I decided to use:

    server ansible_host=192.168.1.1 ansible_ssh_common_args= '-o UserKnownHostsFile=/dev/null'
    

    It helped me.

    Also you could set this variable in group instead for each host:

    [servers_group:vars]
    ansible_ssh_common_args='-o UserKnownHostsFile=/dev/null'
    

提交回复
热议问题