Puppet Class: aem_stack_manager
- Defined in:
- manifests/init.pp
Summary
Install and configure the Shine Solution Stack Manager for Adobe Experience ManagerOverview
Copyright © 2017 Shine Solutions Group, unless otherwise noted.
65 66 67 68 69 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 |
# File 'manifests/init.pp', line 65
class aem_stack_manager (
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,
){
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 => '/usr/sbin/nologin',
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-stack-manager.jar"
$servicefile = "/etc/systemd/system/${service_name}.service"
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' {
file { $servicefile:
ensure => file,
content => template('aem_stack_manager/service.conf.erb'),
require => File[$jarfile],
}
}
class { '::aem_stack_manager::application_properties':
path => "${installdir}/application.properties",
owner => $user,
group => $group,
notify => Service[$service_name],
require => File[$servicefile],
}
service { $service_name:
ensure => running,
enable => true,
}
}
|