Version information
This version is compatible with:
- , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'spacepants-ezproxy', '2.1.1'
Learn more about managing modules with a PuppetfileDocumentation
EZProxy Puppet Module
Table of Contents
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with ezproxy
- 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
Puppet module for installing, configuring, and managing OCLC's EZProxy.
Module Description
This module manages the installation and configuration of EZProxy and any dependencies and allows you to work with proxy stanzas in a more structured format.
Individual databases and sites are built into file fragments which are then concatenated together. You can also specify a remote url to use as a source for things like Sage or Oxford Journals.
Upgrading
Changes from 1.x
- This module now requires Puppet version >= 4. The last release with Puppet 3 support is
1.1.0
. - The EZProxy key is now a required parameter, as the module manages key authorization.
- The EZProxy service runs under systemd, depending on platform.
- EZProxy now logs to the
/var/log/ezproxy
directory by default now, and a logrotate rule is set for it. - All 64-bit Debian family operating systems now use
lib32z1
for compatibility. - The default group has been downcased.
- The installed EZProxy version is now available as a custom external fact:
ezproxy_version
- EZProxy can be upgraded in place if the desired version of EZProxy is different from the current version.
Parameter Changes
key
sets the EZProxy authorization or WS keyezproxy_group
is nowgroup
ezproxy_user
is nowuser
install_path
is nowinstall_dir
ezproxy_url
is nowserver_name
log_user
has been deprecatedlog_type
now sets wither to log by session or usernamedependencies
as an overridable parameter has been deprecated
Setup
What ezproxy affects
- A daemon user. Default:
ezproxy
- The install directory. Default:
/usr/local/ezproxy
- The ezproxy binary.
- EZProxy key authorization (WSKey in EZProxy 6+).
- A log directory. Default:
/var/log/ezproxy
- A logrotate rule.
- installs
lib32z1
orglibc.i686
(depending on platform) for 64-bit compatibility - installs
dos2unix
for config file sanitization $INSTALL_DIR/config.txt
which handles all of the EZProxy configuration$INSTALL_DIR/user.txt
which handles user management$INSTALL_DIR/groups.txt
which sets the order of the group include files$INSTALL_DIR/group_default.txt
which is built out of file fragments for each individual EZProxy entry- An init or systemd service, depending on platform. Note: Service management can be disabled.
Usage
This module contains a single public class with a single required parameter, the EZProxy key:
class { 'ezproxy':
key => 'my-ezproxy-key',
}
You'll probably want to provide a few basic parameters for your particular environment:
class { 'ezproxy':
key => 'my-ezproxy-key',
server_name => 'ezproxy.myinstitution.edu',
proxy_by_hostname => true,
login_port => '80',
max_sessions => '1000',
max_vhosts => '2500',
local_users => [ 'user1:supersecure:admin', ],
}
There are also two defined types for creating EZProxy stanzas depending on whether you want to provide the values yourself or grab a provided config file from a URL.
ezproxy::remote_config { 'Oxford Journals':
download_link => 'http://www.oxfordjournals.org/help/techinfo/ezproxyconfig.txt',
file_name => 'oxford_journals',
max_days => '30',
}
Note that the downloaded config fill will get passed through dos2unix
in order to strip out any potential Windows file artifacts.
ezproxy::stanza { 'FirstSearch':
urls => [ 'http://firstsearch.oclc.org/FSIP' ],
hosts => [ 'firstsearch.oclc.org' ],
domains => [ 'oclc.org' ],
}
EZProxy upgrades
EZProxy can be upgraded by incrementing this version number. This will STOP the running instance of EZProxy and attempt to upgrade.
class { 'ezproxy':
key => 'my-ezproxy-key',
version => '6.2.2',
}
Groups
If you want to set up groups, they're also available as defined types:
ezproxy::group { 'whatever':
group_order => 1,
}
You can also specify which group any stanza should use like this:
ezproxy::stanza { 'FirstSearch':
urls => [ 'http://firstsearch.oclc.org/FSIP' ],
hosts => [ 'firstsearch.oclc.org' ],
domains => [ 'oclc.org' ],
group => 'whatever',
}
Authenticating via LDAP or CAS
Aside from local user authentication, you can also set up LDAP or CAS authentication with a couple of parameters.
Configuring LDAP
If you want to set up basic anonymous LDAP authentication, you can do so like this:
class { 'ezproxy':
key => 'my-ezproxy-key',
server_name => 'ezproxy.myinstitution.edu',
ldap => true,
ldap_url => 'ldap://ldap.myinstitution.edu/CN=users,DC=myinstitution,DC=edu?uid?sub?(objectClass=person)',
}
This would add the following to the user.txt
file:
::LDAP
URL ldap://ldap.myinstitution.edu/CN=users,DC=myinstitution,DC=edu?uid?sub?(objectClass=person)
IfUnauthenticated; Stop
/LDAP
If you need to add some additional LDAP options, you can do so like this:
class { 'ezproxy':
key => 'my-ezproxy-key',
server_name => 'ezproxy.myinstitution.edu',
ldap => true,
ldap_options => [ 'BindUser CN=ezproxy,CN=users,DC=myinstitution,DC=edu', 'BindPassword verysecret' ],
ldap_url => 'ldap://ldap.myinstitution.edu/CN=users,DC=myinstitution,DC=edu?uid?sub?(objectClass=person)',
}
This would add the following to the user.txt
file:
::LDAP
BindUser CN=ezproxy,CN=users,DC=myinstitution,DC=edu
BindPassword verysecret
URL ldap://ldap.myinstitution.edu/CN=users,DC=myinstitution,DC=edu?uid?sub?(objectClass=person)
IfUnauthenticated; Stop
/LDAP
If you need to add any LDAP-authenticated admins, you can do so like this:
class { 'ezproxy':
key => 'my-ezproxy-key',
server_name => 'ezproxy.myinstitution.edu',
ldap => true,
ldap_url => 'ldap://ldap.myinstitution.edu/CN=users,DC=myinstitution,DC=edu?uid?sub?(objectClass=person)',
admins => [ 'admin1', 'admin2' ],
}
This would add the following to the user.txt
file:
::LDAP
URL ldap://ldap.myinstitution.edu/CN=users,DC=myinstitution,DC=edu?uid?sub?(objectClass=person)
IfUnauthenticated; Stop
IfUser admin1; Admin
IfUser admin2; Admin
/LDAP
Configuring CAS
If you want to set up CAS authentication, you can do so like this:
class { 'ezproxy':
key => 'my-ezproxy-key',
server_name => 'ezproxy.myinstitution.edu',
cas => true,
cas_login_url => 'https://cas.myinstitution.edu/cas-web/login',
cas_service_validate_url => 'https://cas.myinstitution.edu/cas-web/serviceValidate',
}
This would add the following to the user.txt
file:
::CAS
LoginURL https://cas.myinstitution.edu/cas-web/login
ServiceValidateURL https://cas.myinstitution.edu/cas-web/serviceValidate
/CAS
If you need to add any CAS-authenticated admins, you can do so like this:
class { 'ezproxy':
key => 'my-ezproxy-key',
server_name => 'ezproxy.myinstitution.edu',
cas => true,
cas_login_url => 'https://cas.myinstitution.edu/cas-web/login',
cas_service_validate_url => 'https://cas.myinstitution.edu/cas-web/serviceValidate',
admins => [ 'admin1', 'admin2' ],
}
This would add the following to the user.txt
file:
::CAS
LoginURL https://cas.myinstitution.edu/cas-web/login
ServiceValidateURL https://cas.myinstitution.edu/cas-web/serviceValidate
IfUser admin1; Admin
IfUser admin2; Admin
/CAS
Usage with Hiera
You can do any of the above through Hiera as well as pass in a hash of EZProxy stanzas or remote configs. That would look like this:
---
ezproxy::key: 'my-ezproxy-key'
ezproxy::server_name: 'ezproxy.myinstitution.edu'
ezproxy::proxy_by_hostname: true
ezproxy::login_port: '80'
ezproxy::max_sessions: '1000'
ezproxy::max_vhosts: '2500'
ezproxy::groups:
whatever:
group_order: 1
ezproxy::local_users:
- user1:supersecure:admin
ezproxy::remote_configs:
Oxford Journals:
download_link: 'http://www.oxfordjournals.org/help/techinfo/ezproxyconfig.txt'
file_name: 'oxford_journals'
max_days: '30'
ezproxy::stanzas:
FirstSearch:
urls:
- http://firstsearch.oclc.org/FSIP
hosts:
- firstsearch.oclc.org
domains:
- oclc.org
group: 'whatever'
Reference
Classes
Public Classes
ezproxy
: Main class, manages the installation and configuration of EZProxy
Private Classes
ezproxy::facts
: Enable external facts for running instance of EZProxy. This class is required to handle upgrades of ezproxy.ezproxy::install
: Installs EZProxyezproxy::config
: Modifies EZProxy configuration filesezproxy::service
: Manages the EZProxy service
Defined types
ezproxy::group
: Creates a user group in EZProxyezproxy::remote_config
: Adds an EZProxy configuration file from a remote URLezproxy::stanza
: Creates an EZProxy config stanza for a resource
Parameters
group
Group the ezproxy user should belong to. Default: ezproxy
user
User the ezproxy service should run as. Default: ezproxy
install_dir
Directory ezproxy should be installed in. Default: /usr/local/ezproxy
log_dir
Directory ezproxy should use for logging. Default: /var/log/ezproxy
version
Version of EZProxy to install. Default: 5.7.44
key
EZProxy authorization key. Required.
server_name
EZProxy server name. Default: $::fqdn
download_url
URL to download the ezproxy binary. Default: https://www.oclc.org/content/dam/support/ezproxy/documentation/download/binaries
proxy_by_hostname
Boolean for whether or not to proxy by hostname. Default: false
first_port
First port to use when proxying by port. Default: 5000
auto_login_ips
Array of IPs to autologin for the default group. Optional.
include_ips
Array of IPs to include for the default group. Optional.
exclude_ips
Array of IPs to exclude for the default group. Optional.
reject_ips
Array of IPs to reject for the default group. Optional.
login_port
Port to listen for HTTP. Default: 80
ssl
Boolean for whether or not to accept SSL connections. Default: false
https_login
Boolean for whether or not to force logins through SSL. Default: false
https_admin
Boolean for whether or not to force admin sessions through SSL. Default: false
max_lifetime
How long in minutes a session should remain valid after last access. Default: 120
max_sessions
Maximum number of sessions that can exist concurrently. Default: 500
max_vhosts
Maximum number of virtual hosts that ezproxy can create. Default: 1000
log_filters
Array of filters to exclude from the logs. Optional.
log_format
Array of filters to exclude from the logs. Default: %h %l %u %t "%r" %s %b
log_file
Path that ezproxy should log to. Default: /var/log/ezproxy/ezproxy.log
local_users
Array of local users to include. Optional.
admins
Array of ldap or cas users to pass to admin. Optional.
user_groups
Array of user groups to define. Optional.
cas
Boolean for whether or not to authenticate via CAS. Default: false
cas_login_url
CAS URL that should be used for login. Optional.
cas_service_validate_url
CAS URL that should be used for service validation. Optional.
ldap
Boolean for whether or not to authenticate via LDAP. Default: false
ldap_options
Array of LDAP options to include. Optional.
ldap_url
LDAP URL to use to authenticate users. Optional.
cgi
Boolean for whether or not to authenticate via CGI. Default: false
cgi_url
CGI URL to use to authenticate users. Optional.
ticket_auth
Boolean for whether or not to authenticate via ticket. Default: false
ticket_acceptgroups
Groups allowed to appear in tickets. Optional.
ticket_validtime
Minutes a ticket should be considered valid. Optional.
ticket_timeoffset
Offset in minutes when comparing ticket time. Optional.
ticket_crypt_algorithm
Hash algorithm for validating tickets. Optional.
ticket_secretkey
Shared key for validating tickets. Optional.
expiredticket_url
URL to use for expired tickets. Default: expired.html
default_stanzas
Boolean for whether or not to include the default databases from OCLC. Default: true
include_files
Array of files to include in config.txt. Optional.
remote_configs
Hash of remote config stanzas to include. Optional.
stanzas
Hash of database stanzas to include. Optional.
groups
Hash of database groups to include. Optional.
manage_service
Boolean for whether or not to manage the service. Default: true
service_name
Name of the startup script to use. Default: ezproxy
service_status
Should the service be running or stopped. Default: running
service_enable
Boolean for whether or not to start ezproxy on restart. Default: true
login_cookie_name
String for alternate cookie name for EZproxy session cookie. Optional.
http_proxy
String for forward proxy configuration for http proxy_hostname:port. Optional.
https_proxy
String for forward proxy configuration for https proxy_hostname:port. Optional.
log_type
Whether to log user by username or session. Default: Session
Limitations
This module is currently tested and working with EZProxy 5.7.44 and 6.2.2 on RedHat and CentOS 5, 6, and 7, Debian 6, 7, and 8, and Ubuntu 12.04, 14.04, and 16.04 systems.
Development
Pull requests are totally welcome. If you'd like to contribute other features or anything else, check out the contributing guidelines in CONTRIBUTING.md.
2017-07-14 Release 2.1.1
- Fixed a bug with resource ordering when upgrading EZProxy
2017-07-12 Release 2.1.0
- Added a custom external fact: ezproxy_version.
- EZProxy can be upgraded in place.
2017-07-08 Release 2.0.0
- Dropped Puppet 3 support.
- Added authorization key management.
- Added systemd support
- Set better logging defaults, including logrotate.
- Dropped ialibs-32 support.
- The default group has been downcased.
- Simplified main class params.
- Package dependencies are simplified, but no longer overridable.
2015-11-09 Release 1.1.0
- Added preliminary support for Groups. This refactors
sites.txt
into the default group. - Fixed a bug with prepended config stanza options
- Added support for supplementary include files for additional directives that might not be managed by the module
- Added ticket authentication
- Added LogUser option, which must not be used with LogSession
- Added in the LoginCookieName directive to allow for EZproxy session cookie name to be customised
- Added the ability to define Proxy and ProxySSL directives in config.txt, this allows EZProxy to operate when behind a corporate firewall without HTTP/HTTPS allowances
2015-04-16 Release 1.0.0
- Compatibility fix for concat v1.2.1
- Initial public release
2015-04-09 Release 0.1.0
- Initial release
Dependencies
- puppetlabs/stdlib (>=4.2.0 <5.0.0)
- puppetlabs/concat (>=1.0.0 <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.