add using ansible manual

This commit is contained in:
Nomi Nonsense (Nonszy) 2025-08-16 14:25:28 +07:00
parent cdc8bccef0
commit 45be7be13c

View File

@ -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 ## Manual
@ -15,11 +33,20 @@ On the remote host you need to install:
- Xvfb - Xvfb
- PM2 - 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 ```sh
export DIR_WINE="/wine" export DIR_WINE="/wine"
export DIR_STEAMCMD="/wine/drive_c/SteamCMD" export DIR_STEAMCMD="/wine/drive_c/SteamCMD"
export DIR_SERVER="/wine/drive_c/l4d2server" export DIR_SERVER="/wine/drive_c/l4d2server"
export WINEPREFIX=$DIR_WINE export WINEPREFIX=$DIR_WINE
``` ```
# Jenkins Configuration