Accommodating non-standard setups where wordpress_sites live outside of group_vars #278
Description
trellis-cli is primarily designed around environments which are really inventory/host groups in Ansible. This is the standard setup where wordpress_sites.yml
is defined in each environment group var folder.
Because of this, the CLI detects environments by a glob group_vars/*/wordpress_sites.yml
and parses them to be "site aware". Obviously this means it won't support any other kind of setups. Below is an example where the sites are defined per host (not group) which breaks these assumptions.
Example of a use case here in Roots Discourse.
We have our Trellis structured as follows:
trellis/
├── group_vars/
└── production/
├── main.yml
└── vault.yml
└── staging/
└── host_vars
└── server1/
└── wordpress_sites.yml
└── server2/
└── staging1/
└── staging2/
Our deploy then looks like this with the old deploy.sh script:
./bin/deploy.sh production domain.example --limit=server1
Not strictly related to this issue, but if I try to run your suggestion while provisioning, trellis-cli gives an error
trellis provision --extra-vars ansible_limit=server1 production
Error: production is not a valid environment, valid options are [development]
Originally posted by @dalepgrant in #208 (comment)