How to create ansible host file on mac? When I try to create ansible host file as follows: 

sudo vi /usr/local/etc/ansible/hosts


When I try to save the file I get following error:

"/usr/local/etc/ansible/hosts" E212: Can't open file for writing
Run:

$ sudo touch /usr/local/etc/ansible/hosts
$ sudo vi /usr/local/etc/ansible/hosts


To create a file and then open it.