File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 1+ Write-Host " --- Installing Python runtime ---" - ForegroundColor blue
2+ .\python-install.exe / quiet InstallAllUsers= 1 PrependPath= 1 Include_test= 0 Include_launcher= 0
3+ python.exe - m pip install -- upgrade pip
4+ Write-Host " --- Python runtime installed ---`n " - ForegroundColor green
5+
6+ # Update Path variable with installed Python
7+ $env: Path = [System.Environment ]::GetEnvironmentVariable(" Path" , " Machine" ) + " ;" + [System.Environment ]::GetEnvironmentVariable(" Path" , " User" )
8+
9+ Write-Host " --- Installing Patroni packages ---" - ForegroundColor blue
10+ Set-Location ' patroni'
11+ pip3.exe install -- no- index -- find-links .patroni- packages - r requirements.txt
12+ pip3.exe install -- no- index -- find-links .patroni- packages psycopg2- binary
13+ Set-Location ' ..'
14+ Write-Host " --- Patroni packages installed ---`n " - ForegroundColor green
15+
16+ Write-Host " --- Adding local user 'pes' for patroni service ---" - ForegroundColor blue
17+ $Password = -join ((65 .. 90 ) + (97 .. 122 ) | Get-Random - Count 8 | % {[char ]$_ })
18+ $SecurePassword = ConvertTo-SecureString $Password - AsPlainText - Force
19+ New-LocalUser " pes" - Password $SecurePassword - Description " Patroni service account"
20+ $ConfFile = ' patroni\patroni_service.xml'
21+ (Get-Content $ConfFile ) -replace ' 12345' , $Password | Out-File - encoding ASCII $ConfFile
22+ Write-Host " User password: $Password "
23+ Write-Host " --- Patroni user added ---`n " - ForegroundColor green
24+
25+ Write-Host " --- Installation sucessfully finished ---" - ForegroundColor green
Original file line number Diff line number Diff line change 88 <log mode =" roll" ></log >
99 <logpath >%BASE%\log</logpath >
1010 <serviceaccount >
11- <user >postgres </user >
11+ <user >pes </user >
1212 <password >12345</password >
1313 <allowservicelogon >true</allowservicelogon >
1414 </serviceaccount >
You can’t perform that action at this time.
0 commit comments