forumone / web-starter

Starting place for developing Drupal, Wordpress and other web applications
http://forumone.github.io/web-starter/
22 stars 11 forks source link

Salt: Apache support #270

Closed johnbburg closed 5 years ago

johnbburg commented 7 years ago

Provide support to use apache instead of nginx in VMs provisioned by Salt.

johnbburg commented 7 years ago

My best guess is that we would need to add a yeoman template for salt/_minion with something like the following lines modified:

{{#use_nginx}}
  - https://github.com/forumone/nginx-formula.git:
    - base: 1.0.x
{{/use_nginx}}
{{#use_apache}}
  - https://github.com/forumone/apache-formula:
    - base: 1.0.x
{{/use_apache}}

I'm not really sure where the corresponding updates need to be made in https://github.com/forumone/generator-web-starter. This particular configuration has historically been grouped with the "platform" used, e.g. f1, acquia, pantheon etc.,

Would it make sense to define a new platform named "custom" or "advanced" that just collected custom settings. I understand that on the salt branch, salt/roots/pillars/project.sls, is meant for anything custom. So guess my other question is how do I reconcile settings in this and salt/minion that are mutually exclusive (like using nginx Vs. apache)?

mshade commented 7 years ago

The minion file will contain all the available formulas (so, both nginx AND apache), but it's the ./salt/roots/states/top.sls file that activates the formula and applies it. That's where the switching will happen from the generator and where we need to care about mutually exclusive software packages.

I'm not sure where the logic for it will go; we have yet to enable any sort of yeoman-controlled logic for the top.sls file. Right now, the kitchen sink is installed - both elasticsearch and solr, for example, which isn't at all necessary.

I am thinking that we'll have config defaults declared for both apache and nginx and merely switch which service is used via the top.sls file. The project.sls file is then used to override any of the defaults, like the document root (./web vs ./public) or which virtual host template to use (wordpress vs drupal or static etc).

The platform distinction may or may not be useful to carry over -- on F1, we could use either Apache or Nginx, for example; that choice is not necessarily inherent to the platform.

I would be really happy to talk through more architecture questions like these, to end up with a sane set of templates that are easily extendable.