#FIND HOSTS FILE MAC OS X UPGRADE#
Try to upgrade to the latests versions if you experience issues (especially regarding network). There are some versions combinations that are problematic. Note that Vagrant+Virtualbox+Ansible trio does not always get along well. You can also run it manually, without resorting to Vagrant's ansible provisionner : ansible-playbook -i hosts provision.yml -ask-pass -sudo Now when you run vagrant up (or vagrant provision), Vangrant's ansible provionner will look for a file name hosts in the same directory as Vagrantfile, and will try to apply the provision.yml playbook. # Use ansible.verbose to see detailled output for ansible runs # Use anible.tags if you want to restrict what `vagrant provision` V.customize Ĭonfig.vm.provision :ansible do |ansible|
test), and create a Vagrant file inside : Make sure you’re using an admin account to do the following steps. You can use it to open and edit any text file including the hosts file on your machine. To locate the Hosts file on Mac: Select Go Go to Folder from the Mac menu bar Type in /private/etc/hosts Click Go You should end up within the 'etc' folder and have the Mac Hosts file highlighted. It’s located inside the Terminal and is called nano editor. To send files to your Mac, follow these steps: Locate and select the file you want to send. It’s fairly easy to edit the hosts file on your Mac since there’s a built-in editor to do it. In the preceding command, sftpuser is the user name and transfer-key is the SSH private key. Let's go for the Vagrant ansible provisionner first :Ĭreate a directory (e.g. The File Transfer Protocol (FTP) is used to transfer files from one host to another, regardless of the hosts’ physical locations. Now you don't mention if you want to use the ansible provisionner available in vagrant, or if you want to provision your vagrant host manually. use export ANSIBLE_HOSTS=path_to_hostfile as suggested by DomaNitro in his answer.add inventory = path_to_hostfile in the section of your ~/.ansible.cfg configuration file.For the purposes of this demonstration, we will use the nano text editor that is included with macOS Sierra and later versions. Since it is a text file, you can essentially use any text editor to make modifications.
use the -i command line switch and pass your inventory file path On macOS machines, the file is located at /etc/hosts.While Ansible will try /etc/ansible/hosts by default, there are several ways to tell ansible where to look for an alternate inventory file :