perf: use access_key file first

This commit is contained in:
Eric 2025-06-13 19:40:26 +08:00
parent 9f9a106f92
commit 6208f574a1

View File

@ -47,7 +47,7 @@
$random = -join ((1..$Length) | ForEach-Object { $chars[(Get-Random -Maximum $chars.Length)] })
return $random
}
$targetPath = "$env:USERPROFILE\AppData\Local\Programs\Tinker\data\keys\.access_key"
$targetPath = "$env:USERPROFILE\AppData\Local\Programs\Tinker\data\keys\access_key"
if (Test-Path -Path $targetPath) {
Write-Output "access_key already exists at $targetPath"
return
@ -286,6 +286,19 @@
script: |
tinkerd config --hostname {{ HOST_NAME }} --core_host {{ CORE_HOST }} --token {{ BOOTSTRAP_TOKEN }} --host_id {{ HOST_ID }} --ignore-verify-certs {{ IGNORE_VERIFY_CERTS }}
- name: Rename tinkerd keyfile
ansible.windows.win_powershell:
script: |
$source = "$env:USERPROFILE\AppData\Local\Programs\Tinker\data\keys\access_key"
$destination = "$env:USERPROFILE\AppData\Local\Programs\Tinker\data\keys\.access_key"
if (Test-Path $destination) {
$timestamp = Get-Date -Format "yyyyMMddHHmmss"
Rename-Item -Path $destination -NewName (Split-Path -Leaf "$destination.bak.$timestamp" )
}
if (Test-Path $source) {
Rename-Item -Path $source -NewName (Split-Path -Leaf $destination)
}
- name: Install tinkerd service
ansible.windows.win_powershell:
script: |