Skip to content

Commit f1d64a0

Browse files
author
Morgan Haskel
committed
Convert apache::vhost to use concat fragments.
Lint failures fixed: - class_parameter_defaults check removed in puppet-lint 1.0 - alignment for tests/vhost.pp - need to add relative
1 parent b41cbf3 commit f1d64a0

24 files changed

+1018
-1784
lines changed

.puppet-lint.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
--no-single_quote_string_with_variables-check
22
--no-80chars-check
33
--no-class_inherits_from_params_class-check
4-
--no-class_parameter_defaults-check
54
--no-documentation-check

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,20 @@ The Apache module allows a lot of flexibility in the setup and configuration of
774774

775775
The `vhost` defined type allows you to have specialized configurations for virtual hosts that have requirements outside the defaults. You can set up a default vhost within the base `::apache` class, as well as set a customized vhost as default. Your customized vhost (priority 10) will be privileged over the base class vhost (15).
776776

777+
The `vhost` defined type uses `concat::fragment` to build the configuration file, so if you want to inject custom fragments for pieces of the configuration not supported by default by the defined type, you can simply add a custom fragment. For the `order` parameter for the custom fragment, the `vhost` defined type uses multiples of 10, so any order that isn't a multiple of 10 should work.
778+
779+
```puppet
780+
apache::vhost { "example.com":
781+
docroot => '/var/www/html',
782+
priority => '25',
783+
}
784+
concat::fragment { "example.com-my_custom_fragment":
785+
target => '25-example.com.conf',
786+
order => 11,
787+
content => '# my custom comment',
788+
}
789+
```
790+
777791
If you have a series of specific configurations and do not want a base `::apache` class default vhost, make sure to set the base class `default_vhost` to 'false'.
778792

779793
```puppet

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ require 'puppetlabs_spec_helper/rake_tasks'
22
require 'puppet-lint/tasks/puppet-lint'
33

44
PuppetLint.configuration.fail_on_warnings
5+
PuppetLint.configuration.send('relative')
56
PuppetLint.configuration.send('disable_80chars')
67
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
7-
PuppetLint.configuration.send('disable_class_parameter_defaults')
88
PuppetLint.configuration.send('disable_documentation')
99
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
1010
PuppetLint.configuration.send('disable_only_variable_string')

0 commit comments

Comments
 (0)