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

Use a /group_vars/ directory in place of /env_vars/; update docs for ansible-vault #66

Open
YPCrumble opened this issue Sep 28, 2016 · 2 comments

Comments

@YPCrumble
Copy link
Collaborator

@jcalazan I've been updating the playbook to use ansible-vault for my deployment. Per the ansible best practices for variables and vaults, I suggest we switch the /env_vars/{{env}} path to a /group_vars/ path. This uses the default variables for each group defined in the inventory file - this way we can then also remove the vars_files directives in each playbook (ansible finds the /group_vars/ automatically based on the group name).

I could then update the README to include instructions on using ansible-vault in deployment.

What do you think? Is there a reason you used /env_vars/ instead of /group_vars/ that I might have missed?

Happy to submit a PR if the above makes sense to you.

@jcalazan
Copy link
Owner

@YPCrumble No particular reason, I probably just wasn't aware of it. If we can implement group_vars for the different environments that definitely sounds better! Please feel free to open a PR. Thanks!

@YPCrumble
Copy link
Collaborator Author

@jcalazan I've been looking more at this. The goal I'd have to including group_vars would also be to move the variables that need adjusting for deploying a new site into one place. Currently it feels like there are multiple places I need to hunt down and adjust each time I deploy a site.

One side effect is that variables in /group_vars/ are not defined when the playbook is parsed. This means that we would need to remove the {{ application_name }} from lines like:

- name: Provision a {{ application_name }} web server

Happy to submit a PR but let me know if you think this isn't a valuable submission?

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

2 participants