Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to storing inventory alongside project (instead of /etc/ansible/hosts) #260

Closed
geerlingguy opened this issue May 1, 2020 · 1 comment

Comments

@geerlingguy
Copy link
Owner

geerlingguy commented May 1, 2020

A reader recently sent in this feedback:

I always found it odd that, by default, I had to add the Inventory to /etc/ansible/hosts. When I am running on a hosted environment I usually do not have access to the root-tree and furthermore, when focusing on infrastructure-as-code my inventories belong inside a scm anyways.

You mention how to pass a inventory via cli in the book, but at a rather late stage. I remember that when I started with Ansible (before your book) it was the first thing I tried to figure out.
So I would suggest to add this information in the beginning of the book, maybe as a note just where you explain the initial hosts-file.

As I've been working on the Ansible 101 video series, I noticed the same thing and was a little bothered by it. Nowadays, I always store my inventory (and, quite often, an ansible.cfg file with the path to it configured) inside my project directory.

I think I should default to that in all the early examples, and just mention that you can also store inventory globally in /etc/ansible/hosts.

Thanks Marc!

@geerlingguy
Copy link
Owner Author

geerlingguy commented Aug 2, 2020

Fixed in the latest version of the book, will be published soon. I will also be pushing an update to the orchestration example directory in this repo to close out the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant