5 ms·
Ansible ships ansible.conf and most (all?) distributions will store that in /etc. It's trivial to change to override this by having ansible.cfg in your project'
by gtirloni 7y ago
Ansible ships ansible.conf and most (all?) distributions will store that in /etc. It's trivial to change to override this by having ansible.cfg in your project's folder.
- yjftsjthsd-h 7y agoYes, I know; that's what I do. But it seems like a very strange default way to handle it given that it includes things like your inventory which are very much specific to any individual project. It would be like if Firefox shipped with its default profile location in /var or /usr/share and suggested that if you really wanted to then you could use a local configuration to move your bookmarks into your home directory.
- Spivak 7y agoIt's odd that you bring up FF since they they do have global configuration in /etc which is used by sysadmins to set mandatory or default preferences.
- yjftsjthsd-h 7y agoFor default/mandatory options, sure, but for inventory? Roles? Plays? I completely get having a sane default /etc/ansible/ansible.cfg, but sticking your inventory under /etc seems like a terrible mismatch. I guess to me, it's that ansible {inventory,roles,playbooks} aren't "configuration" files so much as they are, in a sense, "documents", and as such they should live in my home directory like all other "documents".
- Spivak 7y agoI think the intent is to reduce the friction of people who are used to Puppet where all of your code lives in /etc/puppetlabs/code on the master. It's not an uncommon workflow to have a central "Ansible server" with a service account (hence why Tower exists) that's essentially used as a privileged bastion host in environments where sysadmin laptops don't have a way to reach servers directly.
- gtirloni 7y agoGood point. Yeah, to be honest, I have never used the files in /etc/ansible in 5 years of using Ansible.