diff --git a/manifests/init.pp b/manifests/init.pp
index 566e2da8bd06ac05bc4b993aaf0acc0d95851a6c..f73421f34753a7252af6f1ec78779d23209b7ce5 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -94,3 +94,74 @@ class apache::logdir($owner='root', $group='root', $mode=0700)
 	    require => Package['httpd'], before => Class[apache::service];
     }
 }
+
+
+
+/*
+ * Manage an Apache config file in conf.d.
+ *
+ * This will manage a config file in the Apache configuration directory,
+ * and the needed Include directive in the main httpd.conf file.  This
+ * can be used e.g. for managing global configuration for Apache modules
+ * (LoadModule directives being a good candidate), and/or virtual host
+ * declarations.
+ *
+ * The parameters 'content' and 'source' have the same meaning as in
+ * the file type.  Exactly one of them must be specified when the
+ * 'ensure' parameter is set to 'present' (the default).
+ */
+
+define apache::include_file($content=undef, $source=undef, $ensure='present')
+{
+    include apache
+
+    $includefile = "${apache::configdir}/${name}.conf"
+
+    case $ensure
+    {
+	'present': {
+	    # Put the included file into place before the Include directive;
+	    # in case the machine reboots in the middle, we do not want to
+	    # needlessly hose up the Apache service.
+	    file {
+		$includefile:
+		    ensure => file,
+		    owner => 'root', group => 'root', mode => 0444,
+		    content => $content, source => $source,
+		    notify => Class[apache::service];
+	    }
+	    ensure_line {
+		"apache::include_file::include::${name}":
+		    file => $apache::configfile,
+		    line => "Include conf.d/${name}.conf",
+		    where => '^##--Include conf\.d/\*\.conf$',
+		    addhow => append,
+		    require => [ Ensure_line['apache::base::no_include_all'],
+				 File[$includefile] ],
+		    notify => Class[apache::service];
+	    }
+	}
+
+	'absent': {
+	    # Remove the Include directive before the included file; in case
+	    # the machine reboots in the middle, we do not want to needlessly
+	    # hose up the Apache service.
+	    delete_lines {
+		"apache::include_file::include::${name}":
+		    file => $apache::configfile,
+		    pattern => "\s*Include\s+conf\.d/${name}\.conf\s*$",
+		    before => File[$includefile],
+		    notify => Class[apache::service];
+	    }
+	    file {
+		$includefile:
+		    ensure => absent, notify => Class[apache::service];
+	    }
+	}
+
+	default: {
+	    fail("Apache::Include_file[${title}]: ",
+		 "Bad parameter ensure: ${ensure}")
+	}
+    }
+}