server/minecraft: Allowed global defining of java version

dehydrated
Felix Stupp 5 years ago
parent 37f93d9471
commit 898a30789a
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -16,6 +16,7 @@ minecraft_source_link: "{{ lookup('pipe', minecraft_source_link_generator) }}" #
minecraft_port: "25565"
minecraft_rcon_port: "25575"
minecraft_rcon_password: "{{ lookup('password', 'credentials/' + inventory_hostname + '/' + domain + '/rcon length=80') }}"
java_version: 11
minecraft_start_ram: "1G"
minecraft_max_ram: "1G"
minecraft_difficulty: "normal"

@ -4,7 +4,7 @@
apt:
state: present
name:
- openjdk-11-jre-headless
- openjdk-{{ java_version }}-jre-headless
- name: Create required read only directories
file:

@ -19,5 +19,5 @@ InaccessibleDirectories=/root /sys /srv -/opt /media -/lost+found
ReadOnlyDirectories={{ installation_directory }}
ReadWriteDirectories={{ data_directory }}
WorkingDirectory={{ data_directory }}
ExecStart=/usr/lib/jvm/java-11-openjdk-amd64/bin/java -Xms{{ minecraft_start_ram | quote }} -Xmx{{ minecraft_max_ram | quote }} -jar {{ installation_directory | quote }}/server.jar nogui
ExecStart=/usr/lib/jvm/java-{{ java_version }}-openjdk-amd64/bin/java -Xms{{ minecraft_start_ram | quote }} -Xmx{{ minecraft_max_ram | quote }} -jar {{ installation_directory | quote }}/server.jar nogui
ExecStop={{ remote_control_script }} stop

Loading…
Cancel
Save