Puppet Class: aem_orchestrator

Defined in:
manifests/init.pp

Summary

Install and configure the Shine Solution Orchestrator for Adobe Experience Manager.

Overview

Copyright © 2017-2021 Shine Solutions Group Group, unless otherwise noted.

Examples:

Declaring the class

include aem_orchestrator

Parameters:

  • service_name (String)

    The name of the service when it is installed. Defaults to aem-orchestrator and several other variables are based on it. You probably shouldn't change this.

  • basedir (String)

    Path to the base directory for installation. Defaults to '/opt/shinesolutions' and several other paths are based on it.

  • installdir (String)

    Path to the directory for installation. The JAR file and configuration files are installed here. Defaults to <basedir>/<service_name>.

  • homedir (String)

    Path to the home directory for the user the service runs as. Only used if <manage_homedir> is true.

  • user (String)

    The user the service runs as. Defaults to <service_name>.

  • group (String)

    The primary group for user the service runs as. Defaults to <service_name>.

  • jarfile_source (String)

    Source URL for the AEM Orchestrator JAR file.

  • jarfile_checksum_value (String)

    Checksum of the AEM Orchestrator JAR file. If not specified and an HTTP URL is used, Puppet will treat the File resource as updated on every run.

  • jarfile_checksum_type (String) (defaults to: 'sha256')

    The checksum algorithm used to produce jarfile_checksum_value.

  • jarfile_mode (String) (defaults to: '0500')

    File mode for the JAR file.

  • manage_basedir (Boolean) (defaults to: true)

    Whether or not to manage <basedir> as a resource in Puppet.

  • manage_installdir (Boolean) (defaults to: false)

    Whether or not to manage <installdir> as a resource in Puppet.

  • manage_homedir (Boolean) (defaults to: true)

    Whether or not to manage <homedir> as a resource in Puppet.

  • manage_user (Boolean) (defaults to: true)

    Whether or not to manage <user> as a resource in Puppet.

  • manage_group (Boolean) (defaults to: true)

    Whether or not to manage <group> as a resource in Puppet.

  • aws_profile (Variant[String, Undef]) (defaults to: undef)

    If specified, sets the AWS_PROFILE variable in the service's environment.

  • user_shell (String) (defaults to: '/usr/sbin/nologin')

    The shell to be used when managing the user. Should be the full path to the nologin shell.

Author:



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'manifests/init.pp', line 70

class aem_orchestrator (
  String $service_name,
  String $basedir,
  String $installdir,
  String $homedir,
  String $user,
  String $group,

  String $jarfile_source,
  String $jarfile_checksum_value,
  String $jarfile_checksum_type = 'sha256',
  String $jarfile_mode          = '0500',

  Boolean $manage_basedir    = true,
  Boolean $manage_installdir = false,
  Boolean $manage_homedir    = true,
  Boolean $manage_user       = true,
  Boolean $manage_group      = true,

  Variant[String, Undef] $aws_profile = undef,
  String $user_shell = '/usr/sbin/nologin',
){
  if $manage_basedir {
    file { $basedir:
      ensure => directory,
    }
    $basedir_require = File[$basedir]
  } else {
    $basedir_require = undef
  }
  if $manage_user {
    group { $group:
      ensure => present,
      system => true,
    }
    user { $user:
      ensure     => present,
      home       => $homedir,
      managehome => $manage_homedir,
      system     => true,
      shell      => $user_shell,
      gid        => $group,
      expiry     => absent,
    }
  }
  if $manage_installdir {
    file { [ $installdir ]:
      ensure  => directory,
      owner   => $user,
      group   => $group,
      require => [ $basedir_require, User[$user] ],
    }
    $file_requires = [ File[$installdir], User[$user] ]
  } else {
    $file_requires = [ User[$user] ]
  }

  $jarfile = "${installdir}/aem-orchestrator.jar"
  archive { $jarfile:
    ensure        => present,
    source        => $jarfile_source,
    checksum_type => $jarfile_checksum_type,
    checksum      => $jarfile_checksum_value,
    require       => $file_requires;
  }
  -> file { $jarfile:
    owner => $user,
    group => $group,
    mode  => $jarfile_mode,
  }

  if $facts['os']['family'] == 'redhat' {
    if $facts['os']['name'] == 'Amazon' {
      $servicefile = "/etc/init/${service_name}.conf"
      $servicetmpl = 'upstart.erb'
      $serviceprvd = 'upstart'
    } else {
      $servicefile = "/etc/systemd/system/${service_name}.service"
      $servicetmpl = 'systemd.erb'
      $serviceprvd = undef
    }
  }

  file { $servicefile:
    ensure  => file,
    content => template("aem_orchestrator/service/${servicetmpl}"),
    require => File[$jarfile],
  }

  $application_properties_file = "${installdir}/application.properties"
  class { '::aem_orchestrator::application_properties':
    path    => $application_properties_file,
    owner   => $user,
    group   => $group,
    notify  => Service[$service_name],
    require => File[$servicefile],
  }

  service { $service_name:
    ensure   => running,
    enable   => true,
    provider => $serviceprvd,
    require  => File[$application_properties_file],
  }
}