Skip to content

Commit

Permalink
introduce flag to manage the docroot
Browse files Browse the repository at this point in the history
manage_docroot defaults to `true` to retain backwards compatibility.
This flag is  useful if the docroot is created by other, conflicting
means such as vcsrepo.
  • Loading branch information
igalic committed Jul 29, 2014
1 parent 86e1118 commit dfaae9a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,10 @@ Sets individual user access to the docroot directory. Defaults to 'root'.

Sets access permissions of the docroot directory. Defaults to 'undef'.

#####`manage_docroot`

Whether to manage to docroot directory at all. Defaults to 'true'.

#####`error_log`

Specifies whether `*_error.log` directives should be configured. Defaults to 'true'.
Expand Down
3 changes: 2 additions & 1 deletion manifests/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
#
define apache::vhost(
$docroot,
$manage_docroot = true,
$virtual_docroot = false,
$port = undef,
$ip = undef,
Expand Down Expand Up @@ -261,7 +262,7 @@

# This ensures that the docroot exists
# But enables it to be specified across multiple vhost resources
if ! defined(File[$docroot]) {
if ! defined(File[$docroot]) and $manage_docroot {
file { $docroot:
ensure => directory,
owner => $docroot_owner,
Expand Down
9 changes: 9 additions & 0 deletions spec/defines/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,15 @@
end
end

describe 'when docroot is *not* managed' do
let :params do default_params.merge({
:manage_docroot=> false,
}) end
it 'should not contain docroot ' do
is_expected.not_to contain_file(params[:docroot])
end
end

describe 'when wsgi_daemon_process and wsgi_daemon_process_options are specified' do
let :params do default_params.merge({
:wsgi_daemon_process => 'example.org',
Expand Down

0 comments on commit dfaae9a

Please sign in to comment.