add refresh_api to jenkinsfile

This commit is contained in:
2026-04-18 16:14:22 -07:00
parent 280066436a
commit 67f3f8440b
12 changed files with 161 additions and 63 deletions

View File

@ -0,0 +1 @@
powershell -executionpolicy bypass -Command \\home.cosmos\netlogon\cosmosrm.ps1

View File

@ -0,0 +1,17 @@
# script for setting ansible service account to registry key
$username = "cosmos-ansible"
$ansible_registry = "HKLM:\SOFTWARE\Cosmos\Ansible"
$password_key = "Password"
$password = (Get-ItemProperty $ansible_registry).$password_key
# This is what the thing needs to set the password
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
# Set password
$UserAccount = Get-LocalUser -Name $username
$UserAccount | Set-LocalUser -Password $securePassword
# Make it a local admin
Add-LocalGroupMember -Group "Administrators" -Member $username
# Various Ansible Settings
Set-Item -Path WSMan:\localhost\Service\Auth\Basic -Value $true
Enable-WSManCredSSP -Role Server -Force