Where to store Ansible host file on Mac OS X

后端 未结 6 1267
暗喜
暗喜 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:54

    Here is a description what to do after installing Ansible on Mac, it worked for me: ansible-tips-and-tricks.readthedocs.io

    I downloaded the ansible.cfg file to

    /Users/"yourUser"/.ansible
    

    and afterwards you can edit the ansible.cfg file by uncommenting the

    inventory      = /Users/"yourUser"/.ansible 
    

    line and specifying the path to the ansible folder like shown above. You can create the hosts file in this folder then as well. To try it out locally, you can put

    localhost              ansible_connection=local
    

    in the hosts file and try it out with

    ansible -m ping all
    

提交回复
热议问题