3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
|
# File 'manifests/agent/config/php.pp', line 3
class appdynamics::agent::config::php
(
$agent_enable,
$agent_base,
$agent_home,
$group,
$user,
$app,
$tier,
$controller_host,
$controller_port,
$controller_ssl_enabled,
$enable_orchestration,
$account_name,
$account_access_key,
$force_agent_registration,
$node_name,
$agent_options,
$application_home,
)
{
$agent_runtime_directory = "${agent_base}/${agent_home}/appdynamics-php-agent"
file { 'php_agent_basehome':
ensure => directory,
path => "${agent_base}/${agent_home}",
group => $group,
owner => $user,
mode => '0755',
} ->
file { $agent_home:
ensure => directory,
path => $agent_runtime_directory,
group => $group,
owner => $user,
mode => '0755',
require => Class['appdynamics::agent::install'],
} ->
if $agent_enable
{
exec {'php_run_agent_install_script':
path => '/bin:/usr/bin',
command => "${agent_runtime_directory}/install.sh --ignore-permissions -a=${account_name}@${account_access_key} ${controller_host} ${controller_port} ${app} ${tier} ${node_name}",
cwd => $agent_runtime_directory,
user => 'root',
# TODO: This only fires if both fail; I need multiple, independent 'unless's.
unless => [ "test -d ${agent_runtime_directory}/multiAgentInstall",
"test $(find /etc/php* -type f -name appdynamics_agent.ini -exec grep -ic ${node_name} {} \;) -ge 1" ],
notify => Service['appdynamics-php'],
}
}
else
{
exec {'php_run_agent_uninstall_script':
path => '/bin:/usr/bin',
command => "${agent_runtime_directory}/install.sh -u --ignore-permissions; cd; rm -rf ${agent_runtime_directory}",
user => 'root',
notify => Service['httpd'],
}
}
}
|