-
-
Notifications
You must be signed in to change notification settings - Fork 607
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
Do hosts and group_vars need to match? #216
Comments
|
I've been running into this too... needing to set variables for the deploy role per site (for example a different theme name in I can add things to the wordpress_sites dictionary... but is there any reason we couldn't have a structure like @developdaly expected? Looking at http://docs.ansible.com/ansible/intro_inventory.html#splitting-out-host-and-group-specific-data it seems the structure could be:
|
I've been running into this with variables for deploy role per site. (eg, theme directory for project_local_files and project_pre_build_commands_local). If I'm understanding http://docs.ansible.com/ansible/intro_inventory.html#splitting-out-host-and-group-specific-data correctly, couldn't we have something like:
|
somewhat related discussion of splitting variables files in #133 @JacobDorman I realize you've already worked out a theme variable per site, but here's one approach to compare: https://discourse.roots.io/t/modified-deploy-sh-to-accept-a-third-argument-ansible-fails/4127/3 |
@JacobDorman I was thinking about this thread here while replying to this other thread about varying build commands per site (on deploy): https://discourse.roots.io/t/how-can-selectively-run-build-commands-per-site/4557 You said:
Don't hesitate to point out some specifics if you think fixes would be of general use for Trellis. Thanks! |
Yep, that's closer to what I ended up with. Default/Common config for I've been playing around with adapting trellis for other platforms, mainly magento, which has been a good learning experience. Some overlaps between sites_install (dev) and deploy (staging/prod) are currently:
Dev on vagrant with synced folders is obviously a different situation than a deploy, but might be possible to share more than currently. That ansible vault branch looks good btw, would like to see that included. |
I've had a similar seed of a thought about whether there would be merit in trying to combine the Testing Deploys on Dev VM Might be Nice I first thought about all this when btamm said this
Conflicting Purposes between Dev and Staging/Production These conflicting purposes may to apply to your third bullet "no custom commands to run after install in sites_install". On dev, you might be running and re-running some such commands constantly (e.g., gulp commands), whereas on a deploy to staging/production, you'd want to run the command only once to produce a static release. I didn't try to articulate that very carefully, sorry. If you see a strong argument for creating more overlap between dev and staging/production and want to articulate it in a new issue, I imagine people would be interested in your thoughts. |
Just a quick thought, but shouldn't the "snapshot" role be left to the git branch that's being deployed? Using the git-flow method, at least, your master branch is always meant to be working and stable, and your development branch is for working off of with live changes. So, if the environments were as identical as possible, it would still leave room to develop without damaging production flow... I'm not articulating very well either... |
I think you've covered the benefits and challenges well. I hadn't thought about the Instead of combining I'll have another look next time i'm at that end of a project and report back if I come up with something useful. |
hosts/
andgroup_vars/
configurations. My initial thought was that I could have a setup for multiple sites and multiple environments like this:And then deploy either site to either environment with all of these commands:
But those commands don't seem to work; they fail with:
So do the
hosts/
andgroup_vars/
have to match?group_vars
configuration, can multiple sites be defined underwordpress_sites
?The text was updated successfully, but these errors were encountered: