Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pe-public
cloudwatch
Commits
eca383d4
Commit
eca383d4
authored
Oct 06, 2021
by
Alex Tayts
Browse files
account for on-prem deployments
parent
4b1e3dce
Changes
1
Hide whitespace changes
Inline
Side-by-side
manifests/init.pp
View file @
eca383d4
...
...
@@ -29,6 +29,12 @@ class cloudwatch (
$resource_ensure
=
'present'
}
# determine if this server is an EC2 instance
$hosted
=
(
'ec2_metadata'
in
$facts
)
?
{
true
=>
'ec2'
,
default
=>
'onPremise'
}
# install package
package
{
'amazon-cloudwatch-agent'
:
ensure
=>
$pkg_ensure
}
...
...
@@ -44,7 +50,7 @@ class cloudwatch (
# create a toml configuration file from the default json config generated by the module
exec
{
'fetch-config'
:
command
=>
"
${agent_dir}
/bin/amazon-cloudwatch-agent-ctl -s -a fetch-config -c file:
${config_file}
"
,
command
=>
"
${agent_dir}
/bin/amazon-cloudwatch-agent-ctl -s -a fetch-config
-m
${hosted}
-c file:
${config_file}
"
,
onlyif
=>
[
"/usr/bin/test -f
${config_file}
"
],
refreshonly
=>
true
,
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment