smartfox
SmartfoxServer 2X Ansible Role
Unofficial Ansible role that installs and configures specific version of SmartfoxServer 2X on Linux. Can also upgrade the version to some extent (if there are no breaking changes for config). Learn more about SmartFox here. Also remember to read the license and use policy of SmartFox on the official website.
Platform Support
Designed and tested on:
- Ubuntu 20.04
- Debian 10
- Rocky Linux 8
- AlmaLinux 8
- x86_64 and ARM64 architectures
Requirements
become: yes
(to root)community.general
collection (forxml
module)community.crypto
collection (foropenssl_privatekey
module)- enough memory/swap if
lxml
is not present on the target machine (for example on Rocky Linux 8, it needs more than 2GB to buildlxml
)
Role Variables
All of the variables are optional but it's highly recommended to set most of them to understand what's going on.
Basic installation essentials
smartfox_version
- default2.18.0
- used to download the correct version and verify currently installed onesmartfox_download_url
- defaulthttps://smartfoxserver.com/downloads/sfs2x/SFS2X_unix_{{ smartfox_version | replace('.', '_') }}.tar.gz
- useful to set if you have some custom pre-built packagesmartfox_target_directory
- default"/opt/smartfox"
- where to extract the archive with SmartfoxServersfs2x_directory
- more of a helper variable, default"{{ smartfox_target_directory }}/SmartFoxServer_2X/SFS2X"
- change in case your archive contains SmartFox in a different placesmartfox_user
- defaultsmartfox
- user to create and run SmartfoxServer
Configuration
smartfox_ssl_keystore_file
- defaultmykeystore.jks
copied from the role. You should change this and provide a file!smartfox_ssl_keystore_password
- defaultVeRySeCrEtPa5s
- password for the JKS. You should change this too!smartfox_admin_user
- defaultGamemaster
- initial admin username.smartfox_admin_password
- defaultG4M3mast3r
- initial admin password. Use your own.smartfox_admin_allowed_ips
- default["0.0.0.0"]
- if you don't set it yourself, you will be locked out of admin panel. Ideally use your own public IP or127.0.0.1
and reverse proxy to it. If you put an empty array here, it would be accessible from anywhere.smartfox_lock_uploads
- defaulttrue
- whether to lock extensions and servlets uploads to the server using admin panelsmartfox_tcp_port
- default9933
- TCP port to listen onsmartfox_udp_port
- default = TCP - UDP port to listen onsmartfox_banned_ips
- default[]
- list of IPs to block from connecting to the server (blacklist)smartfox_max_connections_per_address
- max amount of connections from one IP address. Default999999
Dependencies
No role dependencies except requirements.
Example Playbook
- hosts: gameserver
become: yes
vars_files:
- vars/keystore-password.yml # encrypted with ansible-vault
vars:
smartfox_admin_user: admin
smartfox_admin_password: admin
smartfox_admin_allowed_ips:
- "88.99.77.66"
smartfox_ssl_keystore_file: keystore.jks
roles:
- role: ppabis.smartfox
Also files/
directory with your own extensions/
, zones/
and keystore.jks
.
License
MIT - the playbook/role The SmartFox license is available on the official website.
Author Information
Based on my blog tutorials on how to install SmartfoxServer 2X using Ansible. The posts are available here:
ansible-galaxy install ppabis/ansible-smartfox