I was trying to install the vRealize Operations Telegraf agent on my VMs by following the documentation. I wrote the steps out in a Salt state file:
|
|
Salt takes the source
and puts it in the location under name
, executing it with the included arguments. However, everytime it ran I would get this:
|
|
Downloading the download.sh
script and running it interactively on the target machine also failed (using the default ubuntu account) and displayed the same error as above. Using sudo
to elevate and execute the script interactively was successful.
After a few dozen attempts tweaking the above, I eventually settled on wrapping the download.sh
script in another script delivered by SaltStack:
|
|
The above script was stored in SaltStack under /vrops/telegraf/install.sh
and now I was able to use SaltStack to fetch this new script and perform the installation:
|
|
Notice the retry
instruction for install_vrops_agent
. I found that on a fresh deployment out of vRA a VM wouldn’t necessarily be in vROPs at the time the installer.sh
script would run and would subsequently fail. Having the retry there allowed Salt to re-run the script until a suitable exit code was returned.