From 45be7be13c7e6835e5314523dcc11880166438ad Mon Sep 17 00:00:00 2001 From: nomi-nonsz Date: Sat, 16 Aug 2025 14:25:28 +0700 Subject: [PATCH] add using ansible manual --- README.md | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2d6003a..840f745 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,28 @@ -a Docker container for Left 4 Dead 2 Dedicated Server +An automation of the Left 4 Dead 2 Dedicated Server to a Linux server using Jenkins -# Preparation +# Node Preparation -## Ansible +## Using Ansible +Create an `inventory.ini` file for the node +```ini +[l4d2servers] +10.0.0.40 +``` + +Create an SSH key, then copy the public key to the authorized keys of the server + +```bash +ssh-keygen -t rsa -a 4096 -C "l4d2server" -f $HOME/.ssh/id_rsa_l4d2 +cat $HOME/.ssh/id_rsa_l4d2.pub +``` + +Run playbook + +```bash +ansible-playbook -i inventory.ini playbook.yml --key-file=~/.ssh/id_rsa_l4d2 -vv +``` ## Manual @@ -15,11 +33,20 @@ On the remote host you need to install: - Xvfb - PM2 -You need have these environment variables, name it `.game.env` +```bash +sudo apt update && sudo apt upgrade +sudo apt install wget unzip libarchive-tools xvfb curl +``` + +### Environments + +You need to create environment variables, name it `.game.env` ```sh export DIR_WINE="/wine" export DIR_STEAMCMD="/wine/drive_c/SteamCMD" export DIR_SERVER="/wine/drive_c/l4d2server" export WINEPREFIX=$DIR_WINE -``` \ No newline at end of file +``` + +# Jenkins Configuration \ No newline at end of file