Ansible role: Terraria Server
Install your Terraira server in your Ubuntu server
This palybook automatically installs the server, configures the firewall, and integrates management with systemd.
The server version is 1.4.0.1
This role requires Ansible 2.7 or higher.
The role defines its variables in defaults/main.yml
:
VARIABLE | DESCRIPTION | DEFAULT VALUE |
---|---|---|
world | world file path | "/var/terraria-worlds/myworld.wld" |
maxplayers | max player in the server | 8 |
password | password of server | terraria |
Motd | Message of the day | "Welcome!" |
world_size | World size is specified by: 1(small), 2(medium), and 3(large) | 1 |
difficulty | Sets world difficulty when using -autocreate. Options: 0(normal), 1(expert) | 0 |
worldname | world name | world |
security | Adds additional cheat protection | 1 |
worldpath | worlds directory path | /var/terraria-worlds |
language | language | en/US |
More information here: https://terraria.gamepedia.com/Server
Run with default vars:
---
- name: install terraria server
hosts: all
tags: master
roles:
- role: terraria server
Tests are performed using Molecule.
Install Molecule or use docker-compose run --rm molecule
to run a local Docker container, based on the enterclousuite/molecule project, from where you can use molecule
.
- Run
molecule create
to start the target Docker container on your local engine. - Use
molecule login
to log in to the running container. - Edit the role files.
- Add other required roles (external) in the molecule/default/requirements.yml file.
- Edit the molecule/default/playbook.yml.
- Define infra tests under the molecule/default/tests folder using the goos verifier.
- When ready, use
molecule converge
to run the Ansible Playbook andmolecule verify
to execute the test suite.
Note that the converge process starts performing a syntax check of the role.
Destroy the Docker container with the commandmolecule destroy
.
To run all the steps with just one command, run molecule test
.