# /etc/ansible and ansible.cfg directory and files are missing in macosx (#31907)

**URL:** <https://forum.ansible.com/t/etc-ansible-and-ansible-cfg-directory-and-files-are-missing-in-macosx-31907/25773>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [October 19, 2017, 6:35am UTC](https://forum.ansible.com/t/etc-ansible-and-ansible-cfg-directory-and-files-are-missing-in-macosx-31907/25773 "2017-10-19T06:35:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deniz\_Rende](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@Deniz\_Rende](https://forum.ansible.com/u/Deniz_Rende)\
**Post date:** [October 19, 2017, 6:35am UTC](https://forum.ansible.com/t/etc-ansible-and-ansible-cfg-directory-and-files-are-missing-in-macosx-31907/25773/1 "2017-10-19T06:35:10Z")

</div>

Hello ,

I was wondering why in mac osx the directory /etc/ansible and ansible.cfg file are not automatically created when it is done through pip install.

In other OS’s such as ubuntu and centos, these directories are created through their package management installation automatically.

I would expect installation behaviour to be same accross all platforms.I do realize that the config file and the ansible directory can be created manually but I think having this in one platform and not having in the other may be causing inconsistencies. The ticket was closed as such as it was mentioned that this was an expected behaviour. Could someone be kind enough to explain why this inconsistency is expected ?

Thank you!

Regards,

Deniz Rende

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [October 19, 2017, 1:52pm UTC](https://forum.ansible.com/t/etc-ansible-and-ansible-cfg-directory-and-files-are-missing-in-macosx-31907/25773/2 "2017-10-19T13:52:57Z")

</div>

This is not an OS X nor an Ansible issue, its a pip issue, it is not  
designed to handle system configuration files. System packages ARE  
designed to do this.

---

<div class="post-metadata">

**Author:** ![Julian\_Brown](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@Julian\_Brown](https://forum.ansible.com/u/Julian_Brown)\
**Post date:** [October 19, 2017, 2:35pm UTC](https://forum.ansible.com/t/etc-ansible-and-ansible-cfg-directory-and-files-are-missing-in-macosx-31907/25773/3 "2017-10-19T14:35:33Z")

</div>

I used brew to install Ansible on my macbook pro, it did not create /etc/ansible either.

I also have my hosts and ansible.cfg from the directory and it works for me.

Julian

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [October 19, 2017, 2:44pm UTC](https://forum.ansible.com/t/etc-ansible-and-ansible-cfg-directory-and-files-are-missing-in-macosx-31907/25773/4 "2017-10-19T14:44:10Z")

</div>

That is a brew specific problem, they DO create ansible.cfg but they  
choose to use different directories.

---

<div class="post-metadata">

**Author:** ![Deniz\_Rende](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@Deniz\_Rende](https://forum.ansible.com/u/Deniz_Rende)\
**Post date:** [October 19, 2017, 5:19pm UTC](https://forum.ansible.com/t/etc-ansible-and-ansible-cfg-directory-and-files-are-missing-in-macosx-31907/25773/5 "2017-10-19T17:19:51Z")

</div>

Brian,

So Per the documentation:

[http://docs.ansible.com/ansible/latest/intro\_installation.html#running-from-source](http://docs.ansible.com/ansible/latest/intro_installation.html#running-from-source)

I decided to go ahead and build from source, because it says there in the documentation:

“Once running the env-setup script you’ll be running from checkout and the default inventory file will be /etc/ansible/hosts. You can optionally specify an inventory file (see [Inventory](http://docs.ansible.com/ansible/latest/intro_inventory.html)) other than /etc/ansible/hosts:”

so following that:

deniz@lemtmp]$ git clone [https://github.com/ansible/ansible.git](https://github.com/ansible/ansible.git) --recursive  
Cloning into ‘ansible’…  
remote: Counting objects: 265907, done.  
remote: Compressing objects: 100% (17/17), done.  
remote: Total 265907 (delta 13), reused 2 (delta 2), pack-reused 265888  
Receiving objects: 100% (265907/265907), 87.31 MiB | 769.00 KiB/s, done.  
Resolving deltas: 100% (170839/170839), done.  
[deniz@lemtmp]$ cd ansible/  
[deniz@lemansible]$ ls  
CHANGELOG.md Makefile bin lib test  
CODING\_GUIDELINES.md README.md contrib licenses ticket\_stubs  
CONTRIBUTING.md RELEASES.txt docs packaging tox.ini  
COPYING ROADMAP.rst docsite\_requirements.txt requirements.txt  
MANIFEST.in VERSION examples setup.py  
MODULE\_GUIDELINES.md ansible-core-sitemap.xml hacking shippable.yml  
[deniz@lemansible]$ source ./hacking/env-setup  
running egg\_info  
creating lib/ansible.egg-info  
writing lib/ansible.egg-info/PKG-INFO  
writing dependency\_links to lib/ansible.egg-info/dependency\_links.txt  
writing requirements to lib/ansible.egg-info/requires.txt  
writing top-level names to lib/ansible.egg-info/top\_level.txt  
writing manifest file ‘lib/ansible.egg-info/SOURCES.txt’  
reading manifest file ‘lib/ansible.egg-info/SOURCES.txt’  
reading manifest template ‘MANIFEST.in’  
no previously-included directories found matching ‘ticket\_stubs’  
no previously-included directories found matching ‘hacking’  
warning: no files found matching ‘SYMLINK\_CACHE.json’  
writing manifest file ‘lib/ansible.egg-info/SOURCES.txt’

Setting up Ansible to run out of checkout…

PATH=/private/tmp/ansible/bin:/private/tmp/ansible/test/runner:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/usr/local/Cellar/python3/3.6.1/bin/python3:/Users/deniz/Code/Go/bin:/usr/local/Cellar/go/1.8.3/libexec/bin  
PYTHONPATH=/private/tmp/ansible/lib:  
MANPATH=/private/tmp/ansible/docs/man:

Remember, you may wish to specify your host file with -i

Done!

[deniz@lemansible]$ ls /etc/ansible  
ls: /etc/ansible: No such file or directory

So it is not there despite what the offical doc is saying…Any ideas ?

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [October 19, 2017, 5:39pm UTC](https://forum.ansible.com/t/etc-ansible-and-ansible-cfg-directory-and-files-are-missing-in-macosx-31907/25773/6 "2017-10-19T17:39:54Z")

</div>

> So Per the documentation:
> 
> [http://docs.ansible.com/ansible/latest/intro\_installation.html#running-from-source](http://docs.ansible.com/ansible/latest/intro_installation.html#running-from-source)
> 
> I decided to go ahead and build from source, because it says there in the  
> documentation:
> 
> "Once running the env-setup script you’ll be running from checkout and the  
> default inventory file will be /etc/ansible/hosts. You can optionally  
> specify an inventory file (see Inventory  
> \<[http://docs.ansible.com/ansible/latest/intro\_inventory.html&gt;\](http://docs.ansible.com/ansible/latest/intro_inventory.html&gt;%5C)) other than  
> /etc/ansible/hosts:"

\<snip /\>

> Remember, you may wish to specify your host file with -i
> 
> Done!
> 
> [deniz@lemansible]$ ls /etc/ansible  
> ls: /etc/ansible: No such file or directory
> 
> So it is not there despite what the offical doc is saying....Any ideas ?

The docs says what is the default inventory file in Ansible, that doesn't mean that it will be automatically created, that is the job for the user/sysadmin.

---

<div class="post-metadata">

**Author:** ![Deniz\_Rende](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@Deniz\_Rende](https://forum.ansible.com/u/Deniz_Rende)\
**Post date:** [October 19, 2017, 5:44pm UTC](https://forum.ansible.com/t/etc-ansible-and-ansible-cfg-directory-and-files-are-missing-in-macosx-31907/25773/7 "2017-10-19T17:44:51Z")

</div>

Kai,

I am not just talking about inventory file…it is the /etc/ansible directory itself.

It is clear: "Once running the env-setup script you’ll be running from checkout and the

> default inventory file will be /etc/ansible/hosts."

Ok, so forget about the inventory file, where is the /etc/ansible directory ?

Again, this did not happen with other distros such as Centos, or Ubuntu.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [October 19, 2017, 6:13pm UTC](https://forum.ansible.com/t/etc-ansible-and-ansible-cfg-directory-and-files-are-missing-in-macosx-31907/25773/8 "2017-10-19T18:13:37Z")

</div>

The same is true for /etc/ansible, this is the default folder for Ansible but is not automatically created.

If using the source as you did or pip install on Centos or Ubuntu the /etc/ansible will not be created.

But using the yum package for Centos or deb package for Ubuntu the /etc/ansible will be created.  
That's because the person who created the packages have added to the package the creation of the folder /etc/ansible and the files in it.  
And as Brian mention the person that package the brew have chosen a different directory than /etc/ansible.

So if you using any other method of installing Ansible you must likely need to create the folder for yourself.

I have also written a little about it in this thread  
[https://groups.google.com/d/msg/ansible-project/KfyPYZLr2UU/aPtj-EUFAwAJ](https://groups.google.com/d/msg/ansible-project/KfyPYZLr2UU/aPtj-EUFAwAJ)

---

<div class="post-metadata">

**Author:** ![Deniz\_Rende](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@Deniz\_Rende](https://forum.ansible.com/u/Deniz_Rende)\
**Post date:** [October 19, 2017, 7:29pm UTC](https://forum.ansible.com/t/etc-ansible-and-ansible-cfg-directory-and-files-are-missing-in-macosx-31907/25773/9 "2017-10-19T19:29:19Z")

</div>

Ok Kai, thank you so much!
