Version information
This version is compatible with:
- Puppet Enterprise 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 4.7.0 < 5.0.0
- , , , , , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'puppetlabs-concat', '4.0.1'
Learn more about managing modules with a PuppetfileDocumentation
concat
Table of Contents
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with concat
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Overview
The concat module lets you construct files from multiple ordered fragments of text.
Module Description
The concat module lets you gather concat::fragment
resources from your other modules and order them into a coherent file through a single concat
resource.
Beginning with concat
To start using concat you need to create:
- A concat{} resource for the final file.
- One or more concat::fragment{}s.
A minimal example might be:
concat { '/tmp/file':
ensure => present,
}
concat::fragment { 'tmpfile':
target => '/tmp/file',
content => 'test contents',
order => '01'
}
Usage
Maintain a list of the major modules on a node
To maintain an motd file that lists the modules on one of your nodes, first create a class to frame up the file:
class motd {
$motd = '/etc/motd'
concat { $motd:
owner => 'root',
group => 'root',
mode => '0644'
}
concat::fragment{ 'motd_header':
target => $motd,
content => "\nPuppet modules on this server:\n\n",
order => '01'
}
# let local users add to the motd by creating a file called
# /etc/motd.local
concat::fragment{ 'motd_local':
target => $motd,
source => '/etc/motd.local',
order => '15'
}
}
# let other modules register themselves in the motd
define motd::register($content="", $order='10') {
if $content == "" {
$body = $name
} else {
$body = $content
}
concat::fragment{ "motd_fragment_$name":
target => '/etc/motd',
order => $order,
content => " -- $body\n"
}
}
Then, in the declarations for each module on the node, add motd::register{ 'Apache': }
to register the module in the motd.
class apache {
include apache::install, apache::config, apache::service
motd::register{ 'Apache': }
}
These two steps populate the /etc/motd file with a list of the installed and registered modules, which stays updated even if you just remove the registered modules' include
lines. System administrators can append text to the list by writing to /etc/motd.local.
When you're finished, the motd file will look something like this:
Puppet modules on this server:
-- Apache
-- MySQL
<contents of /etc/motd.local>
Reference
Defines
concat
: Manages a file, compiled from one or more text fragments.concat::fragment
: Manages a fragment of text to be compiled into a file.
Types
concat_file
: Generates a file with content from fragments sharing a common unique tag.concat_fragment
: Manages the fragment.
Parameters
Define: concat
All the parameters listed below are optional.
backup
Data type: Boolean, String.
Specifies whether (and how) to back up the destination file before overwriting it. Your value gets passed on to Puppet's native file
resource for execution. Valid options: true
, false
, or a string representing either a target filebucket or a filename extension beginning with ".".
Default value: 'puppet'.
ensure
Data type: String.
Specifies whether the destination file should exist. Setting to 'absent' tells Puppet to delete the destination file if it exists, and negates the effect of any other parameters. Valid options: 'present' and 'absent'.
Default value: 'present'.
ensure_newline
Data type: Boolean.
Specifies whether to add a line break at the end of each fragment that doesn't already end in one. Valid options: true
and false
.
Default value: false
.
group
Optional.
Data type: String, Integer.
Specifies a permissions group for the destination file. Valid options: a string containing a group name.
Default value: undef
.
mode
Data type: String.
Specifies the permissions mode of the destination file. Valid options: a string containing a permission mode value in octal notation.
Default value: '0644'.
order
Data type: String.
Specifies a method for sorting your fragments by name within the destination file. Valid options: 'alpha' (e.g., '1, 10, 2') or 'numeric' (e.g., '1, 2, 10').
You can override this setting for individual fragments by adjusting the order
parameter in their concat::fragment
declarations.
Default value: 'alpha'.
owner
Optional.
Data type: String, Integer.
Specifies the owner of the destination file. Valid options: a string containing a username.
Default value: undef
.
path
Data type: Stdlib::AbsolutePath.
Specifies a destination file for the combined fragments. Valid options: a string containing an absolute path.
Default value: namevar
replace
Data type: Boolean.
Specifies whether to overwrite the destination file if it already exists. Valid options: true
and false
.
Default value: true
.
show_diff
Data type: Boolean.
Specifies whether to set the show_diff parameter for the file resource. Useful for hiding secrets stored in hiera from insecure reporting methods. Valid options: true
.
Default value: true
.
validate_cmd
Optional.
Data type: String.
Specifies a validation command to apply to the destination file. Requires Puppet version 3.5 or newer. Valid options: a string to be passed to a file resource.
Default value: undef
.
warn
Data type: Boolean, String.
Specifies whether to add a header message at the top of the destination file. Valid options: the booleans true
and false
, or a string to serve as the header.
If you set 'warn' to true
, concat
adds the following line with an order
of 0
:
Default value: false
.
# This file is managed by Puppet. DO NOT EDIT.
Before 2.0.0, this parameter would add a newline at the end of the warn message. To improve flexibilty, this was removed. Please add it explicitly if you need it.
selinux_ignore_defaults
See the file
type's
selinux_ignore_defaults
documentention.
selrange
See the file
type's
selrange
documentention.
selrole
See the file
type's
selrole
documentention.
seltype
See the file
type's
seltype
documentention.
seluser
See the file
type's
seluser
documentention.
Define: concat::fragment
Except where noted, all the below parameters are optional.
content
Data type: String.
Supplies the content of the fragment. Note: You must supply either a content
parameter or a source
parameter. Valid options: a string.
Default value: undef
.
order
Data type: String, Integer.
Reorders your fragments within the destination file. Fragments that share the same order number are ordered by name. Valid options: a string (recommended) or an integer.
Default value: '10'.
source
Data type: String, Array.
Specifies a file to read into the content of the fragment. Note: You must supply either a content
parameter or a source
parameter. Valid options: a string or an array, containing one or more Puppet URLs.
Default value: undef
.
target
Required.
Data type: String.
Specifies the destination file of the fragment. Valid options: a string containing the path or title of the parent concat
resource.
Type: concat_file
backup
Data type: String, Boolean.
Specifies whether (and how) to back up the destination file before overwriting it. Your value gets passed on to Puppet's native file
resource for execution. Valid options: true
, false
, or a string representing either a target filebucket or a filename extension beginning with ".".
Default value: 'puppet'.
ensure
Data type: String.
Specifies whether the destination file should exist. Setting to 'absent' tells Puppet to delete the destination file if it exists, and negates the effect of any other parameters. Valid options: 'present' and 'absent'.
Default value: 'present'.
ensure_newline
Data type: Boolean.
Specifies whether to add a line break at the end of each fragment that doesn't already end in one. Valid options: true
and false
.
Default value: false
.
group
Data type: String, Integer.
Specifies a permissions group for the destination file. Valid options: a string containing a group name.
Default value: undef
.
mode
Data type: String.
Specifies the permissions mode of the destination file. Valid options: a string containing a permission mode value in octal notation.
Default value: '0644'.
order
Data type: String.
Specifies a method for sorting your fragments by name within the destination file. Valid options: 'alpha' (e.g., '1, 10, 2') or 'numeric' (e.g., '1, 2, 10').
You can override this setting for individual fragments by adjusting the order
parameter in their concat::fragment
declarations.
Default value: 'numeric'.
owner
Data type: String, Integer.
Specifies the owner of the destination file. Valid options: a string containing a username.
Default value: undef
.
path
Data type: String.
Specifies a destination file for the combined fragments. Valid options: a string containing an absolute path. Default value: the title of your declared resource.
Default value: namevar
.
replace
Data type: Boolean.
Specifies whether to overwrite the destination file if it already exists. Valid options: true
and false
.
Default value: true
.
tag
Data type: String.
Required. Specifies a unique tag reference to collect all concat_fragments with the same tag.
validate_cmd
Data typeL String
Specifies a validation command to apply to the destination file. Requires Puppet version 3.5 or newer. Valid options: a string to be passed to a file resource.
Default value: undef
.
Type: concat_fragment
content
Data type: String.
Supplies the content of the fragment. Note: You must supply either a content
parameter or a source
parameter. Valid options: a string.
Default value: undef
.
order
Data type: String, Integer.
Reorders your fragments within the destination file. Fragments that share the same order number are ordered by name. Valid options: a string (recommended) or an integer.
Default value: '10'.
source
Data type: String.
Specifies a file to read into the content of the fragment. Note: You must supply either a content
parameter or a source
parameter. Valid options: a string or an array, containing one or more Puppet URLs.
Default value: undef
.
tag
Data type: String.
Required. Specifies a unique tag to be used by concat_file to reference and collect content.
target
Data type: String.
Required. Specifies the destination file of the fragment. Valid options: a string containing the path or title of the parent concat_file
resource.
Removed functionality
The following functionality existed in previous versions of the concat module, but was removed in version 2.0.0:
Parameters removed from concat::fragment
:
gnu
backup
group
mode
owner
The concat::setup
class has also been removed.
Prior to concat version 2.0.0, if you set the warn
parameter to a string value of true
, false
, 'yes', 'no', 'on', or 'off', the module translated the string to the corresponding boolean value. In concat version 2.0.0 and newer, the warn_header
parameter treats those values the same as other strings and uses them as the content of your header message. To avoid that, pass the true
and false
values as booleans instead of strings.
Limitations
This module has been tested on all PE-supported platforms, and no issues have been identified.
Development
Puppet modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can't access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.
We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
For more information, see our module contribution guide.
Contributors
Richard Pijnenburg (@Richardp82)
Joshua Hoblitt (@jhoblitt)
Supported Releases 4.0.1
Summary
This is a small release that updates regex in a test due to changes made in Puppet.
Bugfixes
- (MODULES-5085) Ensure that replace test handles qoutes in change message
Supported Releases 3.0.0 & 4.0.0
Summary
This double release adds new Puppet 4 data types. The 3.0.0 release is fully backwards compatible to existing Puppet 4 configurations and provides you with deprecation warnings for every argument that will not work as expected with the final 4.0.0 release. See the stdlib docs for an in-depth discussion of this.
If you're still running Puppet 3, remain on the latest puppetlabs-concat 2.x release for now, and see the documentation to upgrade to Puppet 4.
Added
- puppet-strings documentation
- Puppet 4 data types and deprecation warnings
Changed
- stdlib dependency changed to 4.13.1
- supported Puppet version changed to 4.7.
Supported Release 2.2.1
Summary
This is a backwards compatible bugfix release.
Bugfixes
- (MODULES-4350) Makes :path the namevar for concat_file
- (MODULES-4351) Prevents the :order parameter from accepting arbitrary values in concat_file
- (MODULES-4352) Restricts the :replace parameter to values accepted by file
- (MODULES-4474) Drops auto requirement of fragments
- (MODULES-3900) Improves error messages in concat::fragment
- Uses the whole fragment title when sorting
Supported Release 2.2.0
Summary
This release includes support for Debian 8 and Ubuntu 16.04 in addition to numerous bugfixes.
Features
- Adds Debian 8 support
- Adds Ubuntu 16.04 support
Bugfixes
- Fixes the stdlib lower dependency.
- (MODULES-3027) Fixes escaping the '*' character in tag creation.
- (MODULES-3097) Fixes fragment sorting by alpha
- Correctly propagates 'validate_cmd' parameter to generated file resource
- Correctly escapes disallowed characters in fragment tag creation
- (MODULES-3332) Correct the target path validation
- (MODULES-3463) Properly passes metaparams to generated resource
Supported Release 2.1.0
Summary
This is a re-release of concat as a resource type. This release also includes new features and bugfixes on top of the previously YANKED 2.0.1 release.
Features
- Adds the show_diff property.
- Adds the selinux related file params.
- Allows integer UID/GID values to be passed into
$owner
and$group
Bugfixes
- Adds a workaround to PUP-1963: generated resources never receiving dependency edges.
- Fixes occassional failure to find directory environment.
Supported Release 1.2.5
Summary
Small release for support of newer PE versions. This increments the version of PE in the metadata.json file.
2015-07-21 - Supported Release 1.2.4
Summary
This release includes some ruby path and lint fixes.
Bugfixes
- Use correct ruby path with PE and AIO
- Lint fixes
- Use correct ruby path on FreeBSD
- Test fixes
2015-06-02 - Supported Release 2.0.1 [YANKED]
Summary
This is a bugfix release.
Bugfixes
- Fixes dependency graphing with concurrent modification of the same file.
- Fixes handling fragment target.
- Fixes the defaulted force behavior to handle empty concats correctly.
2015-06-02 - Supported Release 1.2.3
Summary
This release includes a README fix to document correct behavior of fragment target parameter.
Bugfixes
- README Fix to correctly document how a fragment $target param should work.
2015-05-12 - Supported Release 2.0.0 [YANKED]
Summary
This is a major release. Includes re-implementation of concat to use native Type and Providers, resulting in significantly improved performance and testability. Also includes a bugfix to alpha ordering of fragments.
Features
- Re-implementation of concat to use native Type and Providers.
Bugfixes
- Fixes a bug in alpha ordering of fragments.
2015-05-12 - Supported Release 1.2.2
Summary
This release includes a bugfix.
Bugfixes
- Fixes a bug introduced by MODULES-1700, in handling default retrieval of fragment backup parameter.
2015-04-14 - Supported Release 1.2.1
Summary
This release includes bugfixes, test improvements, and a rewritten README.
Bugfixes
- Verifies existence of $is_pe before using it.
- Adds validation for $order param to not allow restricted characters.
- Sets the group id on Fragments for versions of Facter that contain the $gid fact.
- Sets the script group to 0 if the script is owned by root.
- Explicitly sets script and concat directories to the same owner and group.
- Re-adds support for fragment backup, so that static compiler can work with filebucket (MODULES-1700).
2015-02-17 - Supported Release 1.2.0
Summary
This release includes a number of bugfixes and adds support for running a validation command when using puppet >= 3.5.0.
Features
- Support running a validation command for Puppet >= 3.5.0
Bugfixes
- Reset poisoned defaults from Exec
- Use concatfragments.rb on AIX since it doesn't support print0
- Make sure ruby is in the path for PE (MODULES-1456)
- Fix missing method for check_is_owned_by for windows (MODULES-1764)
- Fix sort by numeric
2014-10-28 - Supported Release 1.1.2
Summary
This release includes bugfixes and test improvements. The module was tested against SLES10 and SLES12 and found to work against those platforms with no module improvements. Metadata was updated to include those as supported platforms.
Bugfixes
- newline didn't work for Windows and Solaris. This has been fixed.
- Install certs on Windows for acceptance tests
- Update tests to work with strict variables (no module updates were required)
- Update tests to work on Windows
- Fix typo in CHANGELOG.md
2014-09-10 - Supported Release 1.1.1
Summary
This is a bugfix release, and the first supported release of the 1.1.x series.
Bugfixes
- Make the
$order
parameter default to a string and be validated as an integer or a string - Use the ruby script on Solaris to not break Sol10 support
- Add quotes to the ruby script location for Windows
- Fix typos in README.md
- Make regex in concat::setup case-insensitive to make it work on Windows
- Make sure concat fragments are always replaced
- Fix validation to allow
$backup
to be a boolean - Remove dependency on stdlib 4.x
- Fix for lack of idempotency with
ensure => 'absent'
- Fix tests and spec_helper
- Synchronized files for more consistency across modules via modulesync
2014-05-14 - Release 1.1.0
Summary
This release is primarily a bugfix release since 1.1.0-rc1.
Features
- Improved testing, with tests moved to beaker
Bugfixes
- No longer attempts to set fragment owner and mode on Windows
- Fix numeric sorting
- Fix incorrect quoting
- Fix newlines
2014-01-03 - Release 1.1.0-rc1
Summary
This release of concat was 90% written by Joshua Hoblitt, and the module team would like to thank him for the huge amount of work he put into this release.
This module deprecates a bunch of old parameters and usage patterns, modernizes much of the manifest code, simplifies a whole bunch of logic and makes improvements to almost all parts of the module.
The other major feature is windows support, courtesy of luisfdez, with an alternative version of the concat bash script in ruby. We've attempted to ensure that there are no backwards incompatible changes, all users of 1.0.0 should be able to use 1.1.0 without any failures, but you may find deprecation warnings and we'll be aggressively moving for a 2.0 to remove those too.
For further information on deprecations, please read: https://github.com/puppetlabs/puppetlabs-concat/blob/master/README.md#api-deprecations
Removed
- Puppet 0.24 support.
- Filebucket backup of all file resources except the target concatenated file.
- Default owner/user/group values.
- Purging of long unused /usr/local/bin/concatfragments.sh
Features
- Windows support via a ruby version of the concat bash script.
- Huge amount of acceptance testing work added.
- Documentation (README) completely rewritten.
- New parameters in concat:
ensure
: Controls if the file should be present/absent at all.- Remove requirement to include concat::setup in manifests.
- Made
gnu
parameter deprecated. - Added parameter validation.
Bugfixes
- Ensure concat::setup runs before concat::fragment in all cases.
- Pluginsync references updated for modern Puppet.
- Fix incorrect group parameter.
- Use $owner instead of $id to avoid confusion with $::id
- Compatibility fixes for Puppet 2.7/ruby 1.8.7
- Use LC_ALL=C instead of LANG=C
- Always exec the concatfragments script as root when running as root.
- Syntax and other cleanup changes.
2014-06-25 - Supported Release 1.0.4
Summary
This release has test fixes.
Features
- Added test support for OSX.
Bugfixes
Known bugs
- Not supported on Windows.
2014-06-04 - Release 1.0.3
Summary
This release adds compatibility for PE3.3 and fixes tests.
Features
- Added test support for Ubuntu Trusty.
Bugfixes
Known bugs
*Not supported on Windows.
2014-03-04 - Supported Release 1.0.2
Summary
This is a supported release. No functional changes were made from 1.0.1.
Features
- Huge amount of tests backported from 1.1.
- Documentation rewrite.
Bugfixes
Known Bugs
- Not supported on Windows.
2014-02-12 - 1.0.1
Summary
Minor bugfixes for sorting of fragments and ordering of resources.
Bugfixes
- LANG => C replaced with LC_ALL => C to reduce spurious recreation of fragments.
- Corrected pluginsync documentation.
- Ensure concat::setup always runs before fragments.
2013-08-09 - 1.0.0
Summary
Many new features and bugfixes in this release, and if you're a heavy concat user you should test carefully before upgrading. The features should all be backwards compatible but only light testing has been done from our side before this release.
Features
- New parameters in concat:
replace
: specify if concat should replace existing files.ensure_newline
: controls if fragments should contain a newline at the end.- Improved README documentation.
- Add rspec:system tests (rake spec:system to test concat)
Bugfixes
- Gracefully handle \n in a fragment resource name.
- Adding more helpful message for 'pluginsync = true'
- Allow passing
source
andcontent
directly to file resource, rather than defining resource defaults. - Added -r flag to read so that filenames with \ will be read correctly.
- sort always uses LANG=C.
- Allow WARNMSG to contain/start with '#'.
- Replace while-read pattern with for-do in order to support Solaris.
CHANGELOG:
- 2010/02/19 - initial release
- 2010/03/12 - add support for 0.24.8 and newer
- make the location of sort configurable - add the ability to add shell comment based warnings to top of files - add the ablity to create empty files
- 2010/04/05 - fix parsing of WARN and change code style to match rest
of the code
- Better and safer boolean handling for warn and force - Don't use hard coded paths in the shell script, set PATH top of the script - Use file{} to copy the result and make all fragments owned by root. This means we can chnage the ownership/group of the resulting file at any time. - You can specify ensure => "/some/other/file" in concat::fragment to include the contents of a symlink into the final file.
- 2010/04/16 - Add more cleaning of the fragment name - removing / from the $name
- 2010/05/22 - Improve documentation and show the use of ensure =>
- 2010/07/14 - Add support for setting the filebucket behavior of files
- 2010/10/04 - Make the warning message configurable
- 2010/12/03 - Add flags to make concat work better on Solaris - thanks Jonathan Boyett
- 2011/02/03 - Make the shell script more portable and add a config option for root group
- 2011/06/21 - Make base dir root readable only for security
- 2011/06/23 - Set base directory using a fact instead of hardcoding it
- 2011/06/23 - Support operating as non privileged user
- 2011/06/23 - Support dash instead of bash or sh
- 2011/07/11 - Better solaris support
- 2011/12/05 - Use fully qualified variables
- 2011/12/13 - Improve Nexenta support
- 2012/04/11 - Do not use any GNU specific extensions in the shell script
- 2012/03/24 - Comply to community style guides
- 2012/05/23 - Better errors when basedir isnt set
- 2012/05/31 - Add spec tests
- 2012/07/11 - Include concat::setup in concat improving UX
- 2012/08/14 - Puppet Lint improvements
- 2012/08/30 - The target path can be different from the $name
- 2012/08/30 - More Puppet Lint cleanup
- 2012/09/04 - RELEASE 0.2.0
- 2012/12/12 - Added (file) $replace parameter to concat
Dependencies
- puppetlabs/stdlib (>= 4.13.1 < 5.0.0)
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 [yyyy] [name of copyright owner] 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.