Keeping inventory and other data separate from code

Hi all,

Currently my inventory is stored in the same git repo as my play(book)s, roles etc, which I don't like.

What are common ways to avoid this? Perhaps keep inventory in a subdir which is .gitignored, and make that a separate repo?

I also want to keep data which is not strictly inventory - eg lists of users, ssh keys etc which are specific to my site/business, but shared across many hosts and groups. I think I need to use lookups to access this. Perhaps that data and inventory can go together in that other repo?

eg:

/home/richard/ansible/
   .git/
     .gitignore (ansible/data)
   .ansible.cfg
   /data
     .git/
     /inventory
       hosts
       /host_vars
       /group_vars
     users.yml
   /plays
   /roles

Does that seem reasonable?

That way, if (when) I have questions in the future, I can refer you all to my ansible repo without sharing the private data :slight_smile:

Are there better ways to do this?

Cheers,
Richard

Hi all,

Currently my inventory is stored in the same git repo as my play(book)s,
roles etc, which I don't like.

Consider using git submodules if you want a unified workspace.

Hi all,

Currently my inventory is stored in the same git repo as my play(book)s,
roles etc, which I don't like.

Consider using git submodules if you want a unified workspace.

Hmm. I got thoroughly confused by submodules last time I tried them. And didn't Linus say he regretted having devised them in the first place?

Is there an easy way to have a non-unified workspace, so that I can use separate repos more easily?

Cheers,
Richard