Skip to content

Commit ba73a7a

Browse files
committed
Add Geyser Ansible role with configuration, service, and installation tasks
0 parents  commit ba73a7a

File tree

8 files changed

+420
-0
lines changed

8 files changed

+420
-0
lines changed

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Geyser Ansible Role
2+
3+
This Ansible role installs and configures Geyser on Ubuntu and Debian systems.
4+
5+
## Requirements
6+
7+
- Ansible 2.1 or higher
8+
- A target system with Ubuntu (focal, bionic, xenial) or Debian (bullseye, buster, stretch)
9+
- [SDKman from Comcast](https://github.com/Comcast/ansible-sdkman)
10+
11+
## Installation
12+
13+
Add this role to your Ansible project:
14+
15+
```sh
16+
ansible-galaxy install git+https://github.com/onelitefeathernet/ansible-role-geyser.git,geyser
17+
```

defaults/main/geyser.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
geyser:
2+
config:
3+
bedrock:
4+
#address: "0.0.0.0" # The IP address that the Bedrock server will listen on
5+
port: 19132 # The port that will listen for connections
6+
clone_remote_port: false # Makes the Bedrock port the same as the Java port every time you start the server
7+
motd1: "Geyser" # The MOTD that will be broadcasted to Minecraft: Bedrock Edition clients
8+
motd2: "Another Geyser server." # The second line of the MOTD
9+
server_name: "" # The Server Name that will be sent to Minecraft: Bedrock Edition clients
10+
compression_level: 6 # How much to compress network traffic to the Bedrock client
11+
enable_proxy_protocol: false # Whether to enable PROXY protocol or not for clients
12+
#proxy-protocol-whitelisted-ips: ["127.0.0.1", "172.18.0.0/16"] # Whitelisted IPs for PROXY protocol
13+
remote:
14+
address: "onelitefeather.net" # The IP address of the remote (Java Edition) server
15+
port: 25565 # The port of the remote (Java Edition) server
16+
auth_type: "floodgate" # Authentication type (offline, online, or floodgate)
17+
allow_password_authentication: true # Allow for password-based authentication methods through Geyser
18+
use_proxy_protocol: false # Whether to enable PROXY protocol or not while connecting to the server
19+
forward_hostname: true # Forward the hostname that the Bedrock client used to connect over to the Java server
20+
saved_user_logins: # Saved user logins for Floodgate
21+
- ThisExampleUsernameShouldBeLongEnoughToNeverBeAnXboxUsername
22+
- ThisOtherExampleUsernameShouldAlsoBeLongEnough
23+
floodgate_key_file: "key.pem" # Path to the public key generated by Floodgate
24+
pending_authentication_timeout: 300 # How many seconds to wait while user authorizes Geyser to access their Microsoft account
25+
command_suggestions: true # Prevent command suggestions from being sent to solve freezing for Bedrock clients
26+
ping_passthrough: true # Relay the MOTD from the remote server to Bedrock players
27+
protocol_name_passthrough: true # Relay the protocol name from the remote server to Bedrock players
28+
player_count_passthrough: true # Relay the player count and max players from the remote server to Bedrock players
29+
ping_passthrough_interval: 3 # How often to ping the remote server, in seconds
30+
forward_player_ping: true # Forward player ping to the server
31+
max_players: 100 # Maximum amount of players that can connect
32+
debug_mode: false # If debug messages should be sent through console
33+
allow_third_party_capes: true # Allow third party capes to be visible
34+
allow_third_party_ears: false # Allow third party deadmau5 ears to be visible
35+
show_cooldown: "title" # Allow a fake cooldown indicator to be sent
36+
show_coordinates: true # Controls if coordinates are shown to players
37+
disable_bedrock_scaffolding: false # Whether Bedrock players are blocked from performing their scaffolding-style bridging
38+
emote_offhand_workaround: "disabled" # Workaround for emotes and offhand items
39+
cache_images: 0 # Specify how many days images will be cached to disk
40+
allow_custom_skulls: true # Allows custom skulls to be displayed
41+
max_visible_custom_skulls: 128 # The maximum number of custom skulls to be displayed per player
42+
custom_skull_render_distance: 21 # The radius in blocks around the player in which custom skulls are displayed
43+
add_non_bedrock_items: true # Whether to add any items and blocks which normally do not exist in Bedrock Edition
44+
above_bedrock_nether_building: true # Workaround for building above Y127 in the Nether
45+
force_resource_packs: true # Force clients to load all resource packs if there are any
46+
xbox_achievements_enabled: false # Allows Xbox achievements to be unlocked
47+
log_player_ip_addresses: true # Whether player IP addresses will be logged by the server
48+
#default_locale: "en_US" # The default locale to use for the server
49+
notify_on_new_bedrock_update: true # Whether to alert the console and operators that a new Geyser version is available
50+
unusable_space_block: "minecraft:barrier" # Which item to use to mark unavailable slots in a Bedrock player inventory
51+
metrics_enabled: true # If metrics should be enabled
52+
scoreboard_packet_threshold: 20 # Specify after how many Scoreboard packets per seconds the Scoreboard updates will be limited
53+
enable_proxy_connections: false # Allow connections from ProxyPass and Waterdog
54+
mtu: 1400 # The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation
55+
use_direct_connection: true # Whether to connect directly into the Java server without creating a TCP connection
56+
disable_compression: true # Whether Geyser should attempt to disable compression for Bedrock players

defaults/main/main.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
geyser:
2+
java:
3+
memory: 1G
4+
user: geyser
5+
installation_path: /home/geyser/geyser
6+
name: geyser

handlers/main.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
- name: Start {{geyser.name}}
3+
systemd:
4+
name: {{geyser.name}}
5+
state: started
6+
enabled: yes
7+
daemon_reload: yes
8+
- name: Restart {{geyser.name}}
9+
systemd:
10+
name: {{geyser.name}}
11+
state: restarted
12+
daemon_reload: yes

meta/main.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
galaxy_info:
2+
role_name: geyser
3+
author: TheMeinerLP
4+
description: Installs geyser on Ubuntu and Debian systems
5+
min_ansible_version: "2.11"
6+
company: "OneLitefeather"
7+
license: "MIT"
8+
platforms:
9+
- name: Ubuntu
10+
versions:
11+
- focal
12+
- bionic
13+
- xenial
14+
- name: Debian
15+
versions:
16+
- bullseye
17+
- buster
18+
- stretch
19+
galaxy_tags:
20+
- geyser
21+
- minecraft
22+
- bedrock
23+
- java
24+
- server
25+
- proxy
26+
- geysermc
27+
- geysermcproxy
28+
- geyserproxy
29+
- geyserproxyserver
30+
31+
dependencies:
32+
- role: Comcast.sdkman

tasks/install.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
- name: "Add the user '{{geyser.user}}' with a bash shell, appending the group 'sudo' to the user's groups"
2+
ansible.builtin.user:
3+
name: {{geyser.user}}
4+
shell: /bin/bash
5+
groups: sudo
6+
append: yes
7+
state: present
8+
9+
- name: Download geyser.jar from download api
10+
ansible.builtin.get_url:
11+
url: https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/standalone
12+
dest: "{{geyser.installation_path}}/standalone.jar"
13+
mode: '0700'
14+
- name: Template a file to {{geyser.installation_path}}/config.yml
15+
ansible.builtin.template:
16+
src: /templates/config.yml.j2
17+
dest: "{{geyser.installation_path}}/config.yml"
18+
owner: {{geyser.user}}
19+
group: {{geyser.user}}
20+
mode: '0700'
21+
- name: Template a file to /etc/systemd/system/{{geyser.name}}.service
22+
ansible.builtin.template:
23+
src: /templates/geyser.service.j2
24+
dest: /etc/systemd/system/{{geyser.name}}.service
25+
owner: {{geyser.user}}
26+
group: {{geyser.user}}
27+
mode: '0700'
28+
notify:
29+
- Start geyser

0 commit comments

Comments
 (0)