diff options
Diffstat (limited to 'coin/provisioning/common/windows/telegraf_password.ps1')
-rw-r--r-- | coin/provisioning/common/windows/telegraf_password.ps1 | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/coin/provisioning/common/windows/telegraf_password.ps1 b/coin/provisioning/common/windows/telegraf_password.ps1 index 11d04dbc..773ec866 100644 --- a/coin/provisioning/common/windows/telegraf_password.ps1 +++ b/coin/provisioning/common/windows/telegraf_password.ps1 @@ -31,9 +31,16 @@ ## ############################################################################# +$auth_file = "C:\Users\qt\work\influxdb\coin_vms_writer.auth" + +# Provisioning should run even without the secrets repository +if (Test-Path $auth_file) { + $auth_content = Get-Content $auth_file + $influxdb_password = $auth_content.Substring($auth_content.LastIndexOf(':') + 1) + Remove-Item $auth_file +} else { + $influxdb_password = "no_password_provided" +} -$colon_file = Get-Content "C:\Users\qt\work\influxdb\coin_vms_writer.auth" -$influxdb_password = $colon_file.Substring($colon_file.LastIndexOf(':') + 1) $telegraf_conf = "C:\telegraf-coin.conf" (Get-Content $telegraf_conf) | ForEach-Object { $_.Replace("COIN_VMS_WRITER_PASS", $influxdb_password) } | Out-File -Encoding UTF8 $telegraf_conf -Remove-Item "C:\Users\qt\work\influxdb\coin_vms_writer.auth" |