Where to store Ansible host file on Mac OS X

后端 未结 6 1268
暗喜
暗喜 2021-01-29 23:12

I am trying to get started with Ansible to provision my Vagrantbox, but I can’t figure out how to deal with host files.

According to the documentation the should be stor

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-29 23:57

    If you use Vagrant's ansible provisioner, Vagrant will automatically generate an Ansible hosts file (called vagrant_ansible_inventory_default) and configure ansible-playbook to use that file. It looks like this:

    # Generated by Vagrant
    
    default ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222
    

    It calls the Vagrant host "default", so your plays should either refer to "default" or "all".

提交回复
热议问题