I am setting up a new infrastructure as code repository for a small to medium size project. The problem I am currently trying to solve is how to store my environment variables such that they can be read and used by all services and scripts within the repo. Some of the tools being used are Ansible, Powershell, Bash...
My current solution is a simple text file, manually created per environment. Each line has a variable that the services and scripts can look up. However, this seems clunky, as I have to create the logic to read this file in every script that is made.
So my question is, what approach should I be taking to provide all my services with environment variables? Am I on the right track, or should I be using something entirely different for this?
I'm not sure what I can use to provide this to all the different tools. For details sake, I am not talking about secrets management. I mean variables such as: DNS address of the environment's DC, log server address, etc... There are significant constraints on addition of new software/tools due to the sensitivity of the environment. For example, I was considering using JSON format for the environment file, but Bash does not parse that natively. Meaning I would have to install a third party tool like 'jq' to use.
Any feedback welcome. Thank you!