...
Since the installer file is customer-related and may contain vulnerable data, it may be challenging to define a secure location where it will be placed and accessible for EC2 instance. Upload the installer file into the location where it will be publicly available for short duration. In our the use case below, we will generate a presigned AWS S3 object URL for the S3 bucket storing the installer file.
...
Code Block |
---|
#!/bin/bash
URL='<presigned URL to agent installer in your S3 bucket>'
# download agent installer
curl $URL -o /tmp/breeze-agent.tgz
# unpack agent installer
sudo tar -xf /tmp/breeze-agent.tgz -C /tmp
# install agent
sudo /tmp/breeze-agent/install.sh
|
Windows:
Code Block |
---|
<powershell>
function New-TemporaryDirectory {
$parent = [System.IO.Path]::GetTempPath()
[string]$name = [System.Guid]::NewGuid()
New-Item -ItemType Directory -Path (Join-Path $parent $name)
}
$url = "<presigned URL to agent installer in your S3 bucket>"
$tmp_dir = New-TemporaryDirectory
$agent_sfx = "$tmp_dir\breeze-agent.exe"
# download agent installer
(New-Object System.Net.WebClient).DownloadFile($url, $agent_sfx)
# install agent
Start-Process $agent_sfx -ArgumentList '-gm2' -NoNewWindow -Wait
# clean up
Remove-Item "$tmp_dir" -recurse
</powershell>
|
Windows must have PowerShell preinstalled. This script will work for all Windows Server versions starting 2012 R2 and newer.
...
Code Block |
---|
- hosts: linux vars: linux_agent: linux-breeze-agent.tgz |
Installation via Azure VM extension (Run
...
Command)
Check Navigation to get the agent installer file. Right click the file to select 'Save Link As'. Save the link*.
...
1. Create URL for accessing the agent (in case of Azure Storage, the URL has the following format: https://breezedeploy.blob.core.windows.net/agent/breeze-agent.XXXXXXXXXXXXXXXXXXXXXXX.cloudaware.20200922.0.x86_64.linux.tgz)
2. Replace AGENT_DISTRO_URL placeholder in AGENT_URL=
in the script below with the resulting URL:
...