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

Doesn't work with Drupal 6 #5

Open
praseodym opened this issue Mar 29, 2014 · 3 comments
Open

Doesn't work with Drupal 6 #5

praseodym opened this issue Mar 29, 2014 · 3 comments

Comments

@praseodym
Copy link
Contributor

The drupal.j2 configuration doesn't work with Drupal 6 out of the box, mainly because it requires leading slashes to be stripped.

For example, see https://github.com/perusio/drupal-with-nginx/blob/D6/apps/drupal/drupal6.conf#L226

@pbuyle
Copy link
Member

pbuyle commented Mar 31, 2014

If I'm not mistaken, the master branch of perusio's configuration is compatible with both Drupal 6 and 7. So the Drupal version is a property of the configured sites. The change would be to have Drupal version passed as a property of sites in nginx_drupal_sites and a different template should be used for each supported version. The default version for sites with no version property should be configurable via a role variable (nginx_drupal_default_version).

@praseodym
Copy link
Contributor Author

I see; I was using the D6 branch. Main problem is that the site template needs to be changed for Drupal 6. I think this could also be implemented through some conditionals in a single template.

@pbuyle
Copy link
Member

pbuyle commented Mar 31, 2014

If the changes were simple enough to allow a single template then yes, conditionals in the sites-availables/drupal-site.j2 template would be the way to go. But the file that need to be changed is shared by multiple sites.

AFAIK, it should be possible to use a single nginx configuration for a server with Drupal 6 and 7. If Drupal 6 support is worked on, I would prefer to see it made in a way that allow this.

So the solution would be to have a apps/drupal/drupal6.j2 parametrized template based on https://github.com/perusio/drupal-with-nginx/blob/master/apps/drupal/drupal6.conf. The file include in sites-availables/drupal-site.j2 should use a condition to check which version to use. the condition should be something like item.version|default(nginx_drupal_default_version) == 6, nginx_drupal_default_version should be added to defaults/main.yml and documented in the README.md. The default value of nginx_drupal_default_version should be something like {{ 6 if (nginx_drupal_git.version = 'D6') else 7 }}.

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