Defined Type: openondemand::install::app

Defined in:
manifests/install/app.pp

Summary

Manage Open OnDemand app

Overview

Examples:

openondemand::install::app { 'bc_osc_foo':
  ensure => '0.1.0-1.el7',
}

Parameters:

  • ensure (String) (defaults to: 'present')

    Package ensure property if installing from a package

  • package (String) (defaults to: "ondemand-${name}")

    Package name for the app

  • manage_package (Boolean) (defaults to: true)

    Should package be managed

  • git_repo (Optional[String]) (defaults to: undef)

    The git repo to use to install the app If defined, no package will be installed

  • git_revision (Optional[String]) (defaults to: undef)

    The git revision to checkout

  • source (Optional[String]) (defaults to: undef)

    The Puppet source path for app

  • path (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    Path to app, defaults to /var/www/ood/apps/sys/$name

  • owner (String) (defaults to: 'root')

    File owner of app

  • group (String) (defaults to: 'root')

    File group owner of app

  • mode (String) (defaults to: '0755')

    File mode for app



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'manifests/install/app.pp', line 30

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[String] $source = undef,
  Optional[Stdlib::Absolutepath] $path = undef,
  String $owner = 'root',
  String $group = 'root',
  String $mode  = '0755',
) {
  include openondemand

  $_path = pick($path, "${openondemand::web_directory}/apps/sys/${name}")

  if $source {
    $recurse = 'remote'
  } else {
    $recurse = undef
  }

  if $manage_package and ! $git_repo {
    ensure_resource('package', $package, {
        'ensure'  => $ensure,
        'require' => Package['ondemand'],
    })
  }

  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',
      owner   => $owner,
      group   => $group,
      mode    => $mode,
      source  => $source,
      recurse => $recurse,
    }

    if $manage_package and ! $git_repo {
      Package[$package] -> File[$_path]
    }
    if $git_repo {
      Vcsrepo[$_path] -> File[$_path]
    }
  }
}