Skip to content

Instantly share code, notes, and snippets.

@antaflos
Last active December 29, 2015 09:09
Show Gist options
  • Save antaflos/7648406 to your computer and use it in GitHub Desktop.
Save antaflos/7648406 to your computer and use it in GitHub Desktop.
Order seems to matter when mixing include-style and resource-style class declarations. Or is this a problem specific to the puppetlabs-apache module?
node 'web02.example.com' {
  include 'some::other::modules'
  include 'even::more::modules'

  # Declare apache::mod::php before apache
  include 'apache::mod::php'
  class { 'apache':
    mpm_module => 'prefork',
  }

  apache::vhost { $::fqdn:
    port    => '80',
    docroot => "/var/www/${::fqdn}",
  }
}

Leads to:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
  apache::mod::php requires apache::mod::prefork; 
  please enable mpm_module => 'prefork' on Class['apache'] at 
  /etc/puppet/environments/testing/modules/apache/manifests/mod/php.pp:5 
  on node web02.example.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Versus:

node 'web02.example.com' {
  include 'some::other::modules'
  include 'even::more::modules'

  class { 'apache':
    mpm_module => 'prefork',
  }
  # Declare apache::mod::php after apache
  include 'apache::mod::php'

  apache::vhost { $::fqdn:
    port    => '80',
    docroot => "/var/www/${::fqdn}",
  }
}

Works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment