项目作者: DSpace

项目描述 :
(No longer actively maintained. Replaced by Docker compose in main codebase.) A basic Puppet module to install DSpace (and common prerequisites).
高级语言: Puppet
项目地址: git://github.com/DSpace/puppet-dspace.git
创建时间: 2016-08-18T21:00:31Z
项目社区:https://github.com/DSpace/puppet-dspace

开源协议:

下载


puppet-dspace (A basic Puppet DSpace installer)

This module works to install DSpace on Ubuntu servers, and is used by the vagrant-dspace project and the puppet-dspace-demo module (used to create our http://demo.dspace.org site). However, your mileage may vary, and it has not been tested in Production scenarios. Pull requests are welcome!

Module description

This module lets you use Puppet to install DSpace, including all of its base prerequisites.

This includes installing the following:

  • Java (OpenJDK)
  • Maven (necessary to build DSpace from source)
  • Ant (necessary to install or deploy DSpace)
  • Git (to download DSpace source from GitHub)

Optionally, this module may also be used to install:

Primarily, this module was built to support vagrant-dspace and http://demo.dspace.org. As such, at this time, it only concentrates on the DSpace installation process (and does not yet cover upgrades/updates).

Requirements

  • Currently, this module has only been tested on Ubuntu 16.04 LTS. It may work on earlier versions of Ubuntu or Debian, but is currently not guaranteed to work on any other OS.
  • If you wish to use dspace::tomcat_instance, you MUST install puppetlabs-tomcat alongside this module.
  • If you wish to use dspace::postgresql_db, you MUST install puppetlabs-postgresql alongside this module.

Usage

Configure DSpace installation

For default settings, simply declare the dspace class:

  1. class { 'dspace': }

To customize DSpace installation settings, you can override any of the default parameters (see init.pp for a full list):

  1. class { 'dspace':
  2. # Base settings
  3. java_version => '8',
  4. postgresql_version => '9.5',
  5. tomcat_package => 'tomcat8',
  6. owner => 'vagrant', # OS user who "owns" DSpace
  7. # Database specific settings
  8. db_name => 'dspace', # Name of database to use
  9. db_owner => 'dspace', # DB owner account info
  10. db_owner_passwd => 'dspace',
  11. db_admin_passwd => 'postgres',
  12. # Tomcat specific settings
  13. tomcat_port => 8080,
  14. catalina_opts => '-Dfile.encoding=UTF-8 -Xmx2048m -Xms1024m',
  15. # DSpace installation settings
  16. git_repo => 'git@github.com:myacccount/DSpace.git', # Git repo to use for DSpace source
  17. git_branch => 'dspace-5_x', #Git branch to use
  18. # DSpace Admin Account settings
  19. admin_firstname => 'Jane',
  20. admin_lastname => 'Doe',
  21. admin_email => 'jane.doe@myu.edu',
  22. admin_passwd => 'mypassword',
  23. admin_language => 'en',
  24. }

Install PostgreSQL (Optional)

Optionally, you can choose to use this module to install a PostgreSQL database for DSpace to use. This REQUIRES that you’ve installed puppetlabs-postgresql or a compatible Puppet module.

(NOTE: DSpace requires either a PostgreSQL or Oracle database. So, if you do not use this module, you must install one by some other means.)

For default settings (or to inherit the PostgreSQL settings passed in to dspace class), simply create a new dspace::postgresql_db passing it the name of the database to create:

  1. dspace::postgresql_db { 'dspace' :
  2. }

To customize the PostgreSQL database, either tweak the PostgreSQL settings passed to the dspace class, or tweak them in the dspace::postgresql_db class similar to this:

  1. dspace::postgresql_db { 'dspace' :
  2. version => '9.5',
  3. admin_passwd => 'postgres', # Password for 'postgres' admin acct
  4. owner => 'dspace', # PostgreSQL user acct which owns this database
  5. owner_passwd => 'dspace', # Password for owner acct
  6. port => 5432,
  7. locale => 'en_US.UTF-8',
  8. }

Install Tomcat (Optional)

Optionally, you can choose to use this module to install Tomcat. This REQUIRES that you’ve installed puppetlabs-tomcat or a compatible Puppet module.

(NOTE: DSpace requires Tomcat or a similar servlet container. So, if you do not use this module, you must install Tomcat (or similar) by some other means.)

For default settings (or to inherit the Tomcat settings passed in to dspace class), simply create a new instance pointing at your appBase of choice:

  1. dspace::tomcat_instance { "/home/${dspace::owner}/dspace/webapps" :
  2. }

To customize the Tomcat installation, either tweak the Tomcat settings passed to the dspace class, or tweak them in the dspace::tomcat_instance class similar to this:

  1. dspace::tomcat_instance { "/home/${dspace::owner}/dspace/webapps" :
  2. package => 'tomcat8', # OS Tomcat package to install
  3. owner => 'dspace', # OS owner of Tomcat
  4. service => 'tomcat8', # Name of Tomcat service
  5. port => '8080',
  6. catalina_home => '/usr/share/tomcat8',
  7. catalina_base => '/var/lib/tomcat8',
  8. catalina_opts => '-Dfile.encoding=UTF-8 -Xmx2048m -Xms1024m',
  9. }

Create OS Owner (Optional)

Optionally, you can use dspace::owner to create a new operating system account that will own DSpace (and Tomcat). This can also be done by other means, obviously.

Here’s an example of creating a new ‘dspace’ OS level account which will act as our DSpace owner:

  1. dspace::owner { 'dspace':
  2. gid => 'dspace', # Primary OS group name / ID
  3. groups => 'other groups', # Additional OS groups
  4. sudoer => true, # Whether to add acct as a sudoer
  5. }

Install DSpace

For default settings (or to inherit the settings passed in to dspace class), simply create a new install pointing at your installation directory:

  1. dspace::install { "/home/${dspace::owner}/dspace" :
  2. require => DSpace::Postgresql_db[$dspace::db_name], # Must first have a database
  3. notify => Service['tomcat'], # Tell Tomcat to reboot after install
  4. }

To customize the DSpace installation, either tweak the settings passed to the dspace class, or tweak them in the dspace:install class similar to this:

  1. dspace::install { "/home/${dspace::owner}/dspace" :
  2. owner => 'dspace', # OS owner of DSpace
  3. src_dir => "/home/${dspace::owner}/dspace-src", # Full path to source code directory
  4. git_repo => 'git@github.com:myacccount/DSpace.git', # Git repo to use for DSpace source
  5. git_branch => 'dspace-5_x', #Git branch to use
  6. admin_firstname => 'Jane',
  7. admin_lastname => 'Doe',
  8. admin_email => 'jane.doe@myu.edu',
  9. admin_passwd => 'mypassword',
  10. admin_language => 'en',
  11. port => 8080, # Reference to Tomcat port DSpace will be available at
  12. db_name => 'dspace', # Name of database to use for this install
  13. db_port => 5432, # DB port to use
  14. db_user => 'dspace', # DB account to use for database
  15. db_passwd => 'dspace', # DB account password
  16. }

Putting it all together. Installing everything!

A good example of installing everything (PostgreSQL, Tomcat and DSpace) together can be found in the vagrant-dspace setup.pp Puppet script. This script initialized the Vagrant VM using this puppet-dspace module.

Another (similar) example can be found in the puppet-dspace-demo module, which uses this puppet-dspace module to setup the http://demo.dspace.org demo site. In puppet-dspace-demo, the manifests/site.pp uses this module to install PostgreSQL, Tomcat, an OS owner account and DSpace.

Development

Pull requests are welcome! This is really just a labor of love, and we can use help in making it better.

License

This work is licensed under the DSpace BSD 3-Clause License, which is just a standard BSD 3-Clause License.