Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
- Puppet >= 7.0.0 < 9.0.0
- OpenBSD, , , , , , SLES, Solaris, AIX, FreeBSD, DragonFly, NetBSD, ,
Start using this module
Add this module to your Puppetfile:
mod 'puppet-ldapquery', '3.1.0'
Learn more about managing modules with a PuppetfileDocumentation
Puppet-LDAPquery
A Puppet function to query LDAP.
Dependencies
The Ruby net-ldap
gem is required to communicate with LDAP. To install this use the following command: puppetserver gem install net-ldap
. Version 0.11.0 or newer of net-ldap
is required.
In some environments, when ldapquery::search()
is used on Puppet Server, an error
like the following may appear.
Error while evaluating a Function Call
Please make sure you have jruby-openssl
at least 0.10.1
with puppetserver gem install jruby-openssl -v 0.10.1
.
REFERENCE
For detailed information on this module's functions, see the REFERENCE.md
Usage
This module provides two function variants. ldapquery::query
is the legacy implementation where LDAP connection options are sourced from puppet.conf
on your Puppetserver.
ldapquery::search
is the replacement implementation. It provides more flexibility than ldapquery::query
and doesn't reuse ldap
related settings from puppet.conf
. All connection options can be specified in the function call and can be different each time you call the function. For convenience, it is also possible to specify defaults to be used in all functions calls in /etc/puppetlabs/puppet/ldapquery.yaml
. This can also be useful if you want to manage the credentials used to contact your ldap server separately from the code that calls the function.
Simple example
ldapquery::search(
'dc=acme,dc=example,dc=com', # Search base
'(objectClass=dnsDomain)', # filter
['dc'], # attributes
{ # connection arguments
host => 'ldap.example.com',
auth => {
method => simple,
username => 'ldapuser',
password => 'ldappassword',
},
},
)
A full set of examples can be found in the REFERENCE.md file.
LDAP connection arguments
LDAP server connection options either have to be specified when calling the function, (in the 4th argument), or configured as defaults on the puppetserver in /etc/puppetlabs/puppet/ldapquery.yaml
Everything that the net-ldap
library supports should work with this function, (eg. connecting to multiple LDAP servers, using TLS etc.) The REFERENCE.MD file has many examples. The examples that follow have omitted this option for simplicity. It can be assumed they have been configured on the puppetserver.
Filters and attributes
Simply passing the search base and an rfc4515
search filter string to ldapquery::search()
will return
the results of the query in list form. Optionally, a list of attributes of which to return the values may also be passed.
Consider the following manifest. (For simplicity, the declaration of $ldap_args
has been left off of the following examples).
$base = 'dc=acme,dc=example,dc=com'
$filter = '(uid=zach)'
$attributes = [
'loginshell',
'uidnumber',
'uid',
'homedirectory',
]
$zach = ldapquery::search($base, $filter, $attributes)
Assuming there is only one LDAP object with the uid=zach
, then the variable
$zach
now holds the following data structure:
[
{
'uid' => ['zach'],
'loginshell' => ['/bin/zsh'],
'uidnumber' => ['123'],
'homedirectory' => ['/var/users/zach'],
}
]
Note that the key values are an array. This should make implementation code simpler, if a bit more verbose, and avoid having to check if the value is an array or a string, because it always is.
Here is a slightly more complicated example that will generate virtual
ssh_authorized_key
resources for every 'posixAccount' that has a non-empty
'sshPublicKey' attribute.
$base = 'dc=acme,dc=example,dc=com'
$attributes = [
'uid',
'sshPublicKey'
]
$key_query = '(&(objectClass=ldapPublicKey)(sshPublicKey=*)(objectClass=posixAccount))'
$key_results = ldapquery::search($base, $key_query, $attributes)
$key_results.each |$u| {
any2array($u['sshpublickey']).each |$k| {
$keyparts = split($k, ' ')
# Retrieve the comment portion
if $keyparts =~ Array[String, 3] {
$comment = $keyparts[2]
} else {
$comment = ''
}
$uid = $u['uid'][0]
@ssh_authorized_key { "${uid}_${comment}":
user => $uid,
type => $keyparts[0],
key => $keyparts[1],
tag => 'ldap',
}
}
}
The legacy function ldapquery::query
This implementation has been replaced by the more advanced version ldapquery::search
documented above. It should be considered DEPRECATED and may be removed in a future release. For completeness, documentation specific to this function is retained in this release and follows.
On the Puppetserver
You must set the necessary variables in puppet.conf
so the puppetserver can connect
to your LDAP server. You also have to place the CA certificate (and possible intermediate certificates) of the tls certificate of your ldap server in pem format in a file called ldap_ca.pem in your puppetconf folder.
You can simply add the static values like so:
[master]
ldaptls = true
ldapport = 636
ldapserver = ldap.example.com
ldapbase = dc=example,dc=com
ldapuser = cn=puppet,ou=people,dc=example,dc=com
ldappassword = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Or, use Puppet to manage the values in puppet.conf
by adding something like
the following to the manifest that manages your master's puppet.conf
.
$ldap_base = hiera('ldap_base') # dc=example,dc=com
$ldap_user = hiera('ldap_user') # cn=ldapuser,dc=puppetlabs,dc=com
$ldap_pass = hiera('ldap_pass') # ultrasecure
package { 'net-ldap':
ensure => present,
provider => 'gem'
}
file { '/etc/puppetlabs/puppet/ldap_ca.pem':
owner => 'root',
group => '0',
mode => '0644',
source => /path/to/my/ldap/ca.pem,
}
Ini_setting {
ensure => present,
section => 'master',
path => '/etc/puppetlabs/puppet/puppet.conf',
}
ini_setting { 'ldapserver':
setting => 'ldapserver',
value => 'ldap.example.com',
}
ini_setting { 'ldapport':
setting => 'ldapport',
value => '636',
}
ini_setting { 'ldapbase':
setting => 'ldapbase',
value => $ldap_base,
}
ini_setting { 'ldapuser':
setting => 'ldapuser',
value => $ldap_user,
}
ini_setting { 'ldappassword':
setting => 'ldappassword',
value => $ldap_pass,
}
ini_setting { 'ldaptls':
setting => 'ldaptls',
value => true,
}
Reference
Table of Contents
Functions
ldapquery
: DEPRECATED. Use the namespaced functionldapquery::query
instead or migrate to the replacementldapquery::search
function instead.ldapquery::query
: Provides a legacy query interface to an LDAP serverldapquery::search
: Provides a search query interface to LDAP server(s). This function is a replacement forldapquery::query
.
Functions
ldapquery
Type: Ruby 4.x API
DEPRECATED. Use the namespaced function ldapquery::query
instead or migrate to the replacement ldapquery::search
function instead.
ldapquery(Any *$args)
The ldapquery function.
Returns: Any
*args
Data type: Any
ldapquery::query
Type: Ruby 4.x API
This function uses LDAP connection options sourced from puppet.conf
and is DEPRECATED. Consider migrating to ldapquery::search
instead.
Examples
Simple query
ldapquery::query("(objectClass=dnsDomain)", ['dc'])
More complex query for ssh public keys
ldapquery::query('(&(objectClass=ldapPublicKey)(sshPublicKey=*)(objectClass=posixAccount))', ['uid', 'sshPublicKey'])
ldapquery::query(String[1] $filter, Optional[Array[String[1]]] $attributes, Optional[Options] $options)
This function uses LDAP connection options sourced from puppet.conf
and is DEPRECATED. Consider migrating to ldapquery::search
instead.
Returns: Any
Examples
Simple query
ldapquery::query("(objectClass=dnsDomain)", ['dc'])
More complex query for ssh public keys
ldapquery::query('(&(objectClass=ldapPublicKey)(sshPublicKey=*)(objectClass=posixAccount))', ['uid', 'sshPublicKey'])
filter
Data type: String[1]
The filter you want to query the LDAP server with
attributes
Data type: Optional[Array[String[1]]]
Which attributes you want to query
options
Data type: Optional[Options]
Function options where you can specify base
, scope
, and server
.
ldapquery::search
Type: Ruby 4.x API
Provides a search query interface to LDAP server(s). This function is a replacement for ldapquery::query
.
Examples
Querying an LDAP server on the default port with a username and password
ldapquery::search(
'dc=acme,dc=example,dc=com',
'(objectClass=dnsDomain)',
['dc'],
{
host => 'ldap.example.com',
auth => {
method => simple,
username => 'ldapuser',
password => 'ldappassword',
},
},
)
Trying to connect to multiple LDAP servers to perform the search
ldapquery::search(
'dc=acme,dc=example,dc=com',
'(objectClass=dnsDomain)',
['dc'],
{
hosts => [
[ldap1.example.com, 389],
[ldap2.example.com, 389],
],
auth => {
method => simple,
username => 'ldapuser',
password => 'ldappassword',
},
},
)
Not specifying ldap_args
as all options needed exist in ldapquery.yaml
.
# /etc/puppetlabs/puppet/ldapquery.yaml
# ---
# base: dc=acme,dc=example,dc=com
# host: ldap.example.com
# auth:
# method: simple
# username: ldapuser
# password: ldappassword
ldapquery::search(
undef, # `base` can also be set in `ldapquery.yaml`
'(objectClass=dnsDomain)',
['dc'],
)
Querying an LDAP server using TLS and the system cert store
ldapquery::search(
'dc=acme,dc=example,dc=com',
'(objectClass=dnsDomain)',
['dc'],
{
host => 'ldap.example.com',
port => 636,
encryption => {
method => simple_tls,
},
auth => {
method => simple,
username => 'ldapuser',
password => 'ldappassword',
},
},
)
Querying an LDAP server using TLS with a custom CA certificate
ldapquery::search(
'dc=acme,dc=example,dc=com',
'(objectClass=dnsDomain)',
['dc'],
{
host => 'ldap.example.com',
port => 636,
encryption => {
method => simple_tls,
tls_options => { ca_file => '/path/to/custom-ca.crt' },
},
auth => {
method => simple,
username => 'ldapuser',
password => 'ldappassword',
},
},
)
Querying an LDAP server on the standard port but then encrypting all traffic using STARTTLS
ldapquery::search(
'dc=acme,dc=example,dc=com',
'(objectClass=dnsDomain)',
['dc'],
{
host => 'ldap.example.com',
port => 389, # Default included for clarity
encryption => {
method => start_tls,
},
auth => {
method => simple,
username => 'ldapuser',
password => 'ldappassword',
},
},
)
Specifying a 1 minute search_timeout
, (and connect_timeout
via ldapquery.yaml
)
# /etc/puppetlabs/puppet/ldapquery.yaml
# ---
# base: dc=acme,dc=example,dc=com
# host: ldap.example.com
# auth:
# method: simple
# username: ldapuser
# password: ldappassword
# connect_timeout: 30
ldapquery::search(
undef, # Use `base` from `ldapquery.yaml`
'(objectClass=dnsDomain)',
['dc'],
{}, # Use `ldapquery.yaml`
'sub',
60,
)
ldapquery::search(Optional[String[1]] $base, Optional[String[1]] $filter, Optional[Array[String[1],1]] $attributes, Optional[Optional[LDAPArgs]] $ldap_args, Optional[Optional[Enum["sub","base","single"]]] $scope, Optional[Optional[Integer[1]]] $search_timeout, Optional[Optional[Boolean]] $soft_fail)
The ldapquery::search function.
Returns: Optional[Array]
The returned query results.
Examples
Querying an LDAP server on the default port with a username and password
ldapquery::search(
'dc=acme,dc=example,dc=com',
'(objectClass=dnsDomain)',
['dc'],
{
host => 'ldap.example.com',
auth => {
method => simple,
username => 'ldapuser',
password => 'ldappassword',
},
},
)
Trying to connect to multiple LDAP servers to perform the search
ldapquery::search(
'dc=acme,dc=example,dc=com',
'(objectClass=dnsDomain)',
['dc'],
{
hosts => [
[ldap1.example.com, 389],
[ldap2.example.com, 389],
],
auth => {
method => simple,
username => 'ldapuser',
password => 'ldappassword',
},
},
)
Not specifying ldap_args
as all options needed exist in ldapquery.yaml
.
# /etc/puppetlabs/puppet/ldapquery.yaml
# ---
# base: dc=acme,dc=example,dc=com
# host: ldap.example.com
# auth:
# method: simple
# username: ldapuser
# password: ldappassword
ldapquery::search(
undef, # `base` can also be set in `ldapquery.yaml`
'(objectClass=dnsDomain)',
['dc'],
)
Querying an LDAP server using TLS and the system cert store
ldapquery::search(
'dc=acme,dc=example,dc=com',
'(objectClass=dnsDomain)',
['dc'],
{
host => 'ldap.example.com',
port => 636,
encryption => {
method => simple_tls,
},
auth => {
method => simple,
username => 'ldapuser',
password => 'ldappassword',
},
},
)
Querying an LDAP server using TLS with a custom CA certificate
ldapquery::search(
'dc=acme,dc=example,dc=com',
'(objectClass=dnsDomain)',
['dc'],
{
host => 'ldap.example.com',
port => 636,
encryption => {
method => simple_tls,
tls_options => { ca_file => '/path/to/custom-ca.crt' },
},
auth => {
method => simple,
username => 'ldapuser',
password => 'ldappassword',
},
},
)
Querying an LDAP server on the standard port but then encrypting all traffic using STARTTLS
ldapquery::search(
'dc=acme,dc=example,dc=com',
'(objectClass=dnsDomain)',
['dc'],
{
host => 'ldap.example.com',
port => 389, # Default included for clarity
encryption => {
method => start_tls,
},
auth => {
method => simple,
username => 'ldapuser',
password => 'ldappassword',
},
},
)
Specifying a 1 minute search_timeout
, (and connect_timeout
via ldapquery.yaml
)
# /etc/puppetlabs/puppet/ldapquery.yaml
# ---
# base: dc=acme,dc=example,dc=com
# host: ldap.example.com
# auth:
# method: simple
# username: ldapuser
# password: ldappassword
# connect_timeout: 30
ldapquery::search(
undef, # Use `base` from `ldapquery.yaml`
'(objectClass=dnsDomain)',
['dc'],
{}, # Use `ldapquery.yaml`
'sub',
60,
)
base
Data type: Optional[String[1]]
The search base to use for this query. If set to undef
, the base
must be set as a default in ldapquery.yaml
instead.
filter
Data type: Optional[String[1]]
The LDAP search filter to use during the query. If set to undef
, the default objectclass=*
will be used.
attributes
Data type: Optional[Array[String[1],1]]
The LDAP attributes to return from the server.
ldap_args
Data type: Optional[Optional[LDAPArgs]]
A Hash containing the options used when connecting to the LDAP server(s). See the net-ldap documentation for all the options you can use.
This configuration is merged with, (and overrides), any options loaded from /etc/puppetlabs/puppet/ldapquery.yaml
. If omitted, ldapquery.yaml
must contain all the options you need.
scope
Data type: Optional[Optional[Enum["sub","base","single"]]]
The LDAP search scope, (indicates the set of entries at or below the search base DN that may be considered potential matches for a search operation).
search_timeout
Data type: Optional[Optional[Integer[1]]]
The maximum time in seconds allowed for a search. If not specified, defaults to 10 seconds.
Note, there is a separate net-ldap TCP connect_timout
(defaulting to 5 seconds) that can be specified via ldap_args
, (or globally via ldapquery.yaml
).
soft_fail
Data type: Optional[Optional[Boolean]]
When set to true
, the function will return undef
if it experiences an issue connecting to the LDAP server of performing the query.
Defaults to false
, which causes the function to fail with an exception if it can't return the requested data.
Changelog
All notable changes to this project will be documented in this file. Each new release typically also includes the latest modulesync defaults. These should not affect the functionality of the module.
v3.1.0 (2023-11-16)
Version 3.1.0 of the ldapquery
module introduces ldapquery::search
, a new function for LDAP search queries. This addition is part of our ongoing efforts to enhance and modernise the module. While ldapquery::search
is set to become the preferred method for LDAP queries, the existing ldapquery::query
function will remain available and unchanged until at least the next major version release.
This approach ensures a smooth transition for users as they adapt to the new functionality. We encourage users to try ldapquery::search
and share their feedback.
Implemented enhancements:
- Add Puppet 8 support #48 (bastelfreak)
Merged pull requests:
- Add replacement ldapquery::search function #47 (alexjfisher)
v3.0.0 (2023-05-24)
Breaking changes:
- Drop Puppet 6 support #41 (bastelfreak)
Implemented enhancements:
Fixed bugs:
- uninitialized constant
Net::LDAP::LdapError
#43 - Do explicit string conversion on values too #35 (arjenz)
Closed issues:
Merged pull requests:
- Convert function to modern API, refactor and namespace #45 (alexjfisher)
v2.1.0 (2021-06-25)
Implemented enhancements:
v2.0.0 (2021-06-15)
Breaking changes:
- Drop EoL puppet 5 support; add Puppet 7 #26 (bastelfreak)
Merged pull requests:
- cleanup metadata.json #25 (bastelfreak)
- Declare support for Puppet 5 & 6 #24 (ekohl)
- modulesync 3.0.0 #21 (bastelfreak)
- Ca file optional #20 (Wiston999)
- Update from xaque208 modulesync_config #17 (zachfi)
- Update from xaque208 modulesync_config #16 (zachfi)
1.0.3 (2019-02-27)
1.0.1 (2019-02-06)
Merged pull requests:
1.0.0 (2018-06-03)
Merged pull requests:
- Update from xaque208 modulesync_config #13 (zachfi)
- Update requirements for net-ldap due to CVE-2017-17718 #12 (zachfi)
0.5.1 (2018-02-10)
0.5.0 (2018-02-10)
Closed issues:
- no such file to load -- net/ldap #10
0.4.1 (2017-03-11)
0.4.0 (2017-02-20)
Merged pull requests:
0.3.1 (2016-05-18)
0.3.0 (2016-05-16)
Merged pull requests:
0.2.1 (2016-04-04)
0.2.0 (2016-03-23)
Merged pull requests:
0.1.8 (2016-03-13)
Merged pull requests:
0.1.7 (2015-11-10)
0.1.6 (2015-09-17)
0.1.5 (2015-09-15)
Merged pull requests:
0.1.4 (2015-08-20)
Merged pull requests:
0.1.3 (2015-06-14)
0.1.2 (2015-05-29)
0.1.1 (2015-05-29)
0.1.0 (2015-05-21)
Merged pull requests:
* This Changelog was automatically generated by github_changelog_generator
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [2015] [Puppet Labs] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.