I just checked the documentation on creating a new Drupal site. I followed the steps in DECLARING A NEW DRUPAL SITE in INSTALL.txt particularly in #3

undine::drupal_instance { }

where drupal_instance.pp file is not available in /path/to/undine/modules/undine/manifests.

On the other hand, I check the sites_example and cannot see the implementation of undine::drupal_instance. Since my goal is just to create a virtualhost and not multisite:

# == Drupal7: ./sites/drupal7/manifests/init.pp
...
class drupal7 {
  # Require the undine package to ensure dependencies are met.
  require undine

  undine_apache::virtualhost { 'drupal7.local':
    document_root => '/var/www/drupal7',
    require => Undine::Drupal_codebase['/var/www/drupal7'],
  }
}

And I got this error below:

Could not find dependency Undine::Drupal_codebase[/var/www/drupal7] for Undine_apache::Virtualhost[drupal7.local] at /tmp/vagrant-puppet-1/modules-1/drupal7/manifests/init.pp:25

Out of curiosity I remove the 'require' part...And here is the ouput:

err: Could not apply complete catalog: Found 1 dependency cycle:
(Exec[/usr/sbin/a2ensite drupal7-local] => Service[apache2] => Class[Undine_apache] => Class[Undine] => Package[nfs-kernel-server] => Class[Undine] => Class[Drupal7] => Undine_apache::Virtualhost[drupal7.local] => Exec[/usr/sbin/a2ensite drupal7-local])
Cycle graph written to /var/lib/puppet/state/graphs/cycles.dot.
notice: Finished catalog run in 1.30 seconds

So I checked the cycles.dot. Please see the attached screenshot.

cycles

CommentFileSizeAuthor
cycles.png24.39 KBstoickthevast

Comments

alexiswatson’s picture

Title: Unable to create site » undine::virtualhost generates dependency cycle

Seems you've uncovered a piece of documentation that refers to the way sites were configured in very early alpha, and hasn't been updated yet. In short, undine::drupal_instances were what undine::drupal_codebase and undine::drupal_site used to be, but the former approach became very clunky when dealing with multisite. By treating single-site as a special case of multisite, we get the best of both worlds, hence the change. This will be addressed in #2276503: Update documentation for API changes, including references to obsoleted undine::drupal_instance.

The sites_example in the examples directory is the correct way to do this: it is necessary for sites to require undine to ensure everything is configured in the correct order.

If you only want a virtualhost without declaring a Drupal site for some reason, you should be able to use undine_apache::virtualhost on its own—when working by design, at least. I am able to duplicate the dependency cycle issue, and hope to have a fix out shortly.

EDIT: Disregard the above, this is why I'm not allowed near a computer without caffeine. Remove the "require undine" line in any sites and env classes and they should work just fine; it has recently been rearchitected to work without requiring the undine class in 20 different places. I'll make sure the examples and installation docs are updated.

alexiswatson’s picture

Title: undine::virtualhost generates dependency cycle » Dependency cycles occur when using sites examples
Component: Puppet DSL code » Documentation

Updating the issue title to better reflect what's going on.

alexiswatson’s picture

Status: Active » Fixed

I've committed updates to the documentation in INSTALL.txt, as well as provided a better example with improved documentation in examples/sites_example.

Again, if you only want a virtualhost without any Drupal site at all, you should be able to do the following:

class drupal7 {
  undine_apache::virtualhost { 'drupal7.local':
    document_root => '/var/www/drupal7',
  }
}

Feel free to reopen if you encounter any issues. Thanks!

  • Commit 9db9452 on 7.x-1.x by davidwatson:
    Issue #2276067 by davidwatson: Improved documentation for sites modules.
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.