Created
November 12, 2015 22:34
-
-
Save olivielpeau/71b1cb117800512bdb9b to your computer and use it in GitHub Desktop.
Updating the Datadog agent hostname (on Elastic Beanstalk, Windows)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files: | |
"c:\\datadog\\ddagent-cli.msi": | |
source: https://s3.amazonaws.com/volusion-vnext-api-environment/ddagent-cli.msi | |
"c:\\init_scripts\\update_agent_hostname.ps1": | |
content: | | |
#stop DatadogAgent service | |
Stop-Service -Name DatadogAgent; | |
$hostname = Invoke-RestMethod -uri http://169.254.169.254/latest/meta-data/hostname | |
Add-Content C:\ProgramData\Datadog\datadog.conf "`rhostname: $hostname" | |
#start DatadogAgent service | |
Start-Service -Name DatadogAgent; | |
commands: | |
01_install_datadog_agent: | |
command: msiexec /qn /i c:\\datadog\\ddagent-cli.msi APIKEY=""{1}"" | |
waitAfterCompletion: 0 | |
02_update_agent_hostname: | |
command: powershell -ExecutionPolicy RemoteSigned -File .\\update_agent_hostname.ps1 | |
cwd: c:\\init_scripts | |
waitAfterCompletion: 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
where is this powershell script? update_agent_hostname.ps1?