Install Applications - Add support to copy app directory
Closed this issue · 3 comments
We are in the process of upgrading to OnDemand 3.0.0.
We are using Puppet6 and the openondemand
puppet module from feature/ondemand-2.1
branch.
We are looking into how to install our interactive applications under /var/www/ood/apps/sys
At the moment, we cannot use openondemand::install_apps
hash to configure our applications because the function openondemand::install::app
does not support module files (as far as we know). Our apps are configure as directories in the puppet module we create to configure our server.
We could use standard puppet file
resources to configure our apps, but we are wondering if updating the openondemand::install_apps
to support module files would be useful.
This is a draft proposal update to the openondemand::install::app
function:
# @summary Manage Open OnDemand app
#
# @example
# openondemand::install::app { 'bc_osc_foo':
# ensure => '0.1.0-1.el7',
# }
#
# @param ensure
# Package ensure property if installing from a package
# @param package
# Package name for the app
# @param manage_package
# Should package be managed
# @param git_repo
# The git repo to use to install the app
# If defined, no package will be installed
# @param git_revision
# The git revision to checkout
# @param path
# Path to app, defaults to `/var/www/ood/apps/sys/$name`
# @param app_source
# The path to the directory to copy the application contents from
# @param owner
# File owner of app
# @param group
# File group owner of app
# @param mode
# File mode for app
#
define openondemand::install::app (
String $ensure = 'present',
String $package = "ondemand-${name}",
Boolean $manage_package = true,
Optional[String] $git_repo = undef,
Optional[String] $git_revision = undef,
Optional[Stdlib::Absolutepath] $path = undef,
Optional[String] $app_source = undef,
String $owner = 'root',
String $group = 'root',
String $mode = '0755',
) {
include openondemand
$_path = pick($path, "${openondemand::web_directory}/apps/sys/${name}")
if $manage_package and ! $git_repo {
ensure_resource('package', $package, {
'ensure' => $ensure,
'require' => Package['ondemand'],
})
}
if $app_source {
$_app_source = "${app_source}/${name}"
$recurse = 'remote'
}
if $git_repo {
vcsrepo { $_path:
ensure => $ensure,
source => $git_repo,
revision => $git_revision,
provider => 'git',
require => Package['ondemand'],
}
}
if $ensure != 'absent' {
file { $_path:
ensure => 'directory',
source => $_app_source,
recurse => $recurse,
owner => $owner,
group => $group,
mode => $mode,
}
if $manage_package and ! $git_repo {
Package[$package] -> File[$_path]
}
if $git_repo {
Vcsrepo[$_path] -> File[$_path]
}
}
}
Sample usage:
openondemand::install_apps:
RStudio:
app_source: '/vagrant/files/apps'
manage_package: false
JBrowse:
app_source: 'puppet:///modules/ood/apps'
manage_package: false
Jupyter:
app_source: '/vagrant/files/apps'
manage_package: false
This is part of v4.1.0. Instead of app_source
it's just source
.