Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

extend to work with HLL lurker #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,15 @@ resource "aws_spot_instance_request" "windows_instance" {
install_auto_login=var.install_auto_login,
install_graphic_card_driver=var.install_graphic_card_driver,
install_steam=var.install_steam,
install_steam_cmd=var.install_steam_cmd,
install_gog_galaxy=var.install_gog_galaxy,
install_origin=var.install_origin,
install_epic_games_launcher=var.install_epic_games_launcher,
install_uplay=var.install_uplay,
steam_account_email=var.steam_account_email,
steam_account_password=var.steam_account_password,
steam_app_id=var.steam_app_id,
server_address=var.server_address,
}
})
iam_instance_profile = aws_iam_instance_profile.windows_instance_profile.id
Expand Down
19 changes: 19 additions & 0 deletions templates/user_data.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ function install-chocolatey {
choco feature enable -n allowGlobalConfirmation
}

function generate-game-start-script {
Set-Content -Path C:\start_game.txt -Value '@ShutdownOnFailedCommand 1','@NoPromptForPassword 1','force_install_dir C:\gamedir','login ${var.steam_account_email} ${var.steam_account_password}','app_update ${var.steam_app_id} validate','quit'
}

function install-game {
steamcmd +runscript C:\start_game.txt
}

function start-game {
Start-Process "${var.server_address}"
}

function install-parsec-cloud-preparation-tool {
# https://github.com/jamesstringerparsec/Parsec-Cloud-Preparation-Tool
$desktopPath = [Environment]::GetFolderPath("Desktop")
Expand Down Expand Up @@ -148,6 +160,10 @@ install-graphic-driver
choco install steam
%{ endif }

%{ if var.install_steam_cmd }
choco install steamcmd
%{ endif }

%{ if var.install_gog_galaxy }
choco install goggalaxy
%{ endif }
Expand All @@ -164,4 +180,7 @@ choco install origin
choco install epicgameslauncher
%{ endif }

generate-game-start-script
install-game
start-game
</powershell>
4 changes: 4 additions & 0 deletions terraform.tfvars.exemple
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ region = ""
#instance_type = "g4dn.xlarge"
#root_block_device_size_gb = 120
custom_ami = ""
steam_account_email = "[email protected]"
steam_account_password = "somepassword"
steam_app_id = "686810"
server_address = "steam://connect/192.169.89.50:26662"

#install_parsec=true
#install_auto_login=true
Expand Down
30 changes: 30 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,36 @@ variable "install_steam" {
default = true
}

variable "install_steam_cmd" {
description = "Download and install Valve Steam CMD on first boot"
type = bool
default = true
}
variable "steam_account_email" {
description = "steam_account_email"
type = string
default = "na"
}

variable "steam_account_password" {
description = "steam_account_password"
type = string
default = "na"
}

variable "steam_app_id" {
description = "steam_app_id"
type = string
default = "na"
}

variable "server_address" {
description = "server_address"
type = string
default = "na"
}


variable "install_gog_galaxy" {
description = "Download and install GOG Galaxy on first boot"
type = bool
Expand Down