Skip to content

Commit b6abbc8

Browse files
committed
Adding documentation and fixing some defaults for invalidate
1 parent 2d79fcb commit b6abbc8

File tree

8 files changed

+380
-165
lines changed

8 files changed

+380
-165
lines changed

README.md

+204-35
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[Beginning with AEM]: #beginning-with-aem
77

88
[Reference]: #reference
9+
[Public Classes]: #public-classes
910
[Public Defines]: #public-defines
1011
[Private Defines]: #private-defines
1112
[Private Types]: #private-types
@@ -47,6 +48,7 @@
4748
* [Setup Requirements][]
4849
* [Beginning with AEM][]
4950
1. [Reference - AEM Module type and providers][Reference]
51+
* [Public Classes][]
5052
* [Public Defines][]
5153
* [Private Defines][]
5254
* [Private Types][]
@@ -86,22 +88,185 @@ For more options and detailed explanations, please see the [Puppet AEM Wiki][wik
8688

8789
## Reference
8890

91+
- **[Public CLasses][]
92+
- [Class: aem::dispatcher](#class-aemdispatcher)
8993
- **[Public Defines][]**
94+
- [Define: aem::dispatcher::farm](#define-aemdispatcherfarm)
9095
- [Define: aem::instance](#define-aeminstance)
9196
- [Define: aem::license](#define-aemlicense)
97+
- [Define: aem::osgi::config](#define-aemosgiconfig)
9298
- [Define: aem::service](#define-aemservice)
9399
- **[Private Defines][]**
94-
- [Define: aem::package](#define-aempackage)
95100
- [Define: aem::config](#define-aemconfig)
101+
- [Define: aem::osgi::config::file](#define-aemosgiconfigfile)
102+
- [Define: aem::package](#define-aempackage)
96103
- **[Private Types][]**
97104
- [Type: Aem_Installer](#type-aem_installer)
98105
- [Type: Aem_Osgi_Config](#type-aem_osgi_config)
99106

107+
### Public Classes
108+
109+
#### Class: `aem::dispatcher`
110+
111+
Installs and configures a specified AEM Dispatcher module. For more details and examples see the [wiki](https://github.com/bstopp/puppet-aem/wiki/AEM%20Dispatcher)
112+
113+
**Note:** Currently only Apache HTTP is supported by this module.
114+
115+
#### `ensure`
116+
Optional. Adds or removes the dispatcher configuration. Valid options: `present` or `absent`. Default: `present`.
117+
118+
#### `decline_root`
119+
Optional. Sets the *DispatcherDelcineRoot* value for the dispatcher configuration. Valid options: `0`, `1`, `off` or `on`. Default: `off`.
120+
121+
#### `dispatcher_name`
122+
Optional. Sets the *name* of the dispatcher in the root dispatcher farm file. Valid options: any string.
123+
124+
##### `group`
125+
Optional. Sets the group for file ownership. Valid options: any valid group. Default: Apache's root group.
126+
127+
##### `log_file`
128+
Optional. Sets the name and location of the dispatcher log file. Valid options: any fully qualified file name. Default: *<apache log root>/dispatcher.log*.
129+
130+
##### `log_level`
131+
Optional. Sets the log level for dispatcher logging. Valid options: `0`, `1`, `2`, `3`, `error`, `warn`, `info`, `debug`. Default: `warn`.
132+
133+
#### `module_file`
134+
Required. Specifies which dispatcher module will be loaded. Valid options: any absolute path to file.
135+
136+
#### `no_server_header`
137+
Optional. Sets the *DispatcherNoServerHeader* value for the dispatcher configuration. Valid options: `0`, `1`, `off` or `on`. Default: `off`.
138+
139+
#### `pass_error`
140+
Optional. Sets the *DispatcherPassError* value for the dispatcher configuration. Valid options: any string. Default: `0`.
141+
142+
#### `use_processed_url`
143+
Optional. Sets the *DispatcherUseProcessedURL* value for the dispatcher configuration. Valid options: `0`, `1`, `off` or `on`. Default: `off`.
144+
145+
##### `user`
146+
Optional. Sets the user for for file ownership. Valid options: any valid user. Default: `root`.
147+
100148
### Public Defines
101149

150+
#### Define: `aem::dispatcher::farm`
151+
152+
Configures a single farm instance within the Dispatcher. For more details and examples, see the [wiki](https://github.com/bstopp/puppet-aem/wiki/AEM%20Dispatcher%20Farm)
153+
154+
##### `ensure`
155+
Optional. Adds or removes the dispatcher farm configuration. Valid options: `present` or `absent`. Default: `present`.
156+
157+
##### `allow_authorized`
158+
Optional. Sets the cache */allowAuthorized* rule. Valid options: `0` or `1`.
159+
160+
##### `allowed_clients`
161+
Optional. Sets the cache */allowedClients* section. Valid options: Hash, or Array of Hashes. Default:
162+
~~~ puppet
163+
{
164+
'type' => 'allow',
165+
'glob' => '*',
166+
}
167+
~~~
168+
169+
##### `cache_headers`
170+
Optional. Sets the cache */headers* section. Valid options: String or Array of Strings.
171+
172+
##### `cache_rules`
173+
Optional. Sets the cache */rules* section. Valid options: Hash, or Array of Hashes. Default:
174+
~~~ puppet
175+
{
176+
'type' => 'deny',
177+
'glob' => '*',
178+
}
179+
~~~
180+
181+
##### `cache_ttl`
182+
Optional. Sets the cache */enableTTL* rule. Valid options: `0` or `1`.
183+
184+
##### `client_headers`
185+
Optional. Sets the */clientheaders* rule. Valid options: String or Array of Strings. Default: `*`
186+
187+
##### `docroot`
188+
Required. Sets the cache */docroot* rule. Valid options: any absolute path.
189+
190+
##### `failover`
191+
Optional. Sets the */failover* rule. Valid options: `0` or `1`.
192+
193+
##### `filters`
194+
Optional. Sets the */fiters* section. Valid options: Hash, or Array of Hashes. Default:
195+
~~~ puppet
196+
{
197+
'type' => 'allow',
198+
'glob' => '*',
199+
}
200+
~~~
201+
202+
##### `grace_period`
203+
Optional. Sets the cache */grace* rule. Valid options: any positive integer.
204+
205+
##### `ignore_parameters`
206+
Optional. Sets the cache */ignoreUrlParams* section. Valid options: Hash, or Array of Hashes.
207+
208+
##### `invalidate`
209+
Optional. Sets the cache */invalidate* section. Valid options: Hash, or Array of Hashes. Default:
210+
~~~ puppet
211+
[
212+
{
213+
'type' => 'allow',
214+
'glob' => '*',
215+
}
216+
]
217+
~~~
218+
219+
##### `invalidate_handler`
220+
Optional. Sets the cache */invalidateHandler* rule. Valid options: any absolute path to file.
221+
222+
##### `propagate_synd_post`
223+
Optional. Sets the */propagateSyndPost* rule. Valid options: `0` or `1`.
224+
225+
##### `renders`
226+
Optional. Sets the */renders* section. Valid options: Hash, or Array of Hashes. Default:
227+
~~~ puppet
228+
{
229+
'hostname' => 'localhost',
230+
'port' => 4503,
231+
}
232+
~~~
233+
234+
##### `retries`
235+
Optional. Sets the */numberOfRetries* rule. Valid options: any positive integer.
236+
237+
##### `retry_delay`
238+
Optional. Sets the */retryDelay* rule. Valid options: any positive integer.
239+
240+
##### `serve_stale`
241+
Optional. Sets the cache */serveStaleOnError* rule. Valid options: `0` or `1`.
242+
243+
##### `session_management`
244+
Optional. Sets the */sessionmanagement* section. Valid options: Hash of values.
245+
246+
##### `stat_file`
247+
Optional. Sets the cache */statfile* rule. Valid options: any absolute path to file.
248+
249+
##### `stat_files_level`
250+
Optional. Sets the cache */statfileslevel* rule. Valid options: any integer >= 0.
251+
252+
##### `statistics`
253+
Optional. Sets the */statistics* section. Valid options: Hash of values.
254+
255+
##### `sticky_connections`
256+
Optional. Sets the */stickyConnectionsFor* rule or */stickyConnectionsFor* section based on value.. Valid options: String or Array of Strings.
257+
258+
##### `unavailable_penalty`
259+
Optional. Sets the */unavailablePenalty* rule. Valid options: any positive integer.
260+
261+
##### `vanity_urls`
262+
Optional. Sets the */vanity_urls* section. Valid options: Hash of values.
263+
264+
##### `virtualhosts`
265+
Optional. Sets the */virtualhosts* section. Valid options: String or Array of Strings. Default: `*`.
266+
102267
#### Define: `aem::instance`
103268

104-
Installs an AEM instance into your system.
269+
Installs an AEM instance into your system. For more details and examples see the [wiki](https://github.com/bstopp/puppet-aem/wiki/AEM%20Instance)
105270

106271
When this type is declared with the default options, Puppet:
107272

@@ -131,7 +296,7 @@ Optional. Specifies the port on which to listen for remote debugging connections
131296
Optional. Sets the group for installation. Valid options: any valid group. Default: `aem`.
132297

133298
##### `home`
134-
Optional. Sets the directory in which AEM will be installed. Valid options: Any absolute system path. Default: `/opt/aem`.
299+
Optional. Sets the directory in which AEM will be installed. Valid options: any absolute path. Default: `/opt/aem`.
135300

136301
##### `jvm_mem_opts`
137302
Optional. Specifies options for the JVM memory. This is separated from the JVM opts to simplify configurations. Valid options: any valid JVM parameter string. Default: `-Xmx1024m`.
@@ -167,7 +332,7 @@ Optional. Sets the wait period between checks for installation completion. When
167332
Required. Sets the source jar file to use, provided by user. Valid options: any absolute path to file.
168333

169334
##### `status`
170-
Optional. Changes the state of the service on the system, defining whether or not the service starts at system boot and/or is currently running. Valid values are:
335+
Optional. Changes the state of the service on the system, defining whether or not the service starts at system boot and/or is currently running. Valid options:
171336
* `enabled`: Start at boot & currently running (**Default**)
172337
* `disabled`: Not started at boot & not currently running.
173338
* `running`: Not started at boot but is currently running.
@@ -187,7 +352,7 @@ Optional. Sets the version of AEM. Informational only, does not affect installat
187352

188353
#### Define: `aem::license`
189354

190-
Manages an AEM License file. Provides a convenient tool for managing the license file contents without needing ot know the structure.
355+
Manages an AEM License file. Provides a convenient tool for managing the license file contents without needing ot know the structure. For examples, see the [wiki](https://github.com/bstopp/puppet-aem/wiki/AEM%20License)
191356

192357
** Parameters within `aem::license`:**
193358

@@ -215,37 +380,9 @@ Optional. Sets the user for for file ownership. Valid options: any valid user. D
215380
##### `version`
216381
Optional. Sets the version of AEM for the license file contents. Valid options: any string.
217382

218-
#### Define: `aem::service`
219-
220-
Manages the AEM daemon. Creating a defintion for this is not necesary unless the `aem::instance`'s *manage_service* is **false**.
221-
222-
** Parameters within `aem::service`:**
223-
224-
##### `name`
225-
Namevar. Required. Specifies the name of the AEM Service.
226-
227-
##### `ensure`
228-
Optional. Changes the state of the AEM Service within puppet. Valid values are `present` or `absent`. Default: `present`.
229-
230-
##### `group`
231-
Optional. Sets the group for file ownership. Valid options: any valid group. Default: `aem`.
232-
233-
##### `home`
234-
Required. Sets the directory in which the AEM instance exists, necessary for service configuration definition. Valid options: Any absolute system path.
235-
236-
##### `status`
237-
Optional. Changes the state of the service on the system, defining whether or not the service starts at system boot and/or is currently running. Valid options:
238-
* `enabled`: Start at boot & currently running (**Default**)
239-
* `disabled`: Not started at boot & not currently running.
240-
* `running`: Not started at boot but is currently running.
241-
* `unmanaged`: Don't manage it with service manager, running state is arbitrary.
242-
243-
##### `user`
244-
Optional. Sets the user for for file ownership. Valid options: any valid user. Default: `aem`.
245-
246383
#### Define: `aem::osgi::config`
247384

248-
Manages an AEM OSGi Configuration; allows for saving Service/Component configurations via a file or posted to the Felix Web Console.
385+
Manages an AEM OSGi Configuration; allows for saving Service/Component configurations via a file or posted to the Felix Web Console. For examples, see the [wiki](https://github.com/bstopp/puppet-aem/wiki/AEM%20OSGi%20Config)
249386

250387
** Parameters within `aem::osgi::config`:**
251388

@@ -262,7 +399,7 @@ Optional. Sets the group for file ownership. Valid options: any valid group. Def
262399
Required if **type** == `console`. Determine how to handle properties which are configured in the console, but not provided. See [wiki][wiki] for examples. Valid options: `merge` or `remove`.
263400

264401
##### `home`
265-
Required. Sets the directory in which AEM exists. Valid options: Any absolute path.
402+
Required. Sets the directory in which AEM exists. Valid options: any absolute path.
266403

267404
##### `password`
268405
Required if **type** == `console`. Sets the password of the OSGI console user. Valid options: any valid password.
@@ -279,6 +416,34 @@ Optional. Sets the user for for file ownership. Valid options: any valid user. D
279416
##### `username`
280417
Required if **type** == `console`. Sets the user for accessing the OSGI console. Valid options: any valid user.
281418

419+
#### Define: `aem::service`
420+
421+
Manages the AEM daemon. Creating a defintion for this is not necesary unless the `aem::instance`'s *manage_service* is **false**. For examples, see the [wiki](https://github.com/bstopp/puppet-aem/wiki/AEM%20Service)
422+
423+
** Parameters within `aem::service`:**
424+
425+
##### `name`
426+
Namevar. Required. Specifies the name of the AEM Service.
427+
428+
##### `ensure`
429+
Optional. Changes the state of the AEM Service within puppet. Valid options: `present` or `absent`. Default: `present`.
430+
431+
##### `group`
432+
Optional. Sets the group for file ownership. Valid options: any valid group. Default: `aem`.
433+
434+
##### `home`
435+
Required. Sets the directory in which the AEM instance exists, necessary for service configuration definition. Valid options: any absolute path.
436+
437+
##### `status`
438+
Optional. Changes the state of the service on the system, defining whether or not the service starts at system boot and/or is currently running. Valid options:
439+
* `enabled`: Start at boot & currently running (**Default**)
440+
* `disabled`: Not started at boot & not currently running.
441+
* `running`: Not started at boot but is currently running.
442+
* `unmanaged`: Don't manage it with service manager, running state is arbitrary.
443+
444+
##### `user`
445+
Optional. Sets the user for for file ownership. Valid options: any valid user. Default: `aem`.
446+
282447
### Private Defines
283448

284449
#### Define: `aem::package`
@@ -300,6 +465,10 @@ This custom type manages OSGi Configurations which are of type `console`.
300465

301466
## Limitations
302467

468+
### Dependencies
469+
470+
The `aem::dispatcher` class requires the Puppet Apache module; however since the use of this class is optional, this dependency is not delcared explicitly.
471+
303472
### OS Compatibility
304473

305474
This module has been tested on:

manifests/dispatcher.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
if ($ensure == 'present') {
6161
apache::mod { 'dispatcher' :
62-
lib => 'mod_dispatcher.so',
62+
lib => 'mod_dispatcher.so',
6363
}
6464

6565
file { "${::aem::dispatcher::params::mod_path}/${_mod_filename}" :

manifests/dispatcher/farm.pp

+15-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
$ensure = 'present',
66
$allow_authorized = undef,
77
$allowed_clients = $::aem::dispatcher::params::allowed_clients,
8-
$cache_headers = $::aem::dispatcher::params::cache_headers,
8+
$cache_headers = undef,
99
$cache_rules = $::aem::dispatcher::params::cache_rules,
1010
$cache_ttl = undef,
1111
$client_headers = $::aem::dispatcher::params::client_headers,
@@ -15,7 +15,7 @@
1515
$grace_period = undef,
1616
$health_check_url = undef,
1717
$ignore_parameters = undef,
18-
$invalidate = $::aem::dispatcher::params::invalidate,
18+
$invalidate = undef,
1919
$invalidate_handler = undef,
2020
$propagate_synd_post = undef,
2121
$renders = $::aem::dispatcher::params::renders,
@@ -109,16 +109,23 @@
109109
}
110110
}
111111

112-
if is_array($invalidate) {
113-
validate_hash($invalidate[0])
114-
$_invalidate = $invalidate
115-
} else {
116-
validate_hash($invalidate)
117-
$_invalidate = [$invalidate]
112+
if $invalidate and $invalidate_handler {
113+
fail('Both invalidate and invalidate_handler can not be set.')
118114
}
119115

120116
if $invalidate_handler {
121117
validate_absolute_path($invalidate_handler)
118+
} elsif $invalidate == undef {
119+
$_invalidate = $::aem::dispatcher::params::invalidate
120+
} else {
121+
122+
if is_array($invalidate) {
123+
validate_hash($invalidate[0])
124+
$_invalidate = $invalidate
125+
} else {
126+
validate_hash($invalidate)
127+
$_invalidate = [$invalidate]
128+
}
122129
}
123130

124131
if $propagate_synd_post {

manifests/dispatcher/params.pp

+6-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@
4343

4444
$group = $::apache::root_group
4545

46-
$invalidate = {
47-
'type' => 'allow',
48-
'glob' => '*',
49-
}
46+
$invalidate = [
47+
{
48+
'type' => 'allow',
49+
'glob' => '*',
50+
}
51+
]
5052

5153
$log_file = "${::apache::logroot}/dispatcher.log"
5254

0 commit comments

Comments
 (0)